+ All Categories
Home > Documents > ITFN 2601 Introduction to Operating Systems

ITFN 2601 Introduction to Operating Systems

Date post: 09-Feb-2016
Category:
Upload: topaz
View: 25 times
Download: 2 times
Share this document with a friend
Description:
ITFN 2601 Introduction to Operating Systems. Lecture 19 Input/Output Device Drivers. Agenda. I/O Hardware Memory-Mapped & DMA I/O Software Principles Programmed, Interrupt-based, & DMA I/O Device Drivers Device Independent I/O. I/O Hardware. Block devices - PowerPoint PPT Presentation
Popular Tags:
17
ITFN 2601 Introduction to Operating Systems Lecture 19 Input/Output Device Drivers
Transcript
Page 1: ITFN 2601 Introduction to Operating Systems

ITFN 2601Introduction to Operating

Systems

Lecture 19Input/Output

Device Drivers

Page 2: ITFN 2601 Introduction to Operating Systems

Agenda

I/O HardwareMemory-Mapped & DMA

I/O Software PrinciplesProgrammed, Interrupt-based, & DMA I/ODevice DriversDevice Independent I/O

Page 3: ITFN 2601 Introduction to Operating Systems

I/O Hardware

Block devicesStores info in fixed-size blocksEach independent & has own addressEx. Drives

Character DevicesStream-basedEx. Printers, NICs, & mice

Page 4: ITFN 2601 Introduction to Operating Systems

Various Data Rates

Page 5: ITFN 2601 Introduction to Operating Systems

Device Controllers

Controls the deviceEstablishes a standard (IDE, SCSI, etc.)Sits between the bus & device

Page 6: ITFN 2601 Introduction to Operating Systems

Memory-Mapped I/O

CPU writes to registers on the controllerCPU can also write to data buffer on

controller (ex. video RAM)Memory chunk in main RAM assigned to

corresponding space on controllerWrite to memory chunk : this writes to

controllerMust be able to selectively disable cache!

Page 7: ITFN 2601 Introduction to Operating Systems

“Listening In On” Memory-Mapped I/O

All I/O controllerslisten on main bus

Multi-bus systems requiresnooping or address filtering

Page 8: ITFN 2601 Introduction to Operating Systems

DMA (Direct Memory Access)Without DMA

WithDMA

Page 9: ITFN 2601 Introduction to Operating Systems

I/O Software Principles

Device IndependenceUniform NamingError HandlingSynch vs. Asynch transfersBufferingDedicated vs. Sharable resource/device

Page 10: ITFN 2601 Introduction to Operating Systems

Programmed I/O

Disadvantage – ties up CPU

Page 11: ITFN 2601 Introduction to Operating Systems

Interrupt-Driven I/O

Sending multiple blocks/chunks of data to device

Why not do something while device processes request

Let the device generate an interrupt when request complete – then resume with next block/chunk

Downside – too many interrupts!

Page 12: ITFN 2601 Introduction to Operating Systems

DMA-based I/O

Let DMA handle the I/O transactionReduces need for interrupts

Downsides:DMA controller is slower than CPUCPU might be idle anyway

Page 13: ITFN 2601 Introduction to Operating Systems

Device Drivers

Code that provides an API to controllerAllows OS to access controller’s

registers, memory buffer, etc.Must conform to OS standard for block

or character devices

Page 14: ITFN 2601 Introduction to Operating Systems

Device Driver

Location

Page 15: ITFN 2601 Introduction to Operating Systems

Device Independent I/O

Uniform Interface for DriversOS to communicate w/out “hacking OS”

each time a device is added

Page 16: ITFN 2601 Introduction to Operating Systems

Device Independent I/O

BufferingAllow device to read/write data w/out having

to flood process w/ interrupts

Page 17: ITFN 2601 Introduction to Operating Systems

Recommended