Tiny OS
Tiny OS
Tiny OS
Active Messages
packet
3450 B code
clocks
226 B data
bit
RFM
Graph of cooperating
state machines
on shared stack
Application = Graph of
Components+Scheduler
TOS application = graph of components +
scheduler
main {
// component initialization
while(1) { Main (includes Scheduler)
while(more_tasks)
schedule_task; Application (User Components)
sleep;
} // while
Actuating Sensing Communication
} // main Communication
Hardware Abstractions
TOS Execution Model
commands request action
application comp data processing
ack/nack at every boundary
call cmd or post task message-event driven
events notify occurrence active message
packet
Radio Packet crc
call cmds
event-driven byte-pump
post tasks
Radio byte
byte
Tasks provide logical concurrency encode/decode
command CmdName(args) {
...
event EvtName)(args) { return status;
... }
return status;
}
{
...
status = signal EvtName(args)
...
}
TinyOS Execution Contexts
Tasks
events
commands
Interrupts