Professional Documents
Culture Documents
Part One
I/O Hardware Management
Objective of this chapter (Input/output HW)
I/O Hardware:Objectives
Principal of I/O Hardware
Polling
I/O Devices
Device Controllers
Direct Memory Access
Summary
5. Data representation: Different data encoding schemes are used for different
devices.
Direct Memory Access (DMA)
Many computers avoid burdening the main CPU with programmed I/O by offloading some
of this work to a special purpose processor.
This type of processor is called, a Direct Memory Access (DMA) controller.
A special control unit is used to transfer block of data directly between an external device and the
main memory, without intervention by the processor. This approach is called Direct Memory
Access (DMA).
DMA can be used with either polling or interrupt software.
DMA is particularly useful on devices like disks, where many bytes of information can be transferred in
single I/O operations.
When DMA is used with an interrupt, the CPU is notified only after the entire block of data has
been transferred. For each byte or word transferred, it must provide the memory address and all
the bus signals controlling the data transfer. Interaction with a device controller is managed
Cond.
e sses
ya cc MA
or f D
mem e nc eo
irec t
n se qu
of D ti o
ra c
ervi ew
i g Inte
O v F
Fi g
Cond.
f DMA
e nc eo
sequ
r a c tion
i g I nte
F
Part Two
I/O Software Management
Objective of this chapter (I/O Software)
Objectives
Principle of I/O Software
Interrupts
Application I/O Interfaced
I/O Software: Clocks and Timers
Blocking and Non-blocking I/O
Kernel I/O Subsystem
Scheduling
Buffering
Caching
Spooling and Device Reservation
Error Handling
Device Drivers
Application I/O Interface represents the structuring techniques and interfaces for
the operating system to enable I/O devices to be treated in a standard, uniform
way.
The actual differences lies kernel level modules called device drivers which are custom
tailored to corresponding devices but show one of the standard interfaces to applications.
The purpose of the device-driver layer is to hide the differences among device
controllers from the I/O subsystem of the kernel, such as the I/O system calls.
The I/O scheduler rearranges the order of the queue to improve the overall
system efficiency and the average response time experienced by applications.
Buffering (Kernel I/O Subsystem)
A buffer is a memory area that stores data while they are transferred between
two devices or between a device arid an application.
Buffering is done for three reasons.
1. One reason is to cope with a speed mismatch between the producer and consumer of a
data stream.
2. Second use of buffering is to adapt between devices that have different data
Caching (Kernel
transfer sizes.I/O Subsystem)
3. A third use of buffering is to support copy semantics for application I/O.
They usually provide the interrupt handling required for any necessary asynchronous
Summary
The system call interface provided to applications is designed to handle several
basic categories of hardware, including block devices, character devices, memory
mapped files, network sockets, and programmed interval timers. The system calls
usually block the processes that issue them, but non blocking and asynchronous
calls are used by the kernel itself and by applications that must not sleep while
waiting for an I/O operation to complete.
The kernel‘s I/O subsystem provides numerous services. Among these are I/O
scheduling, buffering, caching. Spooling, device reservation, and error handling.
I/O system calls are costly in terms of CPU consumption because of the many
layers of software between a physical device and an application.
Chapter Six
I/O Device Management
Part Three
SECONDARY STORAGE Management
Objective of this chapter (2nd Storage management)
SECONDARY STORAGE MANAGEMENT :
Objectives
Disk Structure
Disk Scheduling
Disk Management
Swap Space Management
Disk Reliability
Stable Storage Implementation
At the end of this session students will be able to understand:
The physical structure of secondary and tertiary storage devices and
the
resulting effects on the uses of the devices.
The performance characteristics of mass-storage devices.
Operating-system services provided for mass storage.
Reading assignment
Chapter Seven
File System Management
Objectives
File Concept
File Support
Access Methods
File system: Directory Systems
File Protection
Free Space Management
Summary
Objective of this chapter (File System)
At the end of this session students will be able:
File management system is that set of system software that provides services to users and
applications in the use of files. following objectives for a file management system:
To meet the data management needs and requirements of the user which include storage
of data and the ability to perform the aforementioned operations.
To guarantee, to the extent possible, that the data in the file are valid.
To optimize performance, both from the system point of view in terms of overall
throughput.
To provide I/O support for a variety of storage device types.
To minimize or eliminate the potential for lost or destroyed data.
File Access Mechanisms
File access mechanism refers to the manner in which the records of a file may be accessed . There are several ways
to access files:
Sequential access: is that in which the records are accessed in some sequence i.e. the information in
the file is processed in order, one record after the other.
This access method is the most primitive one. Example: Compilers usually access files in this
fashion.
Direct/Random access: provides, accessing the records directly.
Each record has its own address on the file with by the help of which it can be directly accessed for
reading or writing.
The records need not be in any sequence within the file and they need not be in adjacent locations
on the storage medium.
Indexed Allocation: Provides solutions to problems of contiguous and linked allocation.
A index block is created having all pointers to files.
Space Allocation
Files are allocated disk spaces by operating system. Operating systems deploy following
three main ways to allocate disk space to files.
Contiguous Allocation
Linked Allocation
Indexed Allocation
Contiguous Allocation
Each file occupies a contiguous address space on disk.
Assigned disk address is in linear order.
Easy to implement.
External fragmentation is a major issue with this type of allocation technique.
Cond.
Linked Allocation:
Each file carries a list of links to disk blocks.
Directory contains link / pointer to first block of a file.
No external fragmentation
Effectively used in sequential access file.
Inefficient in case of direct access file.
Indexed Allocation:
Provides solutions to problems of contiguous and linked allocation.
A index block is created having all pointers to files.
Each file has its own index block which stores the addresses of disk space occupied by the
file.
Thank you!