TinyOS

Iliana Avila-Campillo
Jason Dougherty
Sze Ying Kong

CSE 466 - Autumn 2000

High-level view

The TinyOS project is a research project at U.C. Berkeley (or Berzerkeley as some describe it). The concept was to develop a compact operating system for use on distributed networked sensors. The processor on such sensors is pretty limited in processing power, RAM and ROM, so efficiency in the OS is critical. Low electrical power consumption was also a key design goal, and the OS was designed to help achieve this. Much information exists regarding the concept and design of TinyOS, so rather than repeat it here, we'll just present some links.

For starters, take a look at the presentation we prepared for CSE 466 in Autumn 2000. It distills much of what we learned into the obligatory PowerPoint presentation. The TinyOS home page at Berkeley is located here. It contains links to many presentations and papers that the TinyOS Group has prepared. These are then ones we found most useful: A good system-level presentation of TinyOS; A formal paper describing TinyOS design and networked sensor architecture; and a tutorial for actually writing code for TinyOS components (it's still a PowerPoint presentation, but it has some technical details).

Nitty-gritty details

Once you're done oohing and ahhing over the brilliance of this concept, you may want to actually write some code to develop your own network sensors or port the OS to a different processor. This is when you will start pulling your hair out. The documentation of the technical details of TinyOS is, well, a bit limited to say the least, and often appears to be outdated. Comments in the source code are used sparingly, most often for removing no-longer-needed sections of code.

Start by downloading a zipped up copy of the latest version of TinyOS (4.2 as of this writing) from the TinyOS home page. Then read the README file. It tells roughly how to go about defining the architecture and building the OS and application. It does have some errors and omissions which will be discussed in a moment.

Be advised that the zip file DOES NOT include everything you need to build and run TinyOS. In other words, you can't just unzip it, type "make" and have a running OS and application. Notably missing are several hardware-related header files: signal.h, interrupt.h, io8535.h. As noted in the README file, it's assumed that you have Atmel Tools installed in a local directory. Presumably these files are part of that package. Also missing is the header file for the main program, main.h.

There are also some generated files which you will need to generate yourself if you want to see what their content and format is. These include headers for all of the components as well as super.h. Normally these are generated by Perl scripts when make is run.

The major apparent error in the README file concerns the use of VHDL to describe the graph of components. The description of this graph is allegedly contained in *.vhd files, which are processed by a Perl script called mksuper. In fact, there are no actual *.vhd files to be found anywhere in the distribution, but there are a whole lot of *.desc files that appear to describe the same graph. And while there is no mksuper script, there are mksuper_vhdl and mksuper_desc scripts, and Makefile runs the latter. It appears that the method for describing the graph of components was changed, but the documentation was not updated

The README file also neglects to mention the use of *.comp files to describe components. These files list the events and commands that a component sends and receives, and are used to generate C header files via a Perl script, mkheader, run by Makefile.

Porting to a different processor

Porting TinyOS to the Atmel 8051 was our original goal, however, once we understood the intricacies of the implementation, it became apparent that there was not enough time to address all of the necessary issues. What follows is a list, possibly incomplete, of things which would likely need to be changed.