Device Management Input/Output Devices



Yüklə 311 Kb.
tarix29.09.2018
ölçüsü311 Kb.
#71109



Device Management



Input/Output Devices



The Device Driver Interface



Device Management Organization



System Call Interface

  • Functions available to application programs

  • Abstract all devices (and files) to a few interfaces

  • Make interfaces as similar as possible

    • Block vs character
    • Sequential vs direct access
  • Device driver implements functions (one entry point per API function)



Example: BSD UNIX Driver



Overlapping the Operation of a Device and the CPU



Overlapping CPU-Controller Operations in a Process



Overlapping Processing and I/O



Polling I/O Read Operation



Interrupt-driven I/O Operation



Device Independent Function Call



Driver-Kernel Interface

  • Drivers are distinct from main part of kernel

  • Kernel makes calls on specific functions, drivers implement them

  • Drivers use kernel functions for:

    • Device allocation
    • Resource (e.g., memory) allocation
    • Scheduling
    • etc. (varies from OS to OS)


Reconfigurable Device Drivers



Handling Interrupts



Handling Interrupts(2)



The Pure Cycle Water Company



Hardware Buffering



Double Buffering in the Driver



Circular Buffering



A Generic Communications Device



Rotating Media



Storage Device



Compute vs I/O Bound



Disk Optimizations

  • Transfer Time: Time to copy bits from disk surface to memory

  • Disk latency time: Rotational delay waiting for proper sector to rotate under R/W head

  • Disk seek time: Delay while R/W head moves to the destination track/cylinder

  • Access Time = seek + latency + transfer



Optimizing Seek Time

  • Multiprogramming on I/O-bound programs => set of processes waiting for disk

  • Seek time dominates access time => minimize seek time across the set

  • Tracks 0:99; Head at track 75, requests for 23, 87, 36, 93, 66

  • FCFS: 52+ 64 + 51 + 57 + 27 = 251 steps



Optimizing Seek Time (cont)

  • Requests = 23, 87, 36, 93, 66

  • SSTF: (75), 66, 87, 93, 36, 23

    • 11 + 21 + 6 + 57 + 13 = 107 steps
  • Scan: (75), 87, 93, 99, 66, 36, 23

    • 12 + 6 + 6 + 33 + 30 + 13 = 100 steps
  • Look: (75), 87, 93, 66, 36, 23

    • 12 + 6 + 27 + 30 + 13 = 87 steps


Optimizing Seek Time (cont)

  • Requests = 23, 87, 36, 93, 66

  • Circular Scan: (75), 87, 93, 99, 23, 36, 66

    • 12 + 6 + 6 + home + 23 + 13 + 30 = 90 + home
  • Circular Look: (75), 87, 93, 23, 36, 66

    • 12 + 6 + home + 23 + 13 + 30 = 84 + home


Serial Port



Serial Port



Adding a Modem



Serial Communication





Data Networks



MS Disk Description



NT Driver Organization



NT Device Drivers

  • API model is the same as for a file

  • Extend device management by adding modules to the stream

  • Device driver is invoked via an Interrupt Request Packet (IRP)

    • IRP can come from another stream module
    • IRP can come from the OS
    • Driver must respond to minimum set of IRPs
  • See Part I of notes



Yüklə 311 Kb.

Dostları ilə paylaş:




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə