Device Management Part 1: I/O System.

Slides:



Advertisements
Similar presentations
Device Management Part 1: I/O System.
Advertisements

Processes Management.
File Management Chapter 12. File Management File management system is considered part of the operating system Input to applications is by means of a file.
File Management Chapter 12. File Management A file is a named entity used to save results from a program or provide data to a program. Access control.
1 File Management (a). 2 File-System Interface  File Concept  Access Methods  Directory Structure  File System Mounting  File Sharing  Protection.
Chapter 11 Operating Systems
©Brooks/Cole, 2003 Chapter 7 Operating Systems Dr. Barnawi.
Computer Organization and Architecture
Chapter 8 File Management
File Management Chapter 12. File Management File management system is considered part of the operating system Input to applications is by means of a file.
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
Chapter 5 Operating System Support. Outline Operating system - Objective and function - types of OS Scheduling - Long term scheduling - Medium term scheduling.
Chapter 7 Device Management
Understanding Operating Systems Fifth Edition Chapter 8 File Management.
Chapter 8 File Management Understanding Operating Systems, Fourth Edition.
6 Memory Management and Processor Management Management of Resources Measure of Effectiveness – On most modern computers, the operating system serves.
Understanding Operating Systems Seventh Edition Chapter 8 File Management.
11.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles 11.5 Free-Space Management Bit vector (n blocks) … 012n-1 bit[i] =  1  block[i]
Introduction to Operating Systems Concepts
Memory Management.
Module 12: I/O Systems I/O hardware Application I/O Interface
Processes and threads.
Operating System Review
Chapter 2 Memory and process management
2. OPERATING SYSTEM 2.1 Operating System Function
Understanding Operating Systems Seventh Edition
Chapter 11: File System Implementation
Chapter 12 File Management
I/O System Chapter 5 Designed by .VAS.
Chapter 2: System Structures
Chapter 11: File System Implementation
William Stallings Computer Organization and Architecture
Operating System Structure
Operating System I/O System Monday, August 11, 2008.
Intro to Processes CSSE 332 Operating Systems
Main Memory Management
OPERATING SYSTEM OVERVIEW
Operating System Review
Device Management Damian Gordon.
Chapter 11: File System Implementation
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
Chapter 11: File System Implementation
Computer Architecture
Module 2: Computer-System Structures
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 12/1/2018.
Main Memory Background Swapping Contiguous Allocation Paging
Operating System Concepts
Overview Continuation from Monday (File system implementation)
Operating Systems.
Operating System Review
Chapter 8: Memory management
Outline Module 1 and 2 dealt with processes, scheduling and synchronization Next two modules will deal with memory and storage Processes require data to.
Secondary Storage Management Brian Bershad
Chapter 2: Operating-System Structures
Module 2: Computer-System Structures
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
Secondary Storage Management Hank Levy
Chapter 11: File System Implementation
Software - Operating Systems
Module 2: Computer-System Structures
Chapter 2: Operating-System Structures
Department of Computer Science
Module 2: Computer-System Structures
Lecture Topics: 11/20 HW 7 What happens on a memory reference Traps
Mr. M. D. Jamadar Assistant Professor
Chapter 5 File Systems -Compiled for MCA, PU
Module 12: I/O Systems I/O hardwared Application I/O Interface
Presentation transcript:

Device Management Part 1: I/O System

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.

Types of devices The system’s peripheral devices generally fall into one of three categories: Dedicated Shared Virtual

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.

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

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.

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.

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

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

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.

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

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

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

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.

Device Management Part 2: File Management

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.

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.

File Operations Create Delete Open Close Read Write

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

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

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.

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 .

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.

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).

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.

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.

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

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.

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.

Access Control List Example

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.

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.