Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fabián E. Bustamante, Winter 2007 t-kernel – Reliable OS support for WSN L. Gu and J. Stankovic, appearing in 4 th Proc. of Sensys, Oct. 2006. Best paper.

Similar presentations


Presentation on theme: "Fabián E. Bustamante, Winter 2007 t-kernel – Reliable OS support for WSN L. Gu and J. Stankovic, appearing in 4 th Proc. of Sensys, Oct. 2006. Best paper."— Presentation transcript:

1 Fabián E. Bustamante, Winter 2007 t-kernel – Reliable OS support for WSN L. Gu and J. Stankovic, appearing in 4 th Proc. of Sensys, Oct. 2006. Best paper award. Presenter: F. E. Bustamante

2 EECS 443 Advanced Operating Systems Northwestern University 2 Motivation Wireless sensor networks (WSNs) with –Resource constrained embedded microcontrollers –Complex application requirements OS support is very limited; applications (developers) could benefits from –OS protection –Virtual memory –Preemptive scheduling But microcontrollers do not have hardware support for this How can we efficiently provide such support w/o hardware help?

3 EECS 443 Advanced Operating Systems Northwestern University 3 Context – Resource constrained devices Very-low-power configurations for –Energy efficiency –Small form factor –Low cost Minimum assumptions made here (REM) –Reprogrammable –External nonvolatile storage –A certain amount of RAM available (4KB)

4 EECS 443 Advanced Operating Systems Northwestern University 4 Context – Complex apps requirements Three real-world scenarios –VM - VigilNet – large-scale surveillance network 30 middleware services & 40K SLC Using overlay in absence of VM is not really an answer –Application specific, inefficient, labor intensive, error-prone –Scheduling - Acoustic sampling app Timing of microphone sampling inaccurate due to FIFO task scheduling and long-running computation task Avoiding tasks and use only interrupts doesn’t solve it – now the clock handler’s switch statement is your problem! –OS Control - Extreme scaling To ensure the OS gets the CPU back Grenade timer or periodic reboot –Coarse control granularity –Applications must adapt to this –Long time w/o OS control

5 EECS 443 Advanced Operating Systems Northwestern University 5 Approach - Naturalization Application Naturalized program OS (t-kernel) Load-time code modification Naturalized program becomes a cooperative program supporting OS protection, VM & preemptive sched. Naturalizer –In: binary instructions; Out: naturalized instructions (natin) –Page by page Paging –Storage management Dispatcher –Controls execution

6 EECS 443 Advanced Operating Systems Northwestern University 6 Naturalization and control Modify all branching instructions –Save registers, save destination and go to homeGate (welcomeHome) –welcomeHome – retrieve destination, seeks for a natin page (or create one) and transfer control to it –Transferring control flow to entry point – go to natin page and go through cascading branch chain –Bridging for optimization – basically avoid going to kernel when it’s safe to do so

7 EECS 443 Advanced Operating Systems Northwestern University 7 Minimum: 0 Bytes in RAM To enhance speed, index cache –Hash has 16 possible results Hash IndexVPC Offset 6 bits Tag 8 bits3 bits Hash VPC VPC mapping

8 EECS 443 Advanced Operating Systems Northwestern University 8 Three-level look up for a VPC Each VPM is hashed to a number of natin pages; need to check all entry points to decide 1. VPC look-aside buffer (fast) 2. Two-associative VPC table 3. Brute-force search on the natin pages (slow)

9 EECS 443 Advanced Operating Systems Northwestern University 9 Three memory areas Physical address sensitive memory (PASM) – Virtual/physical addresses are the same – The fastest access Stack memory – Virtual/physical addresses directly mapped – Fast access with boundary checks Heap memory – May involve a transition to kernel – The slowest, sometimes involves swapping Example configuration

10 EECS 443 Advanced Operating Systems Northwestern University 10 Swapping area organization Challenge –After 10k writes, a flash page cannot longer be used –If swap-outs evenly distributed to all pages, maximum lifetime Super page: associative cache, fast swaps Overflow partition extends longevity – use it when a super page is gone (O(N) seek time, however) System parameter – Af – associativity of super page (the larger, the faster and short lifetime) 32 Bytes in RAM, 266 days (1,000 swaps/hour), 20% fast swaps

11 EECS 443 Advanced Operating Systems Northwestern University 11 Implementation Hardware paramenters Data RAM External flash Program mem 4KB 512KB 128KB OS ParametersVirtual mem. Data frame Look-aside buffer 2-associative VPC System stack I/O Buffer 64KB 64 frames 64 entries 256 entries 1KB 516 bytes Implementation details Code size (source) Code (binary) 10 KLSC 29KB MICA2

12 EECS 443 Advanced Operating Systems Northwestern University 12 Overhead of naturalization Kernel transaction time: ~20 cycles (2.6microsec on MICA2 @ ~8MHz) Kernel transaction –Saves/restore registers –Checks the stack pointers –Increments system counters –May need to Look for destination address Trigger naturalization of a new page Re-link naturalized page Relative execution time with iter

13 EECS 443 Advanced Operating Systems Northwestern University 13 Overhead from the app’s perspective PeriodicTask –Wake-up/poll-sensors/communicate –Varying the amount of computation in each task –Keep in mind the CPU idle ration of TinyOS apps

14 EECS 443 Advanced Operating Systems Northwestern University 14 Overhead of naturalized VM Slowest stack access: 16 cycles Heap access w/o swapping: 15 cycles Heap access w/ swapping: 149,815 cycles Swap out time: 20.3ms (near hardware’s limit) Balance between swapping speed and longevity An example: Associativity = 2 266 days, 20% fast swaps (assuming 1000swaps/hr) Number of pages faults and swap-outs for slidingwin

15 EECS 443 Advanced Operating Systems Northwestern University 15 Comparison to VM approach Comparing with Maté, a VM for TinyOS –A stack based virtual architecture –Comparison with an insertion-sorting program –Initial cost of t-kernel comes from naturalization After 100 grows slowly since naturalization has a one-time overhead –In contrast, bytecode translation has to be done every time And sophisticated optimizations for VMs cannot save you here Of course, you could build Maté/TinyOS on top of t- kernel

16 EECS 443 Advanced Operating Systems Northwestern University 16 Conclusions & Future Work Optimizing compilers Real-time specification in t-kernel Characterizing WSN applications WSN benchmarks What if power where not an issue? Prof. Alan Epstein - Using computer- chip fabrication techniques to make a gas-turbine engine that fits in the palm of his hand (MIT).


Download ppt "Fabián E. Bustamante, Winter 2007 t-kernel – Reliable OS support for WSN L. Gu and J. Stankovic, appearing in 4 th Proc. of Sensys, Oct. 2006. Best paper."

Similar presentations


Ads by Google