Lecture 5 (Input Output Devices Manager)
Reason for Input/ Output (I/O) -
Normally the primary purpose of a computer
o Most applications don’t do much processing.
▪ Presentation program (like PowerPoint)
▪ Word
...
Lecture 5 (Input Output Devices Manager)
Reason for Input/ Output (I/O) -
Normally the primary purpose of a computer
o Most applications don’t do much processing.
▪ Presentation program (like PowerPoint)
▪ Word Processing program (like Word)
Peripheral View -
For long time considered outside the operating system. -
But many problems of a computer were due to them
o Conflicting interrupts, Drivers, Memory allocation, Updated drivers
Input and Output -
Input -
Output -
Issues - - - - - - - -
I/O -
Physical device, Connections, Support equipment, Software
Changes the nature of programs
o Keyboard, Storage Devices
Allows end users to see the data
o Monitors/ displays, Storage devices
Large number of devices
o Each type of devices have many options; Manufacturer, Cabling, Configurations
o Most complex part of the computer
o OS must manage the differences.
Peripherals are physical
o Interact with the real world
o Must fit with the computer system
o USB: type A, B, C, 3, mini, Micro.
Data Rates vary over 8 orders of magnitude
Task Control: Blocking/ non-blocking
Data transfers: Block/ character / clock
Transfer Schedule: Synchronous/ Asynchronous
Data transfer: Serial (farther Parallel)
Control Complexity
o Handled by device hardware
o Data Access: Sequential/ Random/ Direct
o Shareability: Dedicated / Shareable / Virtual
o I/0 direction: Write/ read/ both
o Function
o Error Conditions: unique to each device
Objectives
o Efficiency
▪ I/O operations are usually the bottleneck.
Downloaded by Morris Muthii (
[email protected])
▪ I/O devices are slow compared to CPU.
o Improved abstractions
▪ Handle all devices uniformly. - - -
OS Role
o Manage and Control
▪ I/O Operations, I/O Devices
o Mange
▪ Keep track of what’s available
▪ Keep track of who owns and can use
o Control
▪ Have System calls to do things
History
o Directly controlled by applications, Controllers provided,
o Control of memory bus
o Specialized instruction sets
o Dedicated microprocessors
Categories
o Human Readable
▪ Printers, terminals, video displays, mouse
o Machine Readable
▪ Communication with equipment and remote devices
▪ Disk drives, USB keys, sensors
Interconnections -
Set of wires - - -
Strict protocol
Direct connection to CPU is referred to as back side bus
Examples: PCI bus, IDE Disk Controller, SCSI, Expansion
Daisy Chain -
Peripheral connected to each other; Disk Drivers, USB.
Support Structures -
Registers
o CPU; I/O Address, I/O Buffer
o Device Controller; Command, Buffer -
Memory
o Unique identifier
o Current Owner
o Location of Device Driver
o Location of Control Register
o Location status Register
o Error Vector locations
o Channel or port
o Status
Communication with I/O
Downloaded by Morris Muthii (
[email protected])
- -
Direct through bus
Memory Mapped
System Calls -
I/O is hardware
o It is all protected
o Kernel involvement -
Application program uses API
o User OS uses System call to get to kernel
o API may only be a wrapper
Communication -
Two parts
o Control
▪ Command from CPU to device
▪ Status from device to CPU
o Transfer of data
Methods of I/O Control - -
Memory Mapped
o CPU and device must periodically check memory
Command
o CPU sends command directly to device; could be the DMA
o Device sends interrupt to get attention; CPU retrieves status
o CPU checks device periodically
Methods of I/O data transfer - - -
Polling
o Aka Busy Waiting or programmed I/O
o CPU continually (periodically) checks device
Interrupts
o Peripheral sends a signal when it needs to be serviced
Direct Memory Access (DMA)
o Controller that can directly access Memory
Interrupt Issues - - -
May have priorities
Must identify proper subroutine(handler); through interrupt vector
Can be blocked for critical sections of code
Handling Interrupt Issues -
Multiple IRQ (Interrupt Request Lines) - - -
Post address to access proper Interrupt Vector
For large numbers of devices use chaining
Include priority levels
Buffering -
Accounts for differences of speed between two devices - -
Breaks transfer into smaller pieces
Support copy semantics.
[Show More]