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-gccor via homebrew:
$ brew tap PX4/homebrew-px4
$ brew update
$ brew install gcc-arm-none-eabi-49On Linux it is available through many distribution managers:
$ pacman -S arm-none-eabi-gcc
$ apt-get install gcc-arm-none-eabiFor 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-compatYou can obtain stormloader via pip (python2 only, currently):
sudo pip install stormloaderYou can update stormloader via pip as well:
sudo pip install -U stormloaderThen 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.rulesIf all the tools are in your $PATH, you should be good to go. Otherwise set the env variables:
RUSTC-rustccompilerCC-arm-none-eabi-gccOBJCOPY-arm-none-eabi-objcopy
Simply call make:
makeIf you are using the stormloader, there is a make rule that compiles the
source and programs the storm:
make programIf you are using JLinkExe, use the script included in the source root
directory:
JLinkExe prog.jlinkTo get the UART printf from firestorm:
sload tail