31
RTOS on Embedded System Group 9 Member R92921012 李李李 R92921068 李李李 R92921059 李李李 R92921057 李李李

RTOS on Embedded System

Embed Size (px)

DESCRIPTION

Outline Motivation Real-Time Scheduling RTOS Market Reference Priority Algorithm Scheduling Conclusion Resource Constraint RTOS Market Reference

Citation preview

Page 1: RTOS on Embedded System

RTOS on Embedded System

Group 9

Member R92921012 李冠德 R92921068 邱保盛 R92921059 陳信名 R92921057 柯怡賢

Page 2: RTOS on Embedded System

Outline• Motivation• Real-Time Scheduling

– Priority Algorithm– Scheduling Conclusion– Resource Constraint

• RTOS Market• Reference

Page 3: RTOS on Embedded System

Motivation

• In the future, embedded system is more and more important in IA products. To make an embedded system, operating system play a decisive role.

• Real-time、 power-consuming、 small-size、 etc., all kinds of the embedded OS, mainly focus on the real-time performance.

• Our research will focus on the field of real-time scheduling policy ,and introduce some popular RTOS solutions nowadays

Page 4: RTOS on Embedded System

Type of Real-Time

Real -Time

Soft Hard

Off line

Fixed

On line(priority)

DynamicHybrid

Page 5: RTOS on Embedded System

Fixed Priority Algorithms

• Characters• All jobs of the same task have same priority• The task’s priority is fixed• Do not discourage starvation

• Rate-Monotonic(RM) Scheduling• Shorter period,higher priorit

• Deadline-Monotonic(DM) Scheduling• Shorter deadline,highter priority

Page 6: RTOS on Embedded System

Deadline Monotonic (DM) algorithm

• Priority assignment based on relative deadlines of tasks

• Shorter the relative deadline, higher the priority

• Useful when relative deadline <= period

Page 7: RTOS on Embedded System

Dynamic Priority Algorithms

• Character• Task’s priority is not fixed• Task’s priority is determined by deadline• Can eliminate starvation by aging processes

• Earliest-Deadline-First (EDF) algorithm• Earlier deadline,higher priority

• Minimum-Laxity-First (MLF) algorithm• Minimum laxity, highest priority

Page 8: RTOS on Embedded System

Minimum-Laxity-First (MLF) algorithm

• Priority assignment based on laxity of jobs• Job with minimum laxity assigned highest priority• Schedulable utilization = 100%• Similar in properties to EDF

Laxity = Absolute Deadline – Worst case computation time

(current_time + CPU_time_needed)

Page 9: RTOS on Embedded System

Hybrid Algorithms

• Combination of fixed and dynamic priority algorithms• Tasks divided based on criticality – critical and non-

critical• Critical tasks scheduled using fixed priority

assignment• Non-critical tasks scheduled based on dynamic

priority assignment• Maximum Urgency First(MUF) Algorithm

Page 10: RTOS on Embedded System

Maximum Urgency First(MUF) Algorithm

• Combination of fixed and dynamic priority scheduling• Each task is given an urgency• One of the fixed priority has higher precedence over dynamic

priority ,called the criticality • The other fixed priority has lower precedence than dynamic

priority ,called the user priority

fixed dynamic fixedHigh order Low order

(Criticality) (user priority)

Page 11: RTOS on Embedded System

Example

Task Priority(RM) Criticality(MUF) Period CPU time Legend T1 high high 6 2 T2 Med high high 10 4 T3 Med low high 12 3 T4 Low Low 15 4

0 186 2412

12

0 10 20

0 24

0 15

Page 12: RTOS on Embedded System

Example

1 1 1 1 1 1 2 2 1 1 2 2 3 3 2 2 1 1 4 4 3 3 3 3 50 10 22184 8 12 162 6 14 2420

RM

T3, 1st

186 2412

12

10 20

24

15

T4, 1st

Page 13: RTOS on Embedded System

Example

0

1 1 1 1 1 1 2 2 1 1 2 2 3 3 2 2 1 1 4 4 3 3 3 3 50 10 22184 8 12 162 6 14 2420

RM

0

EDF1 1 1 1 1 1 1 1 1 2 2 1 1 1 1 3 3 2 2 2 2 2 2 2 4

10 22184 8 12 162 6 14 2420

MUF

10 22184 8 12 162 6 14 24201 1 1 1 1 1 1 1 1 2 2 2 3 3 2 2 2 2 4 4 2 2 3 3 3

T3, 1st T4, 1st

T2,2nd T1,4th

T4 , 1st

Page 14: RTOS on Embedded System

Scheduling Conclusion

RM/DM Simple, low run time, periodicBut fixed priority, low system utilization

EDF/MLF The schedulable bound is 100%But High run-time cost, fail in a transient overload

MUF A schedulable bound of 100%meet its deadlines even during transient overload

• For hard real time systems, there are many problems for deadline reach. This research can promote our ability to solve the problem of real-time scheduling.

Page 15: RTOS on Embedded System

Resource Constraint

In real-time systems, resource access may not only suffer deadlock accident, but

also suffer timing anomaly and priority inversion accident.

Provide a Resource Access-Control

Propocol to overcome these accidents

Page 16: RTOS on Embedded System

RTLinux

• Because the growth of linux , linux-based RTOS is a another raising star

• An hard real time OS• Application

– Time sensitive instruments and machines– E.g. aviation and aerospace , robot control…

• Features of linux– Soft real-time OS– Linux kernel separates the hardware from user-level tasks.– In trying to be “fair” to all tasks, the kernel can prevent critic

al events from occurring.

Page 17: RTOS on Embedded System

Detail for the bare linux kernel

Page 18: RTOS on Embedded System

Architecture of the RTLinux

• RTLinux kernel coexists with the standard linux kernel

• Instead of rewriting the linux kernel , RTlinux create a small kernel and linux is running on top of it.

• RTLinux kernel is inserted between the hardware and the standard linux kernel

• Assigns the lowest priority to the standard Linux kernel

• RTLinux works by intercepting all hardware interrupts.

Page 19: RTOS on Embedded System

Detail of the RTLinux kernel

Page 20: RTOS on Embedded System

Pros and cons

• Because the RTLinux coexists with the standard linux , we can available resources of linux like IPC, network, GUI etc.

• The source code is easy to acquire.• The application support is poor in comparison with

other RTOS.

Page 21: RTOS on Embedded System

Where to get the RTLinux?

• www.fsmlabs.com– Commercial version : RTLinuxpro– Free version : RTLinuxfree– The latest RTLinuxfree release is RTLinux-3.2-pre2 whi

ch support the standard linux version of 2.4.19 、 2.4.20 、 2.4.21

– Processors supported: x86, ARM, PocketPC, MIPs, Alpha

Page 22: RTOS on Embedded System

How to install? (1/3)

Goal: Install the RTLinux kernel 3.2 in linux kernel 2.4.20

• 1. Get linux kernel 2.4.20 – http://ftp.kernel.org

• 2. Get RTLinux kernel 3.2 and patches– www.fsmlabs.com

• 3. Put linux kernel 2.4.20 into the directory of RTLinux kernel

Page 23: RTOS on Embedded System

How to install? (2/3)

• 4. Patch the linux kernel with rtlinux patch– Patch –p1 < ../patches/kernel_patch-2.4.20-rtl3.2-pre2

• 5. Configure the patched linux kernel– Make xconfig or make conifg

• 6. Build a new linux kernel– Make dep bzImage modules modules_install

• 7. Configure your boot loader and reboot

Page 24: RTOS on Embedded System

Step 5

Page 25: RTOS on Embedded System

How to install? (3/3)

• 8. Configure RTLinux– Enter the RTLinux-3.2-pre2 directory– Make xconfig

• 9. Compile RTLinux – Make– Make devices– Make install

• 10. Reboot and the installation is done.

Page 26: RTOS on Embedded System

Step 8

Page 27: RTOS on Embedded System

Palm OS

PDA market – over 65%• Cheaper than EPOC or WinCE.• Plenty application-supporting.• Less power consuming and long ready time• Poor in multi-media application.• Authorization – hard to obtain

Page 28: RTOS on Embedded System

EPOC

• Put up out by “Symbian” – composed by Ericsson 、Motorola 、 Nokia and Poison.

• SmartPhone market• Good wireless LAN capability ( Bluetooth and Infra

red-ray)• Not well-known in Asia

Page 29: RTOS on Embedded System

WinCE

• Windows CE is first introduced in the Handheld PC (H/PC) set of products in November 1996..

• Globally used Win32API and ease to develop applications

• Outstanding GUI and multimedia

• The kernel itself and the applications are lager when comparing with other RTOS.

• Higher power consumption

Page 30: RTOS on Embedded System

Compare

Real-time AP-sup Multimedia Wireless LAN Plant

Palm ■ ■ ■ ■ ■

EPOC ■ ■ ■ ■ ■

WinCE ■ ■ ■ ■ ■

■ : Good

■ : Medium

■ : Bad

Page 31: RTOS on Embedded System

Reference

• Shin, K.G.; Ramanathan, P.” Real-time computing: a new discipline of computer science and engineering”Proceedings of the IEEE , Volume: 82 , Issue: 1 , Jan. 1994 Pages:6 – 24

• David B. Stewart and Pradeep K. Khosla “Real-Time Scheduling of Sensor-Based Control Systems ” Pergamon Press Inc. Tarrytown, New York 1992 page:139-144

• www.symbian.com• www.palm.com • www.itnet.org.tw/ssl/html-new/vis• www.wince.com.tw• www.tldp.org/HOWTO/RTLinux-HOWTO