Device Management Announcements



Yüklə 197,5 Kb.
tarix29.09.2018
ölçüsü197,5 Kb.
#71108


Device Management


Announcements

  • Homework Set #1 due Thursday 11 am, see moodle

  • copyright issues with lectures

  • Program Assignment #1 coming soon

  • Read chapters 4 and 5

    • skip sections 4.7, 4.8
    • skip Sections 5.4, 5.5 for now


Determining When I/O is Complete



Control Unit with Interrupt (Hardware)



Examples of Exceptions in Pentium Systems



The Trap Instruction Operation



Examples of Exceptions in Pentium Systems



Maskable Interrupts

  • Maskable interrupts can be turned off by CPU before execution of critical instruction sequences

    • are used by device controllers to talk with CPU
  • Nonmaskable interrupts/exceptions is reserved for events such as unrecoverable memory errors and cannot be turned off by the CPU

  • Can have multiple interrupt priority levels

    • high-priority interrupts can preempt execution of a low-priority interrupt


Disabling Maskable Interrupts



Classes of System Calls Invoked by trap

  • end, abort

  • load, execute

  • create, terminate

  • get attributes, set

  • wait for time

  • wait event, signal event

  • allocate memory, free



The Device Driver Interface



Device Management Organization



Device 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/random access
    • Blocking versus Non-Blocking I/O
      • blocking system call: process put on wait queue until I/O completes
      • non-blocking system call: returns immediately with partial number of bytes transferred, e.g. keyboard, mouse, network sockets
    • Synchronous versus asynchronous
      • asynchronous returns immediately, but at some later time, the full number of bytes requested is transferred
  • Device driver implements functions (one entry point per API function)



Example: BSD UNIX Driver



Device Independent Function Call



Overlapping the Operation of a Device and the CPU



Overlapping CPU-Controller Operations in a Process



Overlapping Processing and I/O



Device Manager I/O Strategies

  • Underneath the blocking/non-blocking synchronous/asynchronous system call API, OS can implement several strategies for I/O with devices

    • direct I/O with polling
    • direct I/O with interrupts
    • DMA with interrupts


Polling I/O Read Operation



Interrupt-driven I/O Operation



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)


DMA with Interrupts Example



Handling Interrupts



Handling Interrupts(2)



Yüklə 197,5 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ə