lecture23

Lecture23 - Device Driver Specifics We now consider some of the details of device drivers Each device is adifferent with different purposes

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Device DriverSpecifics We now consider some of the details of device drivers. Each device is adifferent with different pur- poses, different implementations, and different worldviews. W ewill consider a representitive sample of several kinds of device drivers and the specifics of howtheywork. Disk Drives Disk drivers control one or more physical magnetic disks. The most common use of disks is for file systems, but theyare also used for swap space, rawbackups, databases and assorted other uses. The device drivesisresponsible for logical physical translations, multiplexing and demultiplexing data transfers, and for error handling. Block Naming In the simplest case, logical physical mapping is just a matter of placing an ordering on the physi- cal disk sectors that matches the logical disk sectors, which is pretty simple. Differences between logical and physical block sizes can confuse this. The twomay differ because multiple disks managed by the same OS may have different physical block sizes. Also, because the file system overhead may depend strongly on the size of the OS’ slogical blocks, sometimes a logical block size much in excess of the disks sectors is chosen to keep the size of the OS tables small. One example of this is large disks using a FAT file system. The size of the FAT isdirectly dependent on the number of sectors (and is bounded by the size of the entry in a FAT cell). Toaddress a large disk partition may require using large block sizes. Error handling may also interfere with a straightforward logical physical mapping. Some smart disk systems leave a few blocks unassigned on the disk when it is formatted for use when other blocks go bad. Whenabad block is detected, the data is movedfrom the bad block to one of the set-aside blocks and the logical physical mapping changed so that the logical block maps to the set-aside block rather than the bad block. From the OS point of view, this transparently repairs bad blocks. Originally ,such block-shuffling shenanigans were all done in the software, but as disk controllers (and drives) get smarter ,these remappings are often done in the hardware. This can makelife much trick- ier. Multiplexing and Arm Scheduling The first issue in multiplexing multiple requests is doing so efficiently .Efficiently in this case means with returning data to the users as quickly as possible. Most of the latencyinserving a disk request is in seek time, i.e., moving the disk arm overthe proper track. Scheduling the requests to minimize seek time is often handled by the device driver. Scheduling user disk requests is called arm scheduling, because the problem is essentially scheduling accesses by the disk arm. Some familiar algorithms appear
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/28/2008 for the course CS 402 taught by Professor Tedfaber during the Spring '05 term at USC.

Page1 / 4

Lecture23 - Device Driver Specifics We now consider some of the details of device drivers Each device is adifferent with different purposes

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online