1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software...
-
date post
22-Dec-2015 -
Category
Documents
-
view
227 -
download
0
Transcript of 1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software...
![Page 1: 1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649d775503460f94a584d0/html5/thumbnails/1.jpg)
1
Input/Output
Chapter 3
TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks
Reference:
Operating Systems Design and Implementation (Second Edition)
by Andrew S. Tanenbaum, Albert S. Woodhull
![Page 2: 1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649d775503460f94a584d0/html5/thumbnails/2.jpg)
2
Device Controllers
• I/O devices have components:– mechanical component – electronic component
• The electronic component is the device controller– may be able to handle multiple devices
• Controller's tasks– convert serial bit stream to block of bytes– perform error correction as necessary– make available to main memory
![Page 3: 1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649d775503460f94a584d0/html5/thumbnails/3.jpg)
3
Memory-Mapped I/O (1)
Memory-mapped I/O HybridSeparate I/O and memory space
![Page 4: 1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649d775503460f94a584d0/html5/thumbnails/4.jpg)
4
Memory-Mapped I/O (2)
(a) A single-bus architecture(b) A dual-bus memory architecture
![Page 5: 1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649d775503460f94a584d0/html5/thumbnails/5.jpg)
5
Direct Memory Access (DMA)
Operation of a DMA transfer
![Page 6: 1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649d775503460f94a584d0/html5/thumbnails/6.jpg)
6
Interrupt
How interrupts happens. Connections between devices and interrupt controller actually use interrupt lines on the bus rather than dedicated wires
![Page 7: 1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649d775503460f94a584d0/html5/thumbnails/7.jpg)
7
Principles of I/O Software
• Device independence– programs can access any I/O device – without specifying device in advance
· (floppy, hard drive, or CD-ROM)
• Buffering– data coming off a device cannot be stored in
final destination
• Error handling– handle as close to the hardware as possible
![Page 8: 1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649d775503460f94a584d0/html5/thumbnails/8.jpg)
8
Programmed I/O (1)
Steps in printing a string
![Page 9: 1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649d775503460f94a584d0/html5/thumbnails/9.jpg)
9
Programmed I/O (2)
Writing a string to the printer using programmed I/O
![Page 10: 1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649d775503460f94a584d0/html5/thumbnails/10.jpg)
10
Interrupt-Driven I/O
Code executed when print system call is made
Interrupt service procedure
![Page 11: 1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649d775503460f94a584d0/html5/thumbnails/11.jpg)
11
I/O Using DMA
Code executed when print system call is made
Interrupt service procedure
![Page 12: 1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649d775503460f94a584d0/html5/thumbnails/12.jpg)
12
I/O Software Layers
Layers of the I/O Software System
![Page 13: 1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649d775503460f94a584d0/html5/thumbnails/13.jpg)
13
Device Drivers
• Logical position of device drivers is shown here• Communications between drivers and device controllers goes over the
bus
![Page 14: 1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649d775503460f94a584d0/html5/thumbnails/14.jpg)
14
Device-Independent I/O Software (1)
Functions of the device-independent I/O software
Uniform interfacing for device drivers
Buffering
Error reporting
Allocating and releasing dedicate devices
Providing a deice-independent block size
![Page 15: 1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649d775503460f94a584d0/html5/thumbnails/15.jpg)
15
Device-Independent I/O Software (2)
(a) Unbuffered input(b) Buffering in user space(c) Buffering in the kernel followed by copying to user space(d) Double buffering in the kernel
![Page 16: 1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649d775503460f94a584d0/html5/thumbnails/16.jpg)
16
User-Space I/O Software
Layers of the I/O system and the main functions of each layer
![Page 17: 1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649d775503460f94a584d0/html5/thumbnails/17.jpg)
17
Disk Formatting
• No interleaving• Single interleaving• Double interleaving
![Page 18: 1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649d775503460f94a584d0/html5/thumbnails/18.jpg)
18
Disk Arm Scheduling Algorithms (1)
• Time required to read or write a disk block determined by 3 factors
1. Seek time
2. Rotational delay
3. Actual transfer time
• Seek time dominates
• Error checking is done by controllers
![Page 19: 1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649d775503460f94a584d0/html5/thumbnails/19.jpg)
19
Disk Arm Scheduling Algorithms (2)
Shortest Seek First (SSF) disk scheduling algorithm
Initialposition
Pendingrequests
![Page 20: 1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649d775503460f94a584d0/html5/thumbnails/20.jpg)
20
Disk Arm Scheduling Algorithms (3)
The elevator algorithm for scheduling disk requests
![Page 21: 1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649d775503460f94a584d0/html5/thumbnails/21.jpg)
21
Error Handling
• A disk track with a bad sector• Substituting a spare for the bad sector• Shifting all the sectors to bypass the bad one
![Page 22: 1 Input/Output Chapter 3 TOPICS Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Reference: Operating Systems Design.](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649d775503460f94a584d0/html5/thumbnails/22.jpg)
22
Display Hardware
Memory-mapped displays• driver writes directly into display's video RAM
Parallel port