Download presentation
Presentation is loading. Please wait.
1
Device Management Part 1: I/O System
2
Functions of Device Management
Device management involves four basic functions: Track status of each device (such as disk drives, printers, plotters, and terminals). Use preset policies to determine which process will get a device and for how long. Allocate the devices. Deallocate the devices at 2 levels: At process level when I/O command has been executed & device is temporarily released At job level when job is finished & device is permanently released.
3
Types of devices The system’s peripheral devices generally fall into one of three categories: Dedicated Shared Virtual
4
Dedicated devices Are assigned to only one job at a time.
They serve that job for the entire time the job is active or until it releases them. Some devices demand this kind of allocation scheme, because it would be awkward to let several users share them. Example: printers, and plotters Disadvantage: They must be allocated to a single user for the duration of a job’s execution, which can be quite inefficient, even though the device is not used 100% of the time.
5
Shared devices Can be assigned to several processes.
For example – a disk can be shared by several processes at the same time by interleaving their requests. This interleaving* must be carefully controlled by the Device Manager All conflicts must be resolved based on predetermined policies. * interleaving is a way to arrange memory in a non-contiguous way to increase performance
6
Virtual devices A combination of the first two types.
They’re dedicated devices that have been transformed into shared devices. Example: printer Converted into a shareable device through a spooling program that reroutes all print requests to a disk. Only when all of a job’s output is complete, and the printer is ready to print out the entire document, is the output sent to the printer for printing. Because disks are shareable devices, this technique can convert one printer into several virtual printers, thus improving both its performance and use.
7
Components of the I/O subsystem
The pieces of the I/O subsystem all have to work harmoniously and it works in a manner similar to the mythical “McHoes and Flynn Taxicab Company” shown in Figure 1. Many requests come in from all over the city to the taxi company dispatcher. It’s the dispatcher’s job to handle the incoming calls as fast as they arrive and to find out who needs transportation, where they are, where they are going and when. The dispatcher then organizes calls into an order that will use the company’s resources as efficiently as possible. It’s not easy as the company has several drivers and a variety of vehicles at its disposal: ordinary taxicabs, station wagons, vans and a minibus. Once the order is set, the dispatcher calls the drivers who ideally jump into the appropriate vehicles, pick up the waiting passengers and deliver them quickly to their respective destinations.
8
Components of the I/O subsystem
Cab Driver Station wagon Van Driver Cab Phone calls Driver Van Dispatcher Cab Driver Minibus Station wagon Figure 1. The mythical “McHoes and Flynn Taxicab Company” Driver Cab
9
Figure 2. Components of the I/O Subsystem
Disk 1 Disk 2 Disk 3 Control Unit 1 Channel 1 Control Unit 2 Tape 1 Tape 2 Tape 3 Tape 4 CPU Control Unit 3 Channel 2 Control Unit 4 Disk 4 Disk 5 Figure 2. Components of the I/O Subsystem
10
I/O Subsystem : I/O Channel
I/O Channel -- keeps up with I/O requests from CPU and pass them down the line to appropriate control unit. Programmable units placed between CPU and control unit. Synchronize fast speed of CPU with slow speed of the I/O device. Make it possible to overlap I/O operations with processor operations so the CPU and I/O can process concurrently. Use channel programs that specifies action to be performed by devices & controls transmission of data between main memory & control units. Entire path must be available when an I/O command is initiated.
11
I/O Subsystem : I/O Control Unit
I/O control unit interprets signal sent by channel. One signal for each function. At start of I/O command, info passed from CPU to channel: I/O command (READ, WRITE, REWIND, etc.) Channel number Address of physical record to be transferred (from or to secondary storage) Starting address of a memory buffer from which or into which record is to be transferred
12
Device Manager Must Know which components are busy and which are free.
Be able to accommodate requests that come in during heavy I/O traffic. Accommodate disparity of speeds between CPU and I/O devices. Solved by structuring interaction between units Handled by “buffering” records & queueing requests
13
Communication Among Devices
Each unit in I/O subsystem can finish its operation independently from others. CPU is free to process data while I/O is being performed, which allows for concurrent processing and I/O. Success of operation depends on system’s ability to know when device has completed operation. Uses a hardware flag that must be tested by CPU. *flag refer to one or more bits that are used to store a binary value or code that has an assigned meaning
14
Management of I/O Requests
Device Manager divides task into 3 parts, with each handled by specific software component of I/O subsystem: I/O traffic controller watches status of all devices, control units, and channels. I/O scheduler implements policies that determine allocation of, and access to, devices, control units, and channels. I/O device handler performs actual transfer of data and processes the device interrupts.
15
Device Management Part 2: File Management
16
Overview File Manager controls every file in the system.
The efficiency of the File Manager depends on how the system’s files are organized, how they are stored, how each file’s records are structured and how access to these files is controlled. Responsibilites of File Manager: Keep track of where each file is stored Use a policy that will determine where and how the files are stored Allocate each file when a user has been cleared for access to it and record its use Deallocate the file when the file is to be returned to storage and communicate its availability to others who may be waiting for it.
17
Interacting With File Manager
Users communicates with File Manager via specific commands that may be either embedded in user’s program or submitted interactively by user. Embedded commands: OPEN & CLOSE pertain to availability of file for program invoking it. READ & WRITE are I/O commands. MODIFY – specialized WRITE command for existing data files that allows for appending/rewriting records.
18
File Operations Create Delete Open Close Read Write
19
Volume Descriptor Creation Date Date when volume was created
Date when volume was created Pointer to Directory Area Indicates first sector where directory is stored Pointer to File Area Indicates first sector where file is stored File System Code Used to detect volumes with incorrect formats Volume News User-allocated name
20
Criteria for File Organization
Short access time Needed when accessing a single record Not needed for batch mode Ease of update File on CD-ROM will not be updated, so this is not a concern Economy of storage Should be minimum redundancy in the data Redundancy can be used to speed access such as an index Simple maintenance Reliability
21
File Organization : Record Format
When we discuss file organization, we are talking about the arrangement of records within a file because all files are composed of records. Within each file, the records are presumed to have the same format – they can be fixed length or variable length. Fixed-length records – easiest to access directly. Most common type & ideal for data files. Variable-length records -- difficult to access directly because hard to calculate exactly where record is located.
22
Physical Storage Allocation
File Manager must work with files not just as whole units but also as logical units or records. Records within file must have same format but can vary in length. Records are subdivided into fields. Structure usually managed by application programs, not OS. When we talk about file storage, we’re actually referring to record storage .
23
Contiguous Storage Records stored one after other.
Any record can be found & read once starting address & size are known, so directory is very streamlined. Direct access easy – every part of file is stored in same compact area. Files can’t be expanded unless there’s empty space available immediately following it. Room for expansion must be provided when file is created. Fragmentation occurs (slivers of unused storage space). Can compact & rearrange files. Files can’t be accessed while compaction is taking place.
24
Non-Contiguous Storage
Allows files to use any storage space available on disk. File’s records are stored in a contiguous manner if enough empty space. Any remaining records, & all other additions to file, are stored in other sections of disk (extents). Linked together with pointers. Physical size of each extent is determined by OS (e.g., 256 bytes).
25
Indexed Storage Allows direct record access by bringing pointers linking every extent of that file into index block. Every file has its own index block (addresses of each disk sector that make up the file) Lists each entry in same order in which sectors linked . When a file is created, pointers in index block set to null. As each sector is filled, pointer set to appropriate sector address. Address is removed from empty space list & copied into its position in index block.
26
Access Methods Access methods dictated by a file’s organization
Most flexibility is allowed with indexed sequential files and least with sequential. File organized in sequential fashion can support only sequential access to its records, and these records can be of fixed or variable length. File Manager uses the address of last byte read to access the next sequential record. Current byte address (CBA) must be updated every time a record is accessed.
27
File Access Control Methods
Each file management system has own file access control method. Access control matrix Access control lists Capability lists Lockword control. Most Common Methods
28
Access Control Matrix Easy to implement.
Works well only for systems with few files & few users. In matrix each column identifies a user & each row identifies a file. Intersection of row & column has access rights for that user to that file.
29
Access Control Lists Modification of access control matrix technique.
Each file is entered in list & contains names of users allowed to access it & type of access permitted. To shorten list, only those who may use file are named; those denied any access are grouped under global heading such as WORLD. Or shorten by putting every user into a category: SYSTEM – system personnel with unlimited access to all files. OWNER – absolute control over all files created in own account. GROUP – all users belonging to appropriate group have access. WORLD – all other users in system; default access types given by File Manager.
30
Access Control List Example
31
Capability Lists Lists every user and files to which each has access.
Requires less storage space than an access control matrix. Easier to maintain than an access control list when users are added or deleted from system.
32
Lockword Control Lockword is similar to a password but protects a single file. When file created, owner protects it via lockword Stored in directory but isn’t revealed with directory listing. User must provide correct lockword to access protected file. Require smallest amount of storage for file protection. Can be guessed by hackers or passed on to unauthorized users. Generally doesn’t control type of access to file. Anyone who knows lockword can read, write, execute, or delete file.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.