Upload
elijah-malone
View
266
Download
0
Embed Size (px)
DESCRIPTION
Outline Motivation Real-Time Scheduling RTOS Market Reference Priority Algorithm Scheduling Conclusion Resource Constraint RTOS Market Reference
Citation preview
RTOS on Embedded System
Group 9
Member R92921012 李冠德 R92921068 邱保盛 R92921059 陳信名 R92921057 柯怡賢
Outline• Motivation• Real-Time Scheduling
– Priority Algorithm– Scheduling Conclusion– Resource Constraint
• RTOS Market• Reference
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
Type of Real-Time
Real -Time
Soft Hard
Off line
Fixed
On line(priority)
DynamicHybrid
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
Deadline Monotonic (DM) algorithm
• Priority assignment based on relative deadlines of tasks
• Shorter the relative deadline, higher the priority
• Useful when relative deadline <= period
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
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)
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
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)
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
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
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
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.
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
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.
Detail for the bare linux kernel
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.
Detail of the RTLinux kernel
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.
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
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
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
Step 5
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.
Step 8
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
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
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
Compare
Real-time AP-sup Multimedia Wireless LAN Plant
Palm ■ ■ ■ ■ ■
EPOC ■ ■ ■ ■ ■
WinCE ■ ■ ■ ■ ■
■ : Good
■ : Medium
■ : Bad
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