60 likes | 170 Views
Implementing Context Aware Applications. Class 5. Agenda. Review of TinyOS execution model Tutorial on TinyOS Code walk through Code quiz Assignment 2. msg_rec(type, data). msg_send_done). Tiny OS Concepts. Events. Commands. Scheduler + Graph of Components
E N D
Agenda Review of TinyOS execution model Tutorial on TinyOS Code walk through Code quiz Assignment 2
msg_rec(type, data) msg_send_done) Tiny OS Concepts Events Commands • Scheduler + Graph of Components • constrained two-level scheduling model: threads + events • Component: • Commands, • Event Handlers • Frame (storage) • Tasks (concurrency) • Constrained Storage Model • frame per component, shared stack, no heap • Very lean multithreading • Efficient Layering send_msg(addr, type, data) power(mode) init Messaging Component internal thread Internal State TX_packet(buf) Power(mode) init RX_packet_done (buffer) TX_packet_done (success)
Radio Packet packet Radio byte byte RFM bit TOS Execution Model data processing application comp • commands request action • ack/nack at every boundary • call cmd or post task • events notify occurrence • HW intrpt at lowest level • may signal events • call cmds • post tasks • Tasks provide logical concurrency • preempted by events • Migration of HW/SW boundary message-event driven active message event-driven packet-pump crc event-driven byte-pump encode/decode event-driven bit-pump
Cross-platform applications Platform-specific applications Platform-specific applications Platform-independent hardware interface Hardware independence HIL 1 HIL 2 HIL 3 HIL 4 HAL 1 HAL 2 HAL 3 HAL 4 HPL 2 HPL 1 HPL 3 HPL 4 HW/SW boundary HW platform 1 HW platform 2 HW platform 3 HW platform 4 Hardware Abstraction Architecture for TinyOS 2.x Combine the component model with aflexible, three-tier organization of the hardware abstraction