rt-linux.ppt

4,779 views

Published on

1 Comment
3 Likes
Statistics
Notes
  • Nice ppts.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
4,779
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
268
Comments
1
Likes
3
Embeds 0
No embeds

No notes for slide

rt-linux.ppt

  1. 1. Real Time Linux Operating Systems Swaminathan Sivasubramanian Dependable Computing & Networking Laboratory Iowa State University [email_address]
  2. 2. Linux as a Real-Time OS <ul><li>Traditional RT Systems used custom built systems – which were not extensible I.e. tough to develop new applications </li></ul><ul><li>However, as technology improved, generic real-time OS became acceptable </li></ul><ul><li>In OS suited for extensible development Linux looks more appealing </li></ul>
  3. 3. <ul><li>Linux (and its Real Time versions) are free!! </li></ul><ul><li>Linux (and its Real Time versions) are Open Source!! </li></ul><ul><li>Easy for developing RT applications </li></ul>Why Linux?
  4. 4. Why not Linux? <ul><li>Linux didn’t have any corporate support until now </li></ul><ul><li>Linux, is a very good general purpose operating system, but not so for real-time OS (Why??) </li></ul><ul><li>Because, the design motive of a conventional OS and RTOS is different </li></ul>
  5. 5. Linux as your real-time solution? <ul><li>Could increase priority for “real-time” tasks and assume they get scheduled </li></ul><ul><li>Problem – Linux optimizes average case whereas an RTOS should work under worst case assumptions </li></ul>
  6. 6. Linux – A Simplified View
  7. 7. Linux – conflicts with RT constraints <ul><li>Coarse grained synchronization – long intervals when a task has exclusive use of data ( as fine grained – leads to lot of overhead reducing the average case performance) </li></ul><ul><li>Linux batch all operations for efficient use of H/W </li></ul><ul><ul><li>E.g freeing a list of pages when memory is full reducing the worst case performance </li></ul></ul><ul><li>Linux doesn't preempt low-priority task during system call </li></ul><ul><li>Linux will make high priority tasks wait for low priority to release resources </li></ul>
  8. 8. Real Time Linux approaches <ul><li>Modify the current Linux kernel to guarantee RT constraints </li></ul><ul><ul><li>Used by KURT </li></ul></ul><ul><li>Make the standard Linux kernel run as a task of the real-time kernel </li></ul><ul><ul><li>Used by RT-Linux, RTAI </li></ul></ul>
  9. 9. Modifying Linux kernel <ul><li>Advantages </li></ul><ul><ul><li>Most problems, such as interrupt handling, already solved </li></ul></ul><ul><ul><li>Less initial labor </li></ul></ul><ul><li>Disadvantages </li></ul><ul><ul><li>No guaranteed performance </li></ul></ul><ul><ul><li>RT tasks don’t always have precedence over non-RT tasks. </li></ul></ul>
  10. 10. Running Linux as a process of a second RT kernel <ul><li>Advantages </li></ul><ul><ul><li>Can make hard real time guarantees </li></ul></ul><ul><ul><li>Easy to implement a new scheduler </li></ul></ul><ul><li>Disadvantages </li></ul><ul><ul><li>Initial port difficult, must know a tremendous amount about underlying hardware </li></ul></ul><ul><ul><li>Running a small real-time executive is not a substitute for a full fledged RTOS </li></ul></ul>
  11. 11. RTAI Overview <ul><li>Based on Real-Time Hardware Abstraction Layer (HAL) (also used in Windows NT) </li></ul><ul><li>HAL exports Linux data and functions related to hardware </li></ul><ul><li>HAL defines an interface between RTAI and Linux </li></ul>
  12. 12. RTAI – A Simplified View
  13. 13. RTAI Overview (continued) <ul><li>Software architecture </li></ul><ul><ul><li>Interface to Linux hardware management (HAL) </li></ul></ul><ul><ul><li>3 basic components: dispatcher, scheduler, fifos </li></ul></ul><ul><ul><li>1 interface used in user tasks to initialize and start the components </li></ul></ul><ul><li>RTAI is basically an interrupt dispatcher (reroutes interrupts to Linux if necessary) e.g: Disk interrupt </li></ul>
  14. 14. KURT Overview <ul><li>Developed at University of Kansas </li></ul><ul><li>Soft real-time system </li></ul><ul><li>Refines the temporal granularity of Linux </li></ul><ul><ul><li>Motivation: RT tasks may need a time resolution on the order of microseconds, while non-RT tasks may need a resolution of only milliseconds </li></ul></ul><ul><li>Result: Timer interrupts are programmed to service earliest scheduled event (results in aperiodic timer interrupts) </li></ul>
  15. 15. KURT Overview (continued) <ul><li>Not suitable for hard real-time systems </li></ul><ul><li>KURT can’t guarantee priority of RT tasks over non-RT tasks </li></ul><ul><li>An RT task can be blocked by a non-RT task (eg: during disk I/O) leading to priority inversion </li></ul><ul><li>Suitable for soft RT systems </li></ul>
  16. 16. RT-Linux Overview <ul><li>Open source Linux project </li></ul><ul><li>Supports x86, PowerPC, Alpha </li></ul><ul><li>Patch of the regular Linux kernel (simply install the patch and recompile the kernel) </li></ul><ul><li>Provides an RT API for developers </li></ul><ul><li>Runs Linux kernel as lowest priority process </li></ul>
  17. 17. RT-Linux Task Structure
  18. 18. RT-Linux Interrupt Dispatcher
  19. 19. RT-Linux Overview (continued) <ul><li>RT tasks are coded as modules </li></ul><ul><li>Modules are inserted and removed at users discretion </li></ul><ul><li>Extremely good at handling periodic tasks </li></ul><ul><li>Communicates with non-RT kernel and other RT tasks via fifo queues </li></ul><ul><li>Tools are provided for graphical analysis of RT execution </li></ul>
  20. 20. Problems with RT-Linux <ul><li>Currently no support for aperiodic tasks </li></ul><ul><li>Not very useful for complex RT systems </li></ul><ul><li>Currently limited to simple problems </li></ul>
  21. 21. Montavista – A Faster Response Linux Kernel <ul><li>Montavista Inc. provides a linux solution for embedded systems </li></ul><ul><li>The solution’s aim is to make the Linux kernel fully preemptable </li></ul><ul><li>It identifies the points where priority inversion occurs in Linux and makes those points fully preemptable </li></ul><ul><li>A good embedded solution not a complete RT solution. </li></ul>
  22. 22. Important References <ul><li>RT-Linux : http://www.rtlinux.org </li></ul><ul><li>RTAI : h ttp://www.aero.polimi.it/projects/rtai/contrib.htm </li></ul><ul><li>Montavista: http://www.mvista.com </li></ul>

×