[Tinyos-help] TinyOS memory management

Cory Sharp cory at moteiv.com
Thu Sep 22 17:29:37 PDT 2005

Hi Kevin,

1) You can find the complete, concise source code for the TinyOS scheduler /
task queue in tinyos-1.x/tos/sched.c. Short answer, it's FIFO.

2) The memory is static, though you can easily increase the number of
entries in the task queue at compile time like this


which allocates 256 entries for pending tasks in the system. I believe the
defaults is 3 for a total of 8 pending tasks in the system.

3) A task queue overflow can't corrupt RAM, the task just doesn't enter the
queue and will never execute, indicated when post returns FAIL. On the other
hand, most microcontrollers have little to no memory protection. So, all a
malicious program need to do is construct a memory pointer and start blowing
away memory.

4) We've somewhat redesigned the task system in TinyOS 2.x.

Cory Sharp <cory at moteiv.com>

On 9/22/05, Kevin Pearson <elcidpeteypab at gmail.com> wrote:
> I am currently working on a project in which I have designed software to
> overflow the task queue and crash the motes I am working with.
> My questions are:
> What system does TinyOS use to govern the Task Queue?
> Is the memory space static, or does it get dynamically allocated to meet
> its requirement.
> Are there currently any measures to prevent a clever task queue overflow
> program from overwriting vital data stored in memory in order to change some
> of the TinyOS operating system components?
> Are there any current measures to monitor available memory to prevent a
> task queue overflow from crashing the system, such as discarding posted
> tasks in order to preserve currently executing programs?
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at Millennium.Berkeley.EDU
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20050922/88418e17/attachment-0001.html

More information about the Tinyos-help mailing list