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