[Tinyos-help] TinyOS memory management
cory at moteiv.com
Thu Sep 22 17:29:37 PDT 2005
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
PFLAGS += -DTOSH_MAX_TASKS_LOG2=8
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
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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tinyos-help