Presentation is loading. Please wait.

Presentation is loading. Please wait.

Operating System Requirements for Embedded Systems Rabi Mahapatra.

Similar presentations


Presentation on theme: "Operating System Requirements for Embedded Systems Rabi Mahapatra."— Presentation transcript:

1 Operating System Requirements for Embedded Systems Rabi Mahapatra

2 Complexity trends in OS OS functionality drives the complexity Router Small controllers sensors Home appliances Mobile phones PDAs Game Machines

3 Requirements of EOS Memory Resident: size is important consideration –Data structure optimized –Kernel optimized and usually in assembly language Support of signaling & interrupts Real-time scheduling – tight-coupled scheduler and interrupts Power Management capabilities –Power aware schedule –Control of non-processor resources

4 Embedded OS Design approach Networking support Traditional OS: Monolithic or Distribute Embedded: Layered is the key (Constantine D. P, UIUC 2000) Memory Management Real-Time Scheduler Interrupt & signalling Basic Loader Power Management Custom device support

5 Power Management by OS Static Approach: Rely on pre-set parameters –Example: switch off the power to devices that are not in use for a while (pre-calculated number of cycles). Used in laptops now. Dynamic Approach: Based on dynamic condition of workloads and per specification of power optimization guidelines –Example: Restrict multitasking progressively, reduce context switching, even avoid cache/memory access, etc..

6 Popular E-OS WinCE (proprietary, optimized assembly..) VxWorks Micro Linux MuCOS Java Virtual Machine (Picojava) OS –Most likely first open EOS!

7 Interrupts Each device has 1-bit “arm’ register to be set by software if interrupt from the device to be accepted. CCR is used to program the interrupts A good design should provide for extensibility in the number of devices that can issue interrupts and also number of ISRs. Either poled or vectored interrupts depending on nature of processors and I/O devices. –Polling: Dedicated controllers, data acquisition with periodicity and the I/O devices are slow –Interrupts: Real-time environments, when events are unpredictable and asynchronous

8 Direct Memory Access DMA is used when low latency and/or high bandwidth is required. (disk IO, video output or low latency data acquisition) Software DMA: starts with normal interrupts, the ISR sets the device resisters and initiate I/O, processor returns to normal operation, on completion of I/O device inform the processor. Hardware DMA: the above can be implemented in hardware Burst DMA: when buffers are put in I/O devices (disk) –Low latency asynchronous I/O can not use burst DMA.

9 Real-Time Scheduling Interrupts are heavily used in scheduling when real-time events are to be completed by some deadline. Events or threads or tasks or processes need to use priority, deadline, blocking, restoring and nesting NP-hard problem with out an optimal solution. Greedy heuristics are proposed as working solutions with some assumptions. Dynamic RT Scheduling: Use greedy heuristics together with priority-based interrupts.

10 OS directed power reduction Dynamic power management: determine the power state of a device based on the current workload, move through the power transitions based on shot down policy Usually, in stead of power off/on, there are dynamic voltage setting and variable clock speeds => multiple power states Previous works: –Shot down device if idle long enough –Hardware centric => observe past requests at device to predict future idleness, no OS info, no study on characteristics of requsters –Use stochastic model and assume randomly one request without distinguishing the source of the requester

11 OS directed power reduction Disk request sources: compiler, text editor, ftp program Network card: internet browser or telnet session? Important that we have accurate model of requesters in concurrent environment.( Task Based Power Management) A software-centric approach Two methods to reduce power: adjust CPU clock speed, sleeping states

12 Process states ready waiting running new terminated IO or event wait IO or event completion Scheduler dispatch interrupt exit admitted

13 TBPM’s supplement on device drivers Four problems: –Requesters are generated by multiple tasks. TBPM uses the knowledge from OS kernel to separate tasks –Tasks are created, executed and terminated. (DD has know knowledge on multiple tasks and their termination) –Tasks have different characteristics in device utilization. –Task can generate requests while running. TBPM considers CPU time of tasks while deciding the power states Data structures: –device-requester utilization matrix U (d, r) : utilization of device d by requester r; –processor utilization vector P ( r ) : percentage of processor time used by requester.

14 Updating U, P U matrix example: HDD NIC Gcc emacs netscape 12 0.7 0.4 00 2.3 Matrix element refers to the reciprocal of the average Time between requests (TBR) TBRn = . TBR + (1-  ). TBRn-1 U(d,r) – 1/ TBRn 0 <  <1 If  = 0, TBRn is constant using the first TBR and for  = 1, TBRn is last TBR.

15 Updating U, P P(r ) is the percentage of CPU time executing task r or = CPU time (r )/  CPU time by all requester Updated based on sliding window scheme but not a discounted scheme as used for U. –Incase of IO bound bursty requests, TBR will show on high utilization but can not capture the running time requirements –Sliding window is used to compute CPU time distributed among processes. But the window time should be such that it samples all processes (long) and also reflect the workload variation (short).

16 Shutdown condition Break-even-time: minimum length of idle time –Depends on device characteristics –Independent of workloads


Download ppt "Operating System Requirements for Embedded Systems Rabi Mahapatra."

Similar presentations


Ads by Google