OS Chapter1 - Introduction
OS Chapter1 - Introduction
Part (3)
Reference:
Operating System Concepts by Author: Silberschatz A.,
Peterson, J. L., & Galvin P. C.,
Chapter 1: Introduction
• Lecture Contents
• Interrupt handling
• Direct Memory Access Structure
• Storage Structure
• Storage Hierarchy
• Storage-Device Hierarchy
Interrupt Handling
• The operating system preserves the state of the CPU by storing registers and the
program counter
• Determines which type of interrupt has occurred:
– polling
– vectored interrupt system
• Separate segments of code determine what action should be taken for each type
of interrupt
I/O Structure
• After I/O starts, control returns to user program only upon I/O
completion
– Wait instruction idles the CPU until the next interrupt
– Wait loop (contention for memory access)
– At most one I/O request is outstanding at a time, no
simultaneous I/O processing
• After I/O starts, control returns to user program without waiting for
I/O completion
– System call – request to the operating system to allow user to
wait for I/O completion
– Device-status table contains entry for each I/O device indicating
its type, address, and state
– Operating system indexes into I/O device table to determine
device status and to modify table entry to include interrupt
Direct Memory Access Structure
• Used for high-speed I/O devices able to transmit information at close to memory
speeds
• Device controller transfers blocks of data from buffer storage directly to main
memory without CPU intervention
• Only one interrupt is generated per block, rather than the one interrupt per byte
How a Modern Computer Works
Storage Structure
• Main memory – only large storage media that the CPU can access directly
• Secondary storage – extension of main memory that provides large nonvolatile
storage capacity
• Magnetic disks – rigid metal or glass platters covered with magnetic recording
material
– Disk surface is logically divided into tracks, which are subdivided into sectors
– The disk controller determines the logical interaction between the device and
the computer
Storage Hierarchy
• Storage systems organized in hierarchy
– Speed
– Cost
– Volatility
• Caching – copying information into faster storage system; main memory can be
viewed as a last cache for secondary storage
Storage-Device Hierarchy
• To be Continued…