Our TAs ¡ Top ¡11 ¡Technologies ¡of ¡the ¡Decade ¡ Mo Sha ¡ Yong Fu 1. Smartphones ¡ 7. Drone ¡AircraJ ¡ • gowustl@gmail.com � • fuy@cse.wustl.edu � 2. Social ¡Networking ¡ 8. Planetary ¡Rovers ¡ • TinyOS tutorial. � • Grade critiques. � 3. Voice ¡over ¡IP ¡ 9. Flexible ¡AC ¡ • • Help students with projects. � Office Hour: by appointment. � Bryan 502D • • Transmission ¡ Manage motes. � 4. LED ¡Ligh@ng ¡ • Grade projects. � 10. Digital ¡Photography ¡ 5. Mul@core ¡CPUs ¡ • Office Hour: Tue/Thu 5:30-6. � Bryan 502A • 11. Class-‑D ¡Audio ¡ 6. Cloud ¡Compu@ng ¡ Chenyang Lu Chenyang ¡Lu ¡ 2 ¡ 1 Hardware ¡Evolu=on ¡ TinyOS ¡and ¡nesC ¡ TinyOS: ¡OS ¡for ¡wireless ¡sensor ¡networks. ¡ Miniature ¡devices ¡manufactured ¡economically ¡ nesC: ¡programming ¡language ¡for ¡TinyOS. ¡ Microprocessors ¡ Sensors/actuators ¡ Wireless ¡chips ¡ 4.5 ’’ X2.4 ’’ 1 ’’ X1 ’’ 1 mm 2 1 nm 2 Chenyang ¡Lu ¡ 4 ¡ Chenyang ¡Lu ¡ 3 ¡ Hardware ¡Constraints ¡ Mica2 ¡Mote ¡ Processor ¡ Microcontroller: ¡7.4 ¡MHz, ¡8 ¡bit ¡ Severe ¡constraints ¡on ¡power, ¡size, ¡and ¡cost ¡ ¡ Memory: ¡4KB ¡data, ¡128 ¡KB ¡program ¡ slow ¡microprocessor ¡ Radio ¡ low-‑bandwidth ¡radio ¡ Max ¡38.4 ¡Kbps ¡ limited ¡memory ¡ Sensors ¡ limited ¡hardware ¡parallelism ¡ ¡CPU ¡hit ¡by ¡many ¡interrupts! ¡ manage ¡sleep ¡modes ¡in ¡hardware ¡components ¡ Light, ¡temperature, ¡accelera@on, ¡acous@c, ¡magne@c… ¡ Power ¡ <1 ¡week ¡on ¡two ¡AA ¡baaeries ¡in ¡ac@ve ¡mode ¡ >1 ¡year ¡baaery ¡life ¡on ¡sleep ¡modes! ¡ Chenyang ¡Lu ¡ 5 ¡ Chenyang ¡Lu ¡ 6 ¡
Tradi=onal ¡OS ¡ So@ware ¡Challenges ¡ Small ¡memory ¡footprint ¡ Mul@-‑threaded ¡ Efficiency ¡-‑ ¡power ¡and ¡processing ¡ Preemp@ve ¡scheduling ¡ Concurrency-‑intensive ¡opera@ons ¡ Threads: ¡ Diversity ¡in ¡applica@ons ¡& ¡plaform ¡ ¡efficient ¡modularity ¡ ready ¡to ¡run; ¡ Support ¡reconfigurable ¡hardware ¡and ¡soJware ¡ executing execu@ng ¡on ¡the ¡CPU; ¡ gets wai@ng ¡for ¡data. ¡ CPU preempted needs data gets data ready waiting needs data Chenyang ¡Lu ¡ 7 ¡ Chenyang ¡Lu ¡ 8 ¡ Pros ¡and ¡Cons ¡of ¡Tradi=onal ¡OS ¡ Example: ¡Preemp=ve ¡Priority ¡Scheduling ¡ Each ¡process ¡has ¡a ¡fixed ¡priority ¡(1 ¡highest); ¡ Mul@-‑threaded ¡+ ¡preemp@ve ¡scheduling ¡ P 1 : ¡priority ¡1; ¡P 2 : ¡priority ¡2; ¡P 3 : ¡priority ¡3. ¡ Preempted ¡threads ¡waste ¡memory ¡ P 3 released Context ¡switch ¡overhead ¡ P 1 released P 2 released I/O ¡ Blocking ¡I/O: ¡waste ¡memory ¡on ¡blocked ¡threads ¡ Polling ¡(busy-‑wait): ¡waste ¡CPU ¡cycles ¡and ¡power ¡ P2 P1 P2 P3 0 10 20 30 40 50 60 time 10 ¡ Chenyang ¡Lu ¡ 9 ¡ Chenyang ¡Lu ¡ CSE ¡467S ¡ Context ¡Switch ¡ Exis=ng ¡Embedded ¡OS ¡ Name Code Size Target CPU pOSEK 2K Microcontrollers pSOSystem PII->ARM Thumb VxWorks 286K Pentium -> Strong ARM process 1 PC QNX Nutrino >100K Pentium II -> NEC QNX RealTime 100K Pentium II -> SH4 registers OS-9 Pentium -> SH4 process 2 Chorus OS 10K Pentium -> Strong ARM ARIEL 19K SH2, ARM Thumb CPU ... Creem 560 bytes ATMEL 8051 QNX ¡context ¡switch ¡= ¡2400 ¡cycles ¡on ¡x86 ¡ memory pOSEK ¡context ¡switch ¡> ¡40 ¡µs ¡ Creem ¡-‑> ¡no ¡preemp@on ¡ System architecture directions for network sensors, J. Hill, R. Szewczyk, A. Woo, S. Hollar, D. Culler, K. Pister. ASPLOS 2000. 11 ¡ Chenyang ¡Lu ¡ CSE ¡467S ¡ Chenyang ¡Lu ¡ 12 ¡
TinyOS ¡Solu=ons ¡ Example: ¡Surge ¡ Efficient ¡modularity ¡ Applica@on ¡= ¡scheduler ¡+ ¡graph ¡of ¡components ¡ SurgeC Compiled ¡into ¡one ¡executable ¡ StdControl Only ¡needed ¡components ¡are ¡complied/loaded ¡ ¡ SurgeP BootC StdControl ADC Timer SendMsg Leds Concurrency: ¡event-‑driven ¡architecture ¡ Main (includes Scheduler) Application (User Components) StdControl ADC StdControl Timer StdControl SendMsg Leds PhotoC TimerC MultihopC LedsC Actuating Sensing Communication Communication Hardware Abstractions Modified from D. Culler et. Al., TinyOS boot camp presentation, Feb 2001 Chenyang ¡Lu ¡ 13 ¡ Chenyang ¡Lu ¡ 14 ¡ Two-‑level ¡Scheduling ¡ Typical ¡Applica=on ¡ D. Culler et. Al., TinyOS boot camp presentation, Feb 2001 Events ¡handle ¡interrupts ¡ application sensing application Interrupts ¡trigger ¡lowest ¡level ¡events ¡ Events ¡can ¡signal ¡events, ¡call ¡commands, ¡or ¡post ¡tasks ¡ Routing Layer routing Tasks ¡perform ¡deferred ¡computa@ons ¡ Interrupts ¡preempt ¡tasks ¡and ¡interrupts ¡ messaging Messaging Layer Tasks Preempt POST FIFO packet Radio Packet events commands Radio Byte (MAC) byte Temp commands photo SW Interrupts HW Time RFM ADC i2c bit clocks Hardware Chenyang ¡Lu ¡ 15 ¡ Chenyang ¡Lu ¡ 16 ¡ Mul=ple ¡Data ¡Flows ¡ Sending ¡a ¡Message ¡ Respond ¡quickly: ¡sequence ¡of ¡event/command ¡through ¡ the ¡component ¡graph. ¡ ¡ Immediate ¡execu@on ¡of ¡func@on ¡calls ¡ e.g., ¡get ¡bit ¡out ¡of ¡radio ¡hw ¡before ¡it ¡gets ¡lost. ¡ Post ¡tasks ¡for ¡deferred ¡computa@ons. ¡ e.g., ¡encoding. ¡ Events ¡preempt ¡tasks ¡to ¡handle ¡new ¡interrupts. ¡ Timing diagram of event propagation (step 0-6 takes about 95 microseconds total) Chenyang ¡Lu ¡ 17 ¡ Chenyang ¡Lu ¡ 18 ¡
Recommend
More recommend