Lecture Notes 7:
To do all its tasks, device manager has three conditions to fulfill:
System's devices fall into three categories:
Sequential access media
Magnetic tape was used routinely for secondary storage in early systems - as was paper.(punch cards)
Used still for back-ups on mainframe and some PC backup systems.
Typically 9 track eight bits and one parity. Various tape densities available e.g. 6250 bpi.
Tape needs time to start and stop - need IRG (inter-record gap) 1/2" long. Can take 51/2" inches to store 1" of data. Alternative is blocking. Then have an inter-block gap. Blocking requires special software used when creating the files, but improves tape efficiency.
Typical access times for 2400 foot tape with a speed of 200 inched per second:
21/2 minutes to read last record on tape.
11/2 minutes average access.
Direct Access Devices
Earliest direct access devices were drums. Resembled coffee can covered with magnetic film. Used on mainframes until 1970's. Had capacity of 1Mb and speed of 3000 rpm.
Modern hard drives:
More efficient to fill up outside track of every surface and move inwards than to fill one platter and move to the next.
Concept of cylinder.
System needs to which surface, which cylinder and which allocation unit to read.
Each track has same # of allocation units so they get smaller as you move toward the centre. Accommodated by:
There are fixed head drives where each track has a read head, avoids seek time, faster but expensive.
Optical storage devices
High density, reliable storage. Surface is laid out as one continuous spiral of sectors of equal length that hold equal amounts of data. Data is stored as pits (recessed areas) and lands (raised areas) each representing 0 or 1 respectively. Surface is read by laser beam that distinguishes between pits and lands based on the scattering of the light when it hits the surface. Uses constant linear velocity (CLV) to alter the speed of the disk rotations so that it slows in the middle and speeds up in the centre.
Measures of performance are sustained data transfer rate (for sequential access like viewing a movie) and average access time (random access used for searching an encyclopedia). Look for the biggest value for data transfer rate and smallest number for average access time. Hardware cache size has an effect on perceived performance. Can be a read-ahead device as well as standard buffer.
IO channels (buses) are programmable unit placed between the slower control unit of the device and the faster CPU. They synchronize so that IO operations can overlap with processor operations so the CPU and IO can process concurrently. Channel sends one signal for each function. To begin an IO command, the CPU passes the following to the IO channel:
Many devices can use same channel as in SCSI (small computer system interface). Devices can communicate without going through CPU - e.g. backup device with hard drive.
Each unit in IO system can finish its operation independently of the other. E.g. after a device has begun writing a record and before it is finished, the connection between the device and its controller can be cut and another IO task can be initiated, and the CPU is free to process data while IO is being performed.
Success of all this depends on system's ability to know when a device has completed an operation. Done with hardware flag that is tested by CPU. Flag is 3 bits and is part of Channel Status Word which resides in main memory. Each bit represents one of the components of the IO subsystem, one for each channel, control unit and device. Each bit is changed from one to zero to indicate that the unit has changed from free to busy. Each component has to access the flag before proceeding to the next IO operation to ensure entire path is free. The flag is accessed two ways:
Uses special machine instructions to test flag. For example, CPU periodically tests channel status bit in CSW. If channel is still busy, continues some other processing task; if free channel performs the IO operation. Must decide how often polling will take place - if too much CPU wastes time, if too little, channel could sit idle.
More efficient way to test the flag. Instead of having CPU test, hardware does the test as part of every machine instruction executed by CPU. If the channel is busy, the flag is set so the execution of current sequence is interrupted and control is passed to the interrupt handler. Interrupt handler's job is to determine the best course of action. Finds out which unit sent the signal, start IO operation and return control to interrupted process.
Direct memory access(DMA) is an IO technique that lets control unit access main memory. A device can request a DMA channel. A chip on the systemboard houses the DMS logic. The chip provides channels that a device can use for fact access to memory- done by bypassing CPU. Only certain devices can use DMA (mostly hard drives)
MS-DOS device management
MS-DOS - created for simple systems that include keyboard, monitor, printer, one or two serial ports.
Group of programs permanently stored on a ROM chip - manages the most fundamental communications between software and hardware. Two functions are:
Typical command in CONFIG.SYS might be:
DEVICE=C:\SCANGAL\SCANNER.SYSTells DOS to look in a particular directory named SCANGAL on drive C find the file, copy it into memory. The memory location assigned is written onto the IO table so that requests can be handled and the correct memory location accessed.
The program will handle requests to use the scanner.
When a hardware device needs the CPU to do something, the device passes a number - interrupt request number (IRQ). A device requires an IRQ if it can initiate a request or provide input.
CPU finds what to do using IO address table (interrupt vector table) . This gives the CPU the location of the device driver. The device driver is used by the CPU to interpret the instructions it has received.
UNIX DEVICE MANAGEMENTUNIX is completely device independent.
UNIX OS contains device drivers for most common peripherals. Config program will automatically create a conf.c file for any given hardware configuration. This file contains parameters that control resources.
IO system divided into two
Each physical device is identified by :
Block IO is for printers and communication lines
Character IO is for drives.