page 1 2p13 week 10. page 2 page 3 static table-driven approaches performs a static analysis of...
TRANSCRIPT
Page 1
2P13
Week 10
Page 2
Page 3
Page 4
• Real-time operating systems are designed with the objective of starting real-time tasks as rapidly as possible and emphasize rapid interrupt handling and task dispatching
• Real-time applications are generally not concerned with sheer speed but rather with completing (or starting) tasks at the most valuable times
• Priorities provide a crude tool and do not capture the requirement of completion (or initiation) at the most valuable time
Page 5
One or the other but not both
Page 6
Table 10.2
Execution Profile of Two Periodic Tasks
Process Arrival Time Execution Time Ending Deadline
A(1) 0 10 20
A(2) 20 10 40
A(3) 40 10 60
A(4) 60 10 80
A(5) 80 10 100
•••
•••
•••
•••
B(1) 0 25 50
B(2) 50 25 100
•••
•••
•••
•••
Page 7
Figure 10.5 Scheduling of Periodic Real-Time Tasks With Completion Deadlines (Based on
Table 10.2)
Page 8
Figure 10.6 Scheduling of Aperiodic Real-Time Tasks With Starting Deadlines
Page 9
Table 10.3
Execution Profile of Five Aperiodic Tasks
Process Arrival Time Execution Time Starting Deadline
A 10 20 110
B 20 20 20
C 40 20 50
D 50 20 90
E 60 20 70
Page 10Figure 10.7
Rate Monoton
ic Scheduli
ng
Page 11
Periodic Task Timing Diagram
Figure 10.8
Page 12
Table 10.4 Value of the RMS Upper Bound
n(21 n 1)n
1 1.0
2 0.828
3 0.779
4 0.756
5 0.743
6 0.734
•••
•••
ln 2 0.693
Page 13
Page 14
• External devices that engage in I/O with computer systems can be grouped into three categories:
Page 15
Page 16
Devices differ in a number of areas:
Page 17
• Three techniques for performing I/O are:• Programmed I/O
– the processor issues an I/O command on behalf of a process to an I/O module; that process then busy waits for the operation to be completed before proceeding
• Interrupt-driven I/O– the processor issues an I/O command on behalf of a process
• if non-blocking – processor continues to execute instructions from the process that issued the I/O command
• if blocking – the next instruction the processor executes is from the OS, which will put the current process in a blocked state and schedule another process
• Direct Memory Access (DMA)• a DMA module controls the exchange of data between main memory and an
I/O module
Page 18
Techniques for Performing I/O
Page 19
Page 20
Page 21
Page 22
• Functions of the operating system should be separated according to their complexity, their characteristic time scale, and their level of abstraction
• Leads to an organization of the operating system into a series of layers
• Each layer performs a related subset of the functions required of the operating system
• Layers should be defined so that changes in one layer do not require changes in other layers
Page 23
Page 24
Page 25
Page 26
Table 11.2 Comparison of Disk Scheduling Algorithms
(a) FIFO(starting at track
100)
(b) SSTF(starting at track
100)
(c) SCAN(starting at track
100, in the direction of
increasing track number)
(d) C-SCAN(starting at track
100, in the direction of
increasing track number)
Next track accessed
Number of tracks traversed
Next track accessed
Number of tracks traversed
Next track accessed
Number of tracks traversed
Next track accessed
Number of tracks traversed
55 45 90 10 150 50 150 50
58 3 58 32 160 10 160 10
39 19 55 3 184 24 184 24
18 21 39 16 90 94 18 166
90 72 38 1 58 32 38 20
160 70 18 20 55 3 39 1
150 10 150 132 39 16 55 16
38 112 160 10 38 1 58 3
184 146 184 24 18 20 90 32
Average seek length
55.3 Average seek length
27.5 Average seek length
27.8 Average seek length
35.8
Page 27
The End