sebikumar-Banglinux.ppt - FOSS.IN foss.in by fdshsdhs

VIEWS: 22 PAGES: 26

									Linux Potential for Embedded
 and Real Time Applications

      K. Sebi Kumar
    Wipro Technologies
                       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
                     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
                        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 won’t walk away .


     Talent Transformation   Linux potential for RT Applications   1 of 26
                       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
          RT Linux




Talent Transformation   Linux potential for RT Applications   1 of 26
                  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
                     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
              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 Linux’s SMP locking mechanisms to
     work on a single processor.




     Talent Transformation   Linux potential for RT Applications   1 of 26
         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
               Comparisons

Standard Kernel                             Preempted Kernel




 Talent Transformation   Linux potential for RT Applications   1 of 26
                  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
             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
                  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
           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
            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
               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
                 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 won’t meet requirements



       Talent Transformation   Linux potential for RT Applications   1 of 26
             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
               Conclusion




• If a system has real-time requirements there are
  three ways Linux can be used

   1.   Kernel coexistence
   2.   Kernel modification
   3.   Kernel replacement



• Each has its advantages and disadvantages




        Talent Transformation   Linux potential for RT Applications   1 of 26
                        Thank You


    sebikumar.kuruvilla@wipro.com




Talent Transformation   Linux potential for RT Applications   1 of 26

								
To top