Tock is an operating system designed for running multiple concurrent, mutually distrustful applications on Cortex-M based embedded platforms like the Storm. Tock's design centers around protection, both from potentially malicious applications and from device drivers. Tock uses two mechanisms to protect different components of the operating system. First, the kernel and device drivers are written in Rust, a systems programming language that provides compile-time memory safety, type safety and strict aliasing. Tock uses Rust to protect the kernel (e.g. the scheduler and hardware abstraction layer) from platform specific device drivers as well as isolate device drivers from each other. Second, Tock uses memory protection units to isolate applications from each other and the kernel.
- Rust 1.0.0-alpha.2
- arm-none-eabi toolchain (version >= 4.9)
- stormloader (recommended) or JLinkExe for programming the storm
- Command line utilities: wget, sed, make
Compiling Rust takes a long time, and while Rust is changing, you'll need to use a version that is known to compile Tock. We've linked binary distributions of such a version for various OSs below:
On Mac OS X, you can get the arm-none-eabi toolchain via port:
$ port install arm-none-eabi-gcc
or via homebrew:
$ brew tap PX4/homebrew-px4
$ brew update
$ brew install gcc-arm-none-eabi-49
On Linux it is available through many distribution managers:
$ pacman -S arm-none-eabi-gcc
$ apt-get install gcc-arm-none-eabi
For Windows and other operating systems, download site is here.
Alternatively, if you would like simulator mode in arm-none-eabi-gdb
,
you can use the build scripts in the tools
directory, in this order:
build-arm-binutils
then build-arm-gcc
then build-arm-gdb
.
You'll need to install libftdi-0.20.tar.gz for stormloader to function; newer versions will not work. In turn, libftdi depends on libusb and libusb-config. On OS X, you can satisfy the libftdi prereqs via homebrew:
brew install libusb libusb-compat
You can obtain stormloader via pip (python2 only, currently):
sudo pip install stormloader
You can update stormloader via pip as well:
sudo pip install -U stormloader
Then add a udev rule (Ubuntu) for the FTDI chip:
sudo su
echo 'ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", MODE="0666"' > /etc/udev/rules.d/99-storm.rules
If all the tools are in your $PATH
, you should be good to go. Otherwise set the env variables:
RUSTC
-rustc
compilerCC
-arm-none-eabi-gcc
OBJCOPY
-arm-none-eabi-objcopy
Simply call make:
make
If you are using the stormloader, there is a make
rule that compiles the
source and programs the storm:
make program
If you are using JLinkExe
, use the script included in the source root
directory:
JLinkExe prog.jlink
To get the UART printf from firestorm:
sload tail