Your SlideShare is downloading. ×
0
OPERATING SYSTEM<br />( OS 023L1 )<br />EMBEDDED<br />OPERATING SYSTEMS<br />Presented By:<br />GAGNO, Nelson Jr.<br />MAD...
What is anEmbedded Systems?<br />
EMBEDDED SYSTEMS<br />An embedded system is a combination of computer hardware and software, and perhaps additional mechan...
REQUIREMENTS&CONSTRAINTS<br /><ul><li>Small to large systems, implying very different cost constraints, thus different nee...
Relaxed to very strict requirements and combinations of different quality requirements
Short to long life times</li></li></ul><li>REQUIREMENTS&CONSTRAINTS<br /><ul><li>Different environmental conditions
Different application characteristics
Different models of computation ranging from discrete-event systems to those involving continuous time dynamics</li></li><...
Possible Organizationof an Embedded System<br />
UNIQUE CHARACTERISTICS & DESIGN REQUIREMENTS<br /><ul><li>REAL-TIME OPERATION</li></ul>	In many embedded systems, the corr...
UNIQUE CHARACTERISTICS & DESIGN REQUIREMENTS<br /><ul><li>CONFIGURABILITY</li></ul>	An embedded system must lend itself to...
UNIQUE CHARACTERISTICS & DESIGN REQUIREMENTS<br /><ul><li>STREAMLINED PROTECTION MECHANISMS</li></ul>	Embedded systems are...
Protection is not necessary
Efficient control over a variety of devices is required</li></li></ul><li>TWO GENERAL APPROACHES<br /><ul><li>Adapting an ...
Adapting an Existing Commercial Operating System<br />An existing commercial OS can be used for an embedded system by addi...
Adapting an Existing Commercial Operating System<br />An advantage of this approach is that the embedded OS derived from a...
Purpose-Built Embedded   Operating System<br />A significant number of operating systems have been designed from the groun...
CHARACTERISTICS OF ASPECIALZED EMBEDDED OS<br /><ul><li>Has a fast and lightweight process or thread switch
Scheduled policy is real time and dispatcher module is part of scheduler instead of separate component
Has a small size</li></li></ul><li>CHARACTERISTICS OF ASPECIALZED EMBEDDED OS<br /><ul><li>Responds to external interrupts...
Minimizes intervals during which interrupts are disabled
Provides fixed or variable sixed partitions for memory management as well as the ability to lock code and data in memory</...
Provides bounded execution time for most primitives
Maintains a real-time clock</li></li></ul><li>CHARACTERISTICS OF ASPECIALZED EMBEDDED OS<br /><ul><li>Provides for special...
Supports real-time queuing disciplines such as earliest deadline first and primitives for jamming a message into the front...
Provides primitives to delay processing by a fixed amount of time and to suspend/resume execution</li></li></ul><li>Embedd...
WHAT IS AN eCos?<br />	eCos stands for Embedded Configurable Operating System<br />	It is an open source, royalty-free, re...
CONFIGURABILITY<br />An embedded system OS that is flexible enough to be used in a wide variety of embedded application an...
CONFIGURABILITY<br />	The eCos configuration tool (which runs on Windows or Linux) is used to configure an eCos package to...
CONFIGURABILITY<br />
LOADING ANeCos CONFIGURATION<br />
eCos COMPONENTS<br />	A key design requirement for eCos is portability to different architectures and platforms with minim...
eCos LAYERED STRUCTURE<br />
HARDWAREABSTRACTION LAYER ( HAL )<br />The HAL is software that presents a consistent API to the upper layers and maps upp...
HARDWAREABSTRACTION LAYER ( HAL )<br />Three modules:<br /><ul><li>Architecture: Defines the processor family type. This m...
Variant: Supports the features of the specific processor in the family.
Platform: Extends the HAL support to tightly coupled peripherals. This module defines the platform or board that includes ...
Low task switching latency: The time it takes from when a thread becomes available to when actual execution begins.
Small memory footprint: Memory resources for both program and data are kept to a minimum by allowing all components to con...
Deterministic behavior: Throughout all aspect of execution, the kernels performance must be predictable and bounded to mee...
Control over the various threads in the system
A choice of schedulers, determining which thread should currently be running
A range of synchronization primitives, allowing threads to interact and share data safely
Integration with the system’s support for interrupts and exceptions</li></li></ul><li>eCos I/O SYSTEM<br />Framework for s...
eCos Principal Objective<br />Efficiency <br />No unnecessary software layering or irrelevant functionality.<br />Device d...
eCos SCHEDULER<br />Bitmaps Scheduler<br />Efficient for small number of threads active.<br />Each thread has different pr...
Terms to be remember…<br />THREAD<br />Client of the driver or simply a “process”.<br />PRIORITY LEVEL<br />Use by the sch...
Terms to be remember…<br />PREEMPTION<br />Is a context switch halting execution of lower priority thread allowing higher ...
BITMAP SCHEDULER<br />Allow the execution of threads at multiple priority levels; however, only single thread can exist at...
BITMAP SCHEDULER<br />
MULTILEVEL QUEUE SCHEDULER<br />Allow execution of multiple threads at each of it priority levels.<br />  Scheduler allows...
MULTILEVEL QUEUE SCHEDULER<br />
eCosTHREAD SYNCHORNIZATION<br />Thread synchronization requires that a running thread gain a "lock" on an object before it...
eCosTHREAD SYNCHORNIZATION<br />Classics Mechanism<br />Mutexes<br />Semaphores<br />Condition variables<br />Synchronizat...
Mutual Exclusion Lock( MUTEXES )<br />	A mutex is used to enforce mutually exclusive access to a resource, allowing only o...
Lock and Unlocked<br />When a mutex is locked by one thread, any other thread attempting to lock the mutex is blocked.<br ...
SEMAPHORES<br />A counting semaphore is an integer value used for signaling among threads. Counting semaphores are suited ...
SEMAPHORES<br />	If this counter is zero, an attempt by a consumer thread to wait on the semaphore will block until some o...
CONDITIONAL VARIABLES<br />	A condition variable is used to block a thread until a particular condition is true. Condition...
EVENT FLAGS<br />	An event flag is a 32-bit word used as a synchronization mechanism. Application code may associate a dif...
MAILBOXES<br />	It is also called message boxes, are an eCos synchronization mechanism that provides a means for two threa...
SPINLOCKS<br />	A spinlock is a flag that a thread can check before executing a particular piece of code. Basically, only ...
Tinyos<br />
WHAT IS A TINYOS?<br />TinyOS is a free and open source component-based operating system and platform targeting wireless s...
WIRELESS SENSOR NETWORKS<br />	TINYOS was developed primarily for use with networks of small wireless sensor. A number of ...
NETWORK TOPOLOGY<br />
TINYOS GOALS<br /><ul><li>Allow high concurrency: In a typical wireless sensor network application, the devices are concur...
Upcoming SlideShare
Loading in...5
×

Embedded os

3,115

Published on

Published in: Education, Technology, Business
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,115
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
126
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of "Embedded os"

  1. 1. OPERATING SYSTEM<br />( OS 023L1 )<br />EMBEDDED<br />OPERATING SYSTEMS<br />Presented By:<br />GAGNO, Nelson Jr.<br />MADAYAG, Maria Lourdes<br />MAYBANTING, Jefferson<br />RAMOS, Adrian Alvin<br />SAN DIEGO, Eleonor<br />Presented To:<br />ENGR. ARIEL E. ISIDRO<br />
  2. 2. What is anEmbedded Systems?<br />
  3. 3. EMBEDDED SYSTEMS<br />An embedded system is a combination of computer hardware and software, and perhaps additional mechanical or other parts, designed to perform a dedicated function.<br />
  4. 4. REQUIREMENTS&CONSTRAINTS<br /><ul><li>Small to large systems, implying very different cost constraints, thus different needs for optimization and reuse
  5. 5. Relaxed to very strict requirements and combinations of different quality requirements
  6. 6. Short to long life times</li></li></ul><li>REQUIREMENTS&CONSTRAINTS<br /><ul><li>Different environmental conditions
  7. 7. Different application characteristics
  8. 8. Different models of computation ranging from discrete-event systems to those involving continuous time dynamics</li></li></ul><li>Examples of Embedded Systems and Their Markets<br />
  9. 9. Possible Organizationof an Embedded System<br />
  10. 10. UNIQUE CHARACTERISTICS & DESIGN REQUIREMENTS<br /><ul><li>REAL-TIME OPERATION</li></ul> In many embedded systems, the correctness of a computation depends, in part, on the time at which it is delivered. Often, real-time constraints are dictated by external I/O and control stability requirements.<br /><ul><li>REACTIVE OPERATION</li></ul>Embedded software may execute in response to external events.<br />
  11. 11. UNIQUE CHARACTERISTICS & DESIGN REQUIREMENTS<br /><ul><li>CONFIGURABILITY</li></ul> An embedded system must lend itself to flexible configuration so that only the functionality needed for a specific application and hardware suite is provided.<br /><ul><li>I/O DEVICE FLEXIBILITY</li></ul>There is virtually no device that needs to be supported by all versions of the OS, and the range of I/O device is large.<br />
  12. 12. UNIQUE CHARACTERISTICS & DESIGN REQUIREMENTS<br /><ul><li>STREAMLINED PROTECTION MECHANISMS</li></ul> Embedded systems are typically designed for a limited, well-defined functionality. Untested programs are rarely added to the software. After the software has been configured and tested, it can be assumed to be reliable. Thus, apart from security measures, embedded systems have limited protection mechanisms.<br /><ul><li>DIRECT USE OF INTERRUPTS</li></ul> Three reasons why it is possible to let interrupts directly start or stop tasks.<br /><ul><li>Embedded systems can be considered to be thoroughly tested.
  13. 13. Protection is not necessary
  14. 14. Efficient control over a variety of devices is required</li></li></ul><li>TWO GENERAL APPROACHES<br /><ul><li>Adapting an Existing Commercial</li></ul> Operating System<br /><ul><li>Purpose-Built Embedded</li></ul> Operating System<br />
  15. 15. Adapting an Existing Commercial Operating System<br />An existing commercial OS can be used for an embedded system by adding real-time capability, streamlining operation, and adding necessary functionality.<br />
  16. 16. Adapting an Existing Commercial Operating System<br />An advantage of this approach is that the embedded OS derived from a commercial general-purpose OS is based on a set of familiar interfaces, which facilitates portability.<br /> The disadvantage of using a general-purpose OS is that it is not optimized for real-time and embedded applications.<br />
  17. 17. Purpose-Built Embedded Operating System<br />A significant number of operating systems have been designed from the ground up for embedded applications.<br /> Two prominent examples of this latter approach are eCos and TinyOS.<br />
  18. 18. CHARACTERISTICS OF ASPECIALZED EMBEDDED OS<br /><ul><li>Has a fast and lightweight process or thread switch
  19. 19. Scheduled policy is real time and dispatcher module is part of scheduler instead of separate component
  20. 20. Has a small size</li></li></ul><li>CHARACTERISTICS OF ASPECIALZED EMBEDDED OS<br /><ul><li>Responds to external interrupts quickly: typical requirement is response time of less than 10µs
  21. 21. Minimizes intervals during which interrupts are disabled
  22. 22. Provides fixed or variable sixed partitions for memory management as well as the ability to lock code and data in memory</li></li></ul><li>CHARACTERISTICS OF ASPECIALZED EMBEDDED OS<br /><ul><li>Provides sequential files that can accumulate data at a fast rate to deal with timing constraints, the kernel
  23. 23. Provides bounded execution time for most primitives
  24. 24. Maintains a real-time clock</li></li></ul><li>CHARACTERISTICS OF ASPECIALZED EMBEDDED OS<br /><ul><li>Provides for special alarms and timeouts
  25. 25. Supports real-time queuing disciplines such as earliest deadline first and primitives for jamming a message into the front of a queue
  26. 26. Provides primitives to delay processing by a fixed amount of time and to suspend/resume execution</li></li></ul><li>Embedded Configurable Operating Systems (eCos)<br />
  27. 27. WHAT IS AN eCos?<br /> eCos stands for Embedded Configurable Operating System<br /> It is an open source, royalty-free, real-time OS intended for embedded applications.<br /> It is one of the most widely used embedded operating systems.<br />
  28. 28. CONFIGURABILITY<br />An embedded system OS that is flexible enough to be used in a wide variety of embedded application and on a wide variety of embedded platforms must provide more functionality than will be needed for any particular application and platform.<br />
  29. 29. CONFIGURABILITY<br /> The eCos configuration tool (which runs on Windows or Linux) is used to configure an eCos package to run on a target embedded system.<br />
  30. 30. CONFIGURABILITY<br />
  31. 31. LOADING ANeCos CONFIGURATION<br />
  32. 32. eCos COMPONENTS<br /> A key design requirement for eCos is portability to different architectures and platforms with minimal effort.<br />
  33. 33. eCos LAYERED STRUCTURE<br />
  34. 34. HARDWAREABSTRACTION LAYER ( HAL )<br />The HAL is software that presents a consistent API to the upper layers and maps upper-layer operations onto a specific hardware platform. Thus, the HAL is different for each hardware platform.<br />
  35. 35. HARDWAREABSTRACTION LAYER ( HAL )<br />Three modules:<br /><ul><li>Architecture: Defines the processor family type. This module contains the code necessary for processor startup, interrupt delivery, context switching, and other functionality specific to the instruction set architecture of that processor family.
  36. 36. Variant: Supports the features of the specific processor in the family.
  37. 37. Platform: Extends the HAL support to tightly coupled peripherals. This module defines the platform or board that includes the selected processor architecture and variant. It includes code for startup, chip selection configuration, interrupt controllers, and timer devices.</li></li></ul><li>eCos KERNEL<br /> Four main objectives:<br /><ul><li>Low interrupt latency: The time it takes to respond to an interrupt and begin executing an ISR.
  38. 38. Low task switching latency: The time it takes from when a thread becomes available to when actual execution begins.
  39. 39. Small memory footprint: Memory resources for both program and data are kept to a minimum by allowing all components to configure memory as needed.
  40. 40. Deterministic behavior: Throughout all aspect of execution, the kernels performance must be predictable and bounded to meet real-time application requirements.</li></li></ul><li>eCos KERNEL<br />The eCos kernel provides the core functionality needed for developing multithreaded applications:<br /><ul><li>The ability to create new threads in the system
  41. 41. Control over the various threads in the system
  42. 42. A choice of schedulers, determining which thread should currently be running
  43. 43. A range of synchronization primitives, allowing threads to interact and share data safely
  44. 44. Integration with the system’s support for interrupts and exceptions</li></li></ul><li>eCos I/O SYSTEM<br />Framework for supporting device drivers.<br /> A variety of drivers are available for different platforms are supported through eCos configuration package.<br />Drivers: serial devices, ethenet, flash memory & various I/O interconnect (such as PCI and USB)<br />
  45. 45. eCos Principal Objective<br />Efficiency <br />No unnecessary software layering or irrelevant functionality.<br />Device driver provide separate function for:<br />Input<br />Output<br />Buffering<br />Device control<br />
  46. 46. eCos SCHEDULER<br />Bitmaps Scheduler<br />Efficient for small number of threads active.<br />Each thread has different priority.<br />Multilevel queue Scheduler<br />Appropriate when number of threads is running.<br />Multiple threads at each priority.<br />Time slicing.<br />
  47. 47. Terms to be remember…<br />THREAD<br />Client of the driver or simply a “process”.<br />PRIORITY LEVEL<br />Use by the scheduler to determine which thread ready to run.<br />TIME SLICING<br />Allow each thread at a given time to execute a given amount of time.<br />
  48. 48. Terms to be remember…<br />PREEMPTION<br />Is a context switch halting execution of lower priority thread allowing higher priority thread to execute.<br />SCHEDULER<br />Selects appropriate thread for execution provide mechanisms for these executing threads to synchronize, and control the effect of interrupts on thread execution. <br />
  49. 49. BITMAP SCHEDULER<br />Allow the execution of threads at multiple priority levels; however, only single thread can exist at each priority level.<br />
  50. 50. BITMAP SCHEDULER<br />
  51. 51. MULTILEVEL QUEUE SCHEDULER<br />Allow execution of multiple threads at each of it priority levels.<br /> Scheduler allows pre-emption and time slicing.<br />
  52. 52. MULTILEVEL QUEUE SCHEDULER<br />
  53. 53. eCosTHREAD SYNCHORNIZATION<br />Thread synchronization requires that a running thread gain a "lock" on an object before it can access it.<br /> The thread will wait in line for another thread that is using the method/data member to be done with it. This is very important to prevent the corruption of program data if multiple threads will be accessing the same data.<br /> If two threads try to change a variable or execute the same method at the same, this can cause serious and difficult to find problems. Thread synchronization helps prevent this.<br />
  54. 54. eCosTHREAD SYNCHORNIZATION<br />Classics Mechanism<br />Mutexes<br />Semaphores<br />Condition variables<br />Synchronization/ Communication Mechanism<br />Event flags<br />Mailboxes<br />SMP support (symmetric/ multiprocessing)<br />Spinlocks<br />
  55. 55. Mutual Exclusion Lock( MUTEXES )<br /> A mutex is used to enforce mutually exclusive access to a resource, allowing only one thread at a time to gain access. The mutex has only two states: locked and unlocked.<br />
  56. 56. Lock and Unlocked<br />When a mutex is locked by one thread, any other thread attempting to lock the mutex is blocked.<br />When the mutex is unlocked, then one of the threads blocked on this mutex is unblocked and allowed to lock the mutex and gain access to the resource.<br />
  57. 57. SEMAPHORES<br />A counting semaphore is an integer value used for signaling among threads. Counting semaphores are suited to enabling threads to wait until an event has occurred. <br />Useful for resource management.<br />
  58. 58. SEMAPHORES<br /> If this counter is zero, an attempt by a consumer thread to wait on the semaphore will block until some other thread or a DSR posts a new event to the semaphore.<br /> If the counter is greater than zero then an attempt to wait on the semaphore will consume one event; in other words, decrement the counter, and return immediately.<br />
  59. 59. CONDITIONAL VARIABLES<br /> A condition variable is used to block a thread until a particular condition is true. Condition variables are used with mutexes to allow multiple thread to access shared data.<br />
  60. 60. EVENT FLAGS<br /> An event flag is a 32-bit word used as a synchronization mechanism. Application code may associate a different event with each bit in a flag. A thread can wait for either a single event or a combination of events by checking one or multiple bits in the corresponding flag.<br />
  61. 61. MAILBOXES<br /> It is also called message boxes, are an eCos synchronization mechanism that provides a means for two threads to exchange information.<br /> The eCos mailbox mechanism can be configured for blocking or nonblocking on both the send and receive side.<br />
  62. 62. SPINLOCKS<br /> A spinlock is a flag that a thread can check before executing a particular piece of code. Basically, only 1 thread at a time can acquire a spinlock. Any other thread attempting to acquire the same lock will keep trying (spinning) until it can acquire a lock.<br />
  63. 63. Tinyos<br />
  64. 64. WHAT IS A TINYOS?<br />TinyOS is a free and open source component-based operating system and platform targeting wireless sensor networks.<br /> TinyOS is an embedded operating system written in the nesC programming language as a set of cooperating tasks and processes.<br />
  65. 65. WIRELESS SENSOR NETWORKS<br /> TINYOS was developed primarily for use with networks of small wireless sensor. A number of trends have enabled the development of extremely compact, low-power sensors. The well-known Moore’s law continuous to drive down the size of memory and processing logic elements. Smaller size in turn reduces power consumption. Low power and small size treads are also evident in wireless communication hardware, micro-electrical sensors (MEMS) and transducers.<br />
  66. 66. NETWORK TOPOLOGY<br />
  67. 67. TINYOS GOALS<br /><ul><li>Allow high concurrency: In a typical wireless sensor network application, the devices are concurrency intensive. Several different flows of data must be kept moving simultaneously. While sensor data is input in a steady stream, processed results must be transmitted in a steady stream. In addition, external controls from remote sensors or base stations must be managed.
  68. 68. Operate with limited resources: The target platform for TinyOS will have limited memory and computational resources and run on batteries or solar power. A single platform may offer only kilobytes of program memory and hundreds of bytes of RAM. The software must make efficient use of the available processor and memory resources while enabling low-power communication.</li></li></ul><li>TINYOS GOALS<br /><ul><li>Adapt to hardware evolution: Mote hardware is in constant evolution; applications and most system services must be portable across hardware generations. Thus, it should be possible to upgrade the hardware with little or no software change, if the functionality is the same.
  69. 69. Support a wide range of applications: Applications exhibit a wide range of requirements in terms of lifetime, communication, sensing, and so on. A modular, general-purpose embedded OS is desired so that a standardized approach leads to economies of scale in developing applications and support software.</li></li></ul><li>TINYOS GOALS<br /><ul><li>Support a diverse set of platforms: As with the preceding point, a general-purpose embedded OS is desirable.
  70. 70. Be robust: Once deployed, a sensor network must run unattended for months or years. Ideally, there should be redundancy both within a single system and across the network of sensors. However, both types of redundancy require additional resources. One software characteristic that can improve robustness is to use highly modular, standardized software components.</li></li></ul><li>TINYOS COMPONENTS<br /> An embedded software system built using TinyOS consists of a set of small modules called components, each of which performs a simple task or set of tasks and which interface with each other and with hardware in limited and well-defined ways. The only other software module is the scheduler.<br /> To meet the demanding software requirements of this application, a rigid, simplified software architecture is dictated, consisting of components. The TinyOS development community has implemented a number of open-source components that provide the basic functions needed for the WSN application.<br />
  71. 71. TASK<br /> Within a component, tasks are atomic: Once a task has started, it runs to completion. It cannot be preempted by another task in the same component, and there is no timeslicing. However, a task can be preempted by an event. A task cannot block or spin wait.<br />
  72. 72. COMMAND<br /> It is a nonblocking requests. A command is typically a request for the lower-level component to perform some service, such as initiating a sensor reading.<br />
  73. 73. EVENTS<br /> In TinyOS may be tied either directly or indirectly to hardware events. The lowest level software components interface directly to hardware interrupts, which may be external interrupts, timer events, or counter events. An event handler in a lowest level component may handle the interrupt itself or may propagate event messages up through the component hierarchy.<br />
  74. 74. TINYOS RESOURCE INTERFACE<br /> The TINYOS scheduler operates across all components. Virtually all embedded systems using TINYOS will be uni-processor systems, so that only one task among all the tasks in all the components may execute at a time. The scheduler is a separate component. It is the only portion of TINYOS that must be present in any system. <br />
  75. 75. ABSTRACTIONS FOR RESOURCES<br /><ul><li>Dedicated</li></ul>A resource that a subsystem needs exclusive access at all times.<br /><ul><li>Virtualized</li></ul>The virtualized abstraction may be used when the underlying<br />resource need not be protected by mutual exclusion.<br /><ul><li>Shared</li></ul>The shared resource abstraction provides access to a dedicated<br />resource through an arbiter component. The arbiter enforces<br />mutual conclusion allowing only the user at a time to have<br />access to a resource and enabling the client to lock the<br />resource.<br />
  76. 76. SHARED RESOURCE CONFIGURATION<br /><ul><li>Resource: The client issues a request at this interface requesting access to the resource.
  77. 77. Resource Requested: This is similar to the Resource interface. In this case, the client is able to hold onto a resource until the client is notified that someone else needs the resource.</li></li></ul><li>SHARED RESOURCE CONFIGURATION<br /><ul><li>Resource Configure: This interface allows a resource to be automatically configured just before a client is granted access to it.
  78. 78. Resource-specific interfaces: Once a client has access to a resource, it uses resource-specific interfaces to exchange data and control information with the resource.</li></li></ul><li>SHARED RESOURCE CONFIGURATION<br /> In addition to the dedicated resource, the shared resource configuration consists of two components. The Arbiter accepts requests for access and configuration from a client and enforce the lock on the underlying resource. The shared resource component mediates data exchange between the client and the underlying resource.<br />
  79. 79. SHARED RESOURCE CONFIGURATION<br />
  80. 80. Thank you!!<br />
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×