Title: Linux Potential for Embedded and Real Time Applications
1- Linux Potential for Embedded and Real Time
Applications - K. Sebi Kumar
- Wipro Technologies
2 AGENDA
- What is Real Time?
- Linux Barriers
- How to make Linux Real Time?
- Challenges In the Existing Version.
Talent Transformation
Linux potential for RT Applications
1 of 26
3 Hard real time
If the deadline is missed, data is permanently
lost or people get hurt Often, these systems
are fully autonomous Examples Air bag
deployment Satellite telemetry Anti- lock
brakes
Talent Transformation
Linux potential for RT Applications
1 of 26
4 Soft real-time
- With soft real- time
- systems
- Missed deadlines are not Critical
- Often have a human in the loop
- (HITL)
- Example
- An automatic teller machine
- (ATM)
- If the ATM takes 30 seconds
- longer than the ideal, the user still wont walk
away .
Talent Transformation
Linux potential for RT Applications
1 of 26
5 Talent Transformation
Linux potential for RT Applications
1 of 26
6 Real-time Linux Barriers
- Task scheduling is fair share
- The Kernel is non-preemptive
- Long interrupt disable times
- Interrupt servicing is unbounded
- Unbounded priority inversions in the kernel
Talent Transformation
Linux potential for RT Applications
1 of 26
7 How to make Linux Real-time
4 Choices to implement Real-time with Linux
Talent Transformation
Linux potential for RT Applications
8 Kernel Co-existence
Talent Transformation
Linux potential for RT Applications
9 Talent Transformation
Linux potential for RT Applications
1 of 26
10 RT Linux
Talent Transformation
Linux potential for RT Applications
1 of 26
11 Benefits
- Can support hard real-time applications
- All Linux applications still run
- Moving to a new revision of the Linux kernel
relatively is easy - Cost effective
- RTLinux's worst case interrupt latency on a
modest, reasonably configured x86 P is less than
15 microseconds
Talent Transformation
Linux potential for RT Applications
1 of 26
12 Challenges
- Real-time parts of the application do not run in
a Linux environment - No memory protection for real-time programs
- Some applications are very difficult to split
into real-time/non-real-time parts - Real-time programs cannot use Linux drivers
- Some Linux drivers may not work
- Market pressures will make the executive more
complex over time
Talent Transformation
Linux potential for RT Applications
1 of 26
13 Kernel Modification
- Create Linux patches that
- Replace the fair share scheduler with a scheduler
that supports real-time tasks - Add preemption points in the kernel
- In short enable Linuxs SMP locking mechanisms
to work on a single processor.
Talent Transformation
Linux potential for RT Applications
1 of 26
14 Adding preemption points
Check for rescheduling the CPU
Standard Linux Kernel
System call start
System call end
Linux with Preemption Points added
System call start
System call end
Check for rescheduling the CPU
Talent Transformation
Linux potential for RT Applications
1 of 26
15 Comparisons
Standard Kernel
Preempted Kernel
Talent Transformation
Linux potential for RT Applications
1 of 26
16 Benefits
- Can definitely improve the response of the Linux
kernel to support soft real-time applications - Result is an open source solution
- Real-time applications run in a full Linux
environment
Talent Transformation
Linux potential for RT Applications
1 of 26
17 Challenges
- Takes a lot of work to keep patches current
- Some device drivers have long interrupt off times
- Interrupt and mutual exclusion priority inversion
problems are not solved
Talent Transformation
Linux potential for RT Applications
1 of 26
18 Kernel Replacement
- Take an operating system kernel that was already
designed for real-time - Have it support the Linux application programming
interface (API) - Add support for the Linux application binary
interface (ABI) - Use on systems where Linux does not meet the
real-time requirements
Talent Transformation
Linux potential for RT Applications
1 of 26
19Linux as an embedded platform
3rd party software for Linux
Customer application sw
pick kernel that meets real-time requirements
hardware
Talent Transformation
Linux potential for RT Applications
1 of 26
20 Benefits
- Task scheduling is strict priority preemptive
(more than 64 priorities) - The Kernel is fully preemptive
- No long interrupt disable times
- Interrupt servicing tightly bounded even for
devices that can produce an unbounded number of
interrupt requests - No unbounded priority inversions in the kernel
Talent Transformation
Linux potential for RT Applications
1 of 26
21 Differences In Design
Standard RTOS Design
Linux with Preemption added
Preemptible Region
Non-Preemptible Region
Talent Transformation
Linux potential for RT Applications
1 of 26
22 But Is it Linux?
- Complete Linux API and ABI
- Linux user interface
- Most of Linux application will run
- Complete networking support
- Same process model and memory protection as Linux
- Smaller memory footprint
Talent Transformation
Linux potential for RT Applications
1 of 26
23 Benefits
- Even hard real-time requirements can be met
- Real-time tasks run in a Linux environment
- Smaller footprint possible - may save flash
memory - Kernel can be certified for critical applications
- Decision can be postponed until it is clear that
standard Linux wont meet requirements
Talent Transformation
Linux potential for RT Applications
1 of 26
24 Challenges
- Not an open source solution
- Software purchase costs are higher
- Some Linux applications may not run
- Cannot currently use Linux device drivers
- Not available on all the processors
Talent Transformation
Linux potential for RT Applications
1 of 26
25 Conclusion
- If a system has real-time requirements there are
three ways Linux can be used - Kernel coexistence
- Kernel modification
- Kernel replacement
- Each has its advantages and disadvantages
Talent Transformation
Linux potential for RT Applications
1 of 26
26Thank You sebikumar.kuruvilla_at_wipro.com
Talent Transformation
Linux potential for RT Applications
1 of 26