Operating System Lecture 2
Operating System Lecture 2
By
Dr Tariq
(Lecture 2)
1
Evolution of Computer Systems
Users
Applications
Database System
Operating System
Hardware
Computer-System Organization
The basic unit of computer storage is the bit. A bit can contain one of two values, 0
and 1. All other storage in a computer is based on collections of bits.
A byte is 8 bits, and on most computers it is the smallest convenient chunk of storage.
A less common term is word, which is a given computer architecture’s native unit of
data. A word is made up of one or more bytes.
Storage Definition (Cont.)
Computer storage, along with most computer throughput, is
generally measured and manipulated in bytes and collections
of bytes.
A kilobyte, or KB, is 1,024 bytes
a megabyte, or MB, is 1,0242 bytes
a gigabyte, or GB, is 1,0243 bytes
a terabyte, or TB, is 1,0244 bytes
a petabyte, or PB, is 1,0245 bytes
exabyte, zettabyte, yottabyte
Storage Hierarchy
Storage systems organized in hierarchy
Speed
Cost
Volatility
Caching – copying information from “slow” storage into faster
storage system;
Main memory can be viewed as a cache for secondary storage
Device Driver for each device controller to manage I/O
Provides uniform interface between controller and kernel
Storage-device hierarchy
I/O Structure
A general-purpose computer system consists of CPUs and multiple
device controllers that are connected through a common bus.
Each device controller is in charge of a specific type of device. More
than one device may be attached. For instance, seven or more
devices can be attached to the small computer-systems interface
(SCSI) controller.
A device controller maintains some local buffer storage and a set of
special-purpose registers.
The device controller is responsible for moving the data between
the peripheral devices that it controls and its local buffer storage.
Typically, operating systems have a device driver for each device
controller. This device driver understands the device controller and
provides the rest of the operating system with a uniform interface
to the device.
Direct Memory Access Structure
Interrupt-driven I/O is fine for moving small amounts of data but can
produce high overhead when used for bulk data movement such as
disk I/O.
To solve this problem, direct memory access (DMA) is used.
After setting up buffers, pointers, and counters for the I/O device, the
device controller transfers an entire block of data directly to or from its
own buffer storage to memory, with no intervention by the CPU.
Only one interrupt is generated per block, to tell the device driver that
the operation has completed. While the device controller s performing
these operations, the CPU is available to accomplish other work.
Some high-end systems use switch rather than bus architecture. On
these systems, multiple components can talk to other components
concurrently, rather than competing for cycles on a shared bus. In
this case, DMA is even more effective. The figure in next slide shows
the interplay of all components of a computer system.
How a Modern Computer Works
A von Neumann architecture and a depiction of the interplay of
all components of a computer system.