Operating System
Operating System
Application Process
API
File Manager
Device Driver
Hardware
Interface
Command Status Data
Device Controller
I/O Hardware
SCSI
Monitor Processor Bus disks
cache
Graphics Bridge/Memory SCSI
Controller Controller memory Controller
PCI Bus
Expansion bus
IDE Disk interface Keyboard
Controller
Controller
Expansion Bus
Parallel Serial
disks Port Port
Device Controllers : An Example
Data
1
System interface
read function
write function
2
3 4 Hardware interface
Data 8
System interface
read function
write function
5 Hardware interface
1
System interface
write
driver
Interrupt Handler
3
2
Hardware interface
System interface
8a
Device status table
Device
read
Handler
driver
7 6
write
driver 8b
Interrupt Handler
5
Hardware interface
Processor
cache
DMA/bus/interrupt x
Controller CPU memory bus memory buffer
PCI Bus
IDE Disk
Controller
disks
Application I/O Interface
Kernel
SCSI
Floppy Disk ATAPI
Devices keyboard mouse …… PCI Bus
Drive Devices
Network Devices
• Sockets are a network interface used by
many operating systems.
• Sockets operations includes:
– creating a socket
– connecting local socket to a remote address
– listening for remote application to connect into
local sockets
– sending and receiving packets
Clocks and Timers
• Computer clocks and timers have 3 basic
operations:
– Giving the current time
– Giving the elapsed time
– Triggering operation X at time T
Buffering
Device Transfer Rates
gigaplan bus
SBUS
SCSI bus
fast ethernet
hard disk
ethernet
laser printer
modem
mouse
keyboard
Logarithmic Scale
Caching
• A cache is a copy of input/output data in
memory that can be accessed more quickly
than what is stored externally.
• Although buffering and caching are distinct
functions, there are cases where the same
area of memory is used for both purposes,
e.g., when reading disk data.
file-system record
process open pointers to:
file table inode
file descriptor read & write functions
ioctl & close function
……
network-
user-process memory socket record info table
pointers to:
network info
read & write functions
select function
ioctl & close function
……
kernel memory
Transforming I/O Requests to Hardware Operations
request I/O user process I/O completed
input data available (if input)
system call yes system call return
kernel I/O
can already transfer data (if appropriate)
satisfy request? subsystem to process,
return completion or error code
no
Performance
• I/O is a major factor in system performance.
• Interrupt handling is computationally
expensive; anything that limits it can
increase system performance.
• Network traffic can seriously affect system
performance
• Some systems use front-end processor to
terminal I/O.