Buffering
Buffering
Buffering
ng
System
s:
Internal
s and
Design
Principl
es
Chapter 11
I/O Management
and Disk Scheduling
Seventh Edition
By William Stallings
Operating Systems:
Internals and Design Principles
An artifact can be thought of as a meeting point
an interface in todays terms between an
inner environment, the substance and
organization of the artifact itself, and an
outer environment, the surroundings in
which it operates. If the inner environment is
appropriate to the outer environment, or vice
versa, the artifact will serve its intended
purpose.
THE SCIENCES OF THE ARTIFICIAL,
Herbert Simon
Programmed I/O
Interrupt-driven I/O
Efficiency
Generality
No
Buffer
Single
Buffer
Operating system
assigns a buffer in
main memory for an
I/O request
Disadvantages:
Line-at-a-time operation
Byte-at-a-time operation
used on forms-mode
terminals
when each keystroke is
significant
other peripherals such as
sensors and controllers
Double
Buffer
Circular
Buffer
Disk
Performan
ce
Parameter
s
computer system
operating system
The time it takes for the beginning of the sector to reach the
head is known as rotational delay
The sum of the seek time and the rotational delay equals the
access time
Shortest
Service
Time First
(SSTF)
SCAN
C-SCAN
(Circular SCAN)
During scan, all new requests are put into the other
queue
Redundant Array of
Independent Disks
RAID
Level 0
RAID
Level 1
RAID
Level 2
Effective choice in an
environment in which many disk
errors occur
RAID
Level 3
RAID
Level 4
RAID
Level 5
RAID
Level 6
The block that has been in the cache the longest with no
reference to it is replaced
Frequency-Based
Replacement
Frequency-Based
Replacement
LRU
Disk Cache
Performance
UNIX SVR4
I/O
Buffered
system buffer
caches
character
queues
Unbuffered
Buffer
Cache
Deadlin
e
Schedul
er
Uses three
queues:
incoming
requests
read requests
go to the tail of
a FIFO queue
write requests
go to the tail of
a FIFO queue
Each request has
an expiration time
Benefits:
Window
s I/O
Manager
Cache Manager
Network Drivers
Windows includes
integrated networking
capabilities and support
for remote file systems
the facilities are
implemented as software
drivers
Hardware Device
Drivers
the source code of
Windows device drivers
is portable across
different processor types
Volume Shadow
Copies
implemented by a
software driver that
makes copies of data on
the volume before it is
overwritten
Volume
Encryption
Windows uses
BitLocker to encrypt
entire volumes
allows multiple
interlocking layers of
security
A key aspect of I/O is the use of buffers that are controlled by I/O utilities
rather than by application processes
The use of buffers also decouples the actual I/O transfer from the
address space of the application process
Two of the most widely used approaches are disk scheduling and the disk
cache