1 / 18

Device Mgmt

Device Mgmt. Device Management Organization. Multiple layers Application Operating System Driver Controller Device Tradeoffs of layering Loss of efficiency Increased generalization and flexibility

pperez
Télécharger la présentation

Device Mgmt

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Device Mgmt

  2. Device Management Organization • Multiple layers • Application • Operating System • Driver • Controller • Device • Tradeoffs of layering • Loss of efficiency • Increased generalization and flexibility • Reduced cost of maintenance and development for all (driver writers, O/S writers, app writers and users)

  3. Device Management Organization-2 read,write read,write read,write Applications API Deviceindependent O/S DeviceDriver DeviceDriver DeviceDriver Devicedependent ControllerFirmware Devices

  4. The API • Simple set of abstract operations • read, write, seek, control • Direct vs Sequential • Disks vs tapes, printers, etc • Block vs Character • Disk vs keyboard • Blocking vs Non-blocking

  5. Handling I/O • Polling • Program loops until device signals completion • No other program can run • CPU runs, but no work gets done! • Interrupt driven • Program starts I/O • Program decides to wait or not • O/S switches to another thread or process

  6. Key concepts • CPU cycles are wasted during a wait • Devices are independent • Multitasking (or threading) is possible • Why not overlap I/O with CPU • Threads can decide when to wait • Non-thread programs can also decide • System throughput is increased

  7. Driver/Kernel Interface • Drivers merged with kernel (sometimes) • Kernel makes function calls to drivers • Kernel functions used by drivers: • Device allocation • Resource (e.g., memory) allocation • Scheduling • Others: depends on O/S

  8. System bottlenecks • Compute bound processes • no devices get started until time-slice used up • Only one process/thread gets service • I/O bound processes • CPU under-utilized • Solution: • "Good" mix of applications • Pre-emptive scheduling (more later)

  9. Overlapped I/O P1 Apps th1 th1 th1 th1 th1 P2 th2 th2 th2 Device t1 t2 t3 t4 t5 t6 t7 t8 t9 Non-Blocking I/O Blocking I/O

  10. Buffering • Provides a means for speed-matching • Many methods • Lists • 1 way, 2 way, circular • Arrays • Fixed size • Variable size • Circular • Problems • Overflow • Protected access • Synchronization – more in another chapter

  11. Example of using buffers Customer Office Water Company Returning the Empties Water Producer Water Consumers Production qty? Delivering Water Consumption qty? Inventory Classic "Producer-Consumer"

  12. Hardware Buffering • In the Device controller • In the Device itself = "double-buffering" • Reduces system overhead from: • Buffer mgmt • Buffer content • Synchronizing

  13. Disk I/O • Goal – minimize access time • Mixed solution: h/w & s/w = (X + Y*K) + latency + transfer • Seek time: head movement delay • for 1 cylinder (X) ≈10 ms (device dependent) • For Y cylinders = Y * K (K is device dependent) • Latency: rotational delay • 5400R/M*1M/60s= 90R/s  .01 s/R = 10ms/R • 7200 R/M*1M/60s=120R/s .008 s/R= 8ms/R • Transfer time: delay between disk and RAM • Bus speed (currently) 400 Mhz or 800 Mhz • Access Time = seek + latency + transfer

  14. Access Algorithms • FCFS • No optimization • SSTF – min seek from current position • Starvation can occur (from local minimization) • Scan/Look • No starvation • Requests may wait a full scan (0-n-0) • Circular Scan/Look • No starvation • Requires fast-reposition to 0

  15. Serial I/O • Must convert • Parallel (bytes) to serial (bit-by-bit) • Digital (1/0) to analog (+/- voltages) • And back again at the other end • Protocol: RS-232

  16. MS-bootable disk layout 0x00-0x02 jump inst to 0x1e 0x03-0x0a PC manufacturer name 0x0b-0x0c sectors/cluster 0x0d-0x0f reserved for boot record 0x10-0x10 # of FAT's 0x11-0x12 # root directory entries 0x13-0x14 # logical sectors 0x15-0x15 media descriptor 0x16-0x17 sectors/FAT 0x18-0x19 sectors/track 0x1a-0x10b # surfaces (heads) 0x1c-0x1d # hidden sectors 0x1e-… boot program

  17. Mainframe Device Mgmt CPU Channel ControllerHardware Devices

  18. Channel programming SIO devaddr Channel Program Seek Search Read/write Channel Address Word Device

More Related