Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19:...
-
Upload
darren-price -
Category
Documents
-
view
218 -
download
2
Transcript of Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19:...
![Page 1: Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.](https://reader036.fdocuments.net/reader036/viewer/2022062516/56649db65503460f94aa7e6a/html5/thumbnails/1.jpg)
Chapter 19: Real-Time SystemsChapter 19: Real-Time Systems
![Page 2: Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.](https://reader036.fdocuments.net/reader036/viewer/2022062516/56649db65503460f94aa7e6a/html5/thumbnails/2.jpg)
19.2 Silberschatz, Galvin and Gagne ©2005AE4B33OSS
Chapter 19: Real-Time SystemsChapter 19: Real-Time Systems
System Characteristics
Features of Real-Time Systems
Implementing Real-Time Operating Systems
Real-Time CPU Scheduling
VxWorks 5.x
![Page 3: Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.](https://reader036.fdocuments.net/reader036/viewer/2022062516/56649db65503460f94aa7e6a/html5/thumbnails/3.jpg)
19.3 Silberschatz, Galvin and Gagne ©2005AE4B33OSS
ObjectivesObjectives
To explain the timing requirements of real-time systems
To distinguish between hard and soft real-time systems
To discuss the defining characteristics of real-time systems
To describe scheduling algorithms for hard real-time systems
![Page 4: Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.](https://reader036.fdocuments.net/reader036/viewer/2022062516/56649db65503460f94aa7e6a/html5/thumbnails/4.jpg)
19.4 Silberschatz, Galvin and Gagne ©2005AE4B33OSS
Overview of Real-Time SystemsOverview of Real-Time Systems
A real-time system requires that results be produced within a specified deadline period.
An embedded system is a computing device that is part of a larger system (I.e. automobile, airliner.)
A safety-critical system is a real-time system with catastrophic results in case of failure.
A hard real-time system guarantees that real-time tasks be completed within their required deadlines.
A soft real-time system provides priority of real-time tasks over non real-time tasks.
![Page 5: Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.](https://reader036.fdocuments.net/reader036/viewer/2022062516/56649db65503460f94aa7e6a/html5/thumbnails/5.jpg)
19.5 Silberschatz, Galvin and Gagne ©2005AE4B33OSS
System CharacteristicsSystem Characteristics
Single purpose
Small size
Inexpensively mass-produced
Specific timing requirements
![Page 6: Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.](https://reader036.fdocuments.net/reader036/viewer/2022062516/56649db65503460f94aa7e6a/html5/thumbnails/6.jpg)
19.6 Silberschatz, Galvin and Gagne ©2005AE4B33OSS
System-on-a-ChipSystem-on-a-Chip
Many real-time systems are designed using system-on-a-chip (SOC) strategy.
SOC allows the CPU, memory, memory-management unit, and attached peripheral ports (I.e. USB) to be contained in a single integrated circuit.
![Page 7: Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.](https://reader036.fdocuments.net/reader036/viewer/2022062516/56649db65503460f94aa7e6a/html5/thumbnails/7.jpg)
19.7 Silberschatz, Galvin and Gagne ©2005AE4B33OSS
Bus-Oriented SystemBus-Oriented System
![Page 8: Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.](https://reader036.fdocuments.net/reader036/viewer/2022062516/56649db65503460f94aa7e6a/html5/thumbnails/8.jpg)
19.8 Silberschatz, Galvin and Gagne ©2005AE4B33OSS
Features of Real-Time KernelsFeatures of Real-Time Kernels
Most real-time systems do not provide the features found in a standard desktop system.
Reasons include
Real-time systems are typically single-purpose.
Real-time systems often do not require interfacing with a user.
Features found in a desktop PC require more substantial hardware that what is typically available in a real-time system.
![Page 9: Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.](https://reader036.fdocuments.net/reader036/viewer/2022062516/56649db65503460f94aa7e6a/html5/thumbnails/9.jpg)
19.9 Silberschatz, Galvin and Gagne ©2005AE4B33OSS
Virtual Memory in Real-Time SystemsVirtual Memory in Real-Time Systems
Address translation may occur via:
(1) Real-addressing mode where programs generate actual addresses.
(2) Relocation register mode.
(3) Implementing full virtual memory.
![Page 10: Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.](https://reader036.fdocuments.net/reader036/viewer/2022062516/56649db65503460f94aa7e6a/html5/thumbnails/10.jpg)
19.10 Silberschatz, Galvin and Gagne ©2005AE4B33OSS
Address TranslationAddress Translation
![Page 11: Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.](https://reader036.fdocuments.net/reader036/viewer/2022062516/56649db65503460f94aa7e6a/html5/thumbnails/11.jpg)
19.11 Silberschatz, Galvin and Gagne ©2005AE4B33OSS
Implementing Real-Time Implementing Real-Time Operating SystemsOperating Systems
In general, real-time operating systems must provide:
(1) Preemptive, priority-based scheduling
(2) Preemptive kernels
(3) Latency must be minimized
![Page 12: Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.](https://reader036.fdocuments.net/reader036/viewer/2022062516/56649db65503460f94aa7e6a/html5/thumbnails/12.jpg)
19.12 Silberschatz, Galvin and Gagne ©2005AE4B33OSS
Minimizing LatencyMinimizing Latency
Event latency is the amount of time from when an event occurs to when it is serviced.
![Page 13: Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.](https://reader036.fdocuments.net/reader036/viewer/2022062516/56649db65503460f94aa7e6a/html5/thumbnails/13.jpg)
19.13 Silberschatz, Galvin and Gagne ©2005AE4B33OSS
Interrupt LatencyInterrupt Latency
Interrupt latency is the period of time from when an interrupt arrives at the CPU to when it is serviced.
![Page 14: Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.](https://reader036.fdocuments.net/reader036/viewer/2022062516/56649db65503460f94aa7e6a/html5/thumbnails/14.jpg)
19.14 Silberschatz, Galvin and Gagne ©2005AE4B33OSS
Dispatch LatencyDispatch Latency
Dispatch latency is the amount of time required for the scheduler to stop one process and start another.
![Page 15: Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.](https://reader036.fdocuments.net/reader036/viewer/2022062516/56649db65503460f94aa7e6a/html5/thumbnails/15.jpg)
19.15 Silberschatz, Galvin and Gagne ©2005AE4B33OSS
Real-Time CPU SchedulingReal-Time CPU Scheduling
Periodic processes require the CPU at specified intervals (periods)
p is the duration of the period
d is the deadline by when the process must be serviced
t is the processing time
![Page 16: Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.](https://reader036.fdocuments.net/reader036/viewer/2022062516/56649db65503460f94aa7e6a/html5/thumbnails/16.jpg)
19.16 Silberschatz, Galvin and Gagne ©2005AE4B33OSS
Scheduling of tasks when PScheduling of tasks when P22 has a has a
higher priority than Phigher priority than P11
![Page 17: Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.](https://reader036.fdocuments.net/reader036/viewer/2022062516/56649db65503460f94aa7e6a/html5/thumbnails/17.jpg)
19.17 Silberschatz, Galvin and Gagne ©2005AE4B33OSS
Rate Montonic SchedulingRate Montonic Scheduling
A priority is assigned based on the inverse of its period
Shorter periods = higher priority;
Longer periods = lower priority
P1 is assigned a higher priority than P2.
![Page 18: Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.](https://reader036.fdocuments.net/reader036/viewer/2022062516/56649db65503460f94aa7e6a/html5/thumbnails/18.jpg)
19.18 Silberschatz, Galvin and Gagne ©2005AE4B33OSS
Missed Deadlines with Missed Deadlines with Rate Monotonic SchedulingRate Monotonic Scheduling
![Page 19: Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.](https://reader036.fdocuments.net/reader036/viewer/2022062516/56649db65503460f94aa7e6a/html5/thumbnails/19.jpg)
19.19 Silberschatz, Galvin and Gagne ©2005AE4B33OSS
Earliest Deadline First SchedulingEarliest Deadline First Scheduling
Priorities are assigned according to deadlines:
the earlier the deadline, the higher the priority;
the later the deadline, the lower the priority.
![Page 20: Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.](https://reader036.fdocuments.net/reader036/viewer/2022062516/56649db65503460f94aa7e6a/html5/thumbnails/20.jpg)
19.20 Silberschatz, Galvin and Gagne ©2005AE4B33OSS
Proportional Share SchedulingProportional Share Scheduling
T shares are allocated among all processes in the system.
An application receives N shares where N < T.
This ensures each application will receive N / T of the total processor time.
![Page 21: Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.](https://reader036.fdocuments.net/reader036/viewer/2022062516/56649db65503460f94aa7e6a/html5/thumbnails/21.jpg)
19.21 Silberschatz, Galvin and Gagne ©2005AE4B33OSS
Pthread SchedulingPthread Scheduling
The Pthread API provides functions for managing real-time threads.
Pthreads defines two scheduling classes for real-time threads:
(1) SCHED_FIFO - threads are scheduled using a FCFS strategy with a FIFO queue. There is no time-slicing for threads of equal priority.
(2) SCHED_RR - similar to SCHED_FIFO except time-slicing occurs for threads of equal priority.
![Page 22: Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.](https://reader036.fdocuments.net/reader036/viewer/2022062516/56649db65503460f94aa7e6a/html5/thumbnails/22.jpg)
19.22 Silberschatz, Galvin and Gagne ©2005AE4B33OSS
VxWorks 5.0VxWorks 5.0
![Page 23: Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.](https://reader036.fdocuments.net/reader036/viewer/2022062516/56649db65503460f94aa7e6a/html5/thumbnails/23.jpg)
19.23 Silberschatz, Galvin and Gagne ©2005AE4B33OSS
Wind MicrokernelWind Microkernel
The Wind microkernel provides support for the following:
(1) Processes and threads;
(2) preemptive and non-preemptive round-robin scheduling;
(3) manages interrupts (with bounded interrupt and dispatch latency times);
(4) shared memory and message passing interprocess communication facilities.
![Page 24: Chapter 19: Real-Time Systems. 19.2 Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.](https://reader036.fdocuments.net/reader036/viewer/2022062516/56649db65503460f94aa7e6a/html5/thumbnails/24.jpg)
End of Chapter 19End of Chapter 19