Download presentation
Presentation is loading. Please wait.
1
CS703 - Advanced Operating Systems
By Mr. Farhan Zaidi
2
Lecture No. 35
3
Overview of today’s lecture
Goals of I/O software Layers of I/O software Direct Vs memory mapped I/O Interrupt driven I/O Polled I/O Direct Memory Access (DMA)
4
Principles of I/O Software
Goals of I/O Software Device independence programs can access any I/O device without specifying device in advance (floppy, hard drive, or CD-ROM) Uniform naming name of a file or device a string or an integer not depending on which machine Error handling handle as close to the hardware as possible Synchronous vs. asynchronous transfers blocked transfers vs. interrupt-driven Buffering data coming off a device cannot be stored in final destination immediately
5
Device Controllers mechanical component electronic component
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
6
Layers of the I/O system and the main functions of each layer
7
Memory mapped I/O Vs Direct I/O
Device controller’s registers and internal memory are directly mapped into the processor’s address space Direct I/O Device controller’s registers and internal memory is accessible via special instructions in the assembly language instruction set. The arguments to these instructions are usually called ports.
8
Writing a string to the printer using programmed I/O
9
Interrupt-Driven I/O a. Code executed when print system call is made
Writing a string to the printer using interrupt-driven I/O a. Code executed when print system call is made b. Interrupt service procedure
10
A Typical Hardware System
CPU chip register file ALU system bus memory bus main memory bus interface I/O bridge I/O bus Expansion slots for other devices such as network adapters. USB controller graphics adapter disk controller mouse keyboard monitor disk
11
Reading a Disk Sector: Step 1
CPU chip CPU initiates a disk read by writing a command, logical block number, and destination memory address to a port (address) associated with disk controller. register file ALU main memory bus interface I/O bus USB controller graphics adapter disk controller mouse keyboard monitor disk
12
Reading a Disk Sector: Step 2
CPU chip Disk controller reads the sector and performs a direct memory access (DMA) transfer into main memory. register file ALU main memory bus interface I/O bus USB controller graphics adapter disk controller mouse keyboard monitor disk
13
Reading a Disk Sector: Step 3
CPU chip When the DMA transfer completes, the disk controller notifies the CPU with an interrupt (i.e., asserts a special “interrupt” pin on the CPU) register file ALU main memory bus interface I/O bus USB controller graphics adapter disk controller mouse keyboard monitor disk
14
Direct Memory Access (DMA)
Operation of a DMA transfer
15
I/O Using DMA a. code executed when the print system call is made
Printing a string using DMA a. code executed when the print system call is made b. interrupt service procedure
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.