IO and Device Management IO Processing DMA Logical Structure of - - PDF document

io and device management
SMART_READER_LITE
LIVE PREVIEW

IO and Device Management IO Processing DMA Logical Structure of - - PDF document

IO and Device Management IO Processing DMA Logical Structure of I/O Functionality Buffering Reading: Silberschatz Chapter 13 I/O Devices graphics keyboard mass storage CPU CPU mouse printer memory memory modem


slide-1
SLIDE 1

IO and Device Management

  • IO Processing
  • DMA
  • Logical Structure of I/O Functionality
  • Buffering
  • Reading: Silberschatz Chapter 13

I/O Devices

CPU CPU modem network mouse printer keyboard mass storage graphics memory memory

slide-2
SLIDE 2

Where is the Control of I/O Functions?

  • Processor directly controls device.
  • Controller or I/O module is added. Processor uses programmed

I/O without interrupts.

  • Same, but with interrupts.
  • The I/O module is given direct control of memory via DMA.
  • I/O module is separate processor, with special instruction set and

access to memory to execute I/O program. No CPU intervention.

  • I/O module has local memory of its own. Can control several I/O

devices.

  • Intelligent I/O (I2O) see http://www.I2Osig.org
  • Data-near computation: portions of applications are migrated to

I/O controllers.

  • TAMU-PANIC (Protocols Aboard Network Interface Cards)

project: portions of application run in network interface cards.

Direct Memory Access (DMA)

  • The DMA logic moves data from
  • r to memory without processor

intervention.

  • Typical I/O operation involving

DMA:

  • 1. CPU sends DMA request with:
  • direction of transfer (read or write)
  • n control control line
  • address of I/O device, on data lines
  • starting location in memory, on data

lines, in address register

  • number of words to transfer, on data

lines, in data count register

  • 2. CPU continues with other work, while

DMA transfers block of data.

  • 3. When transfer is complete, DMA

interrupts the CPU.

data count data register address register control logic

DMA req DMA ack interrupt read write address lines data lines

DMA Block Diagram

slide-3
SLIDE 3

Logical Structure of I/O Subsystem: File System

Application program directory management (logical file system) file system physical organization Device I/O scheduling and control

user interface

  • directory service
  • create, delete files
  • translates logical block numbers to

physical block addresses

  • free space manager
  • open-file table management
  • open, close files
  • access rights

hardware

  • operations on buffers
  • hardware access

IO System Components (Windows 2k)

user mode kernel mode HAL WDM WMI routines PnP manager Power manager I/O manager I/O system drivers

...

setup components

user-mode PnP manager WMI service Applications Win32 services

.inf files .cat files registry

slide-4
SLIDE 4

Device Driver Layering Device Driver Layering (2)

slide-5
SLIDE 5

dispatch routines dispatch routines

Primary Device Driver Routines

IO system IO system interrupt service routine interrupt service routine DPC routine DPC routine initialization routine initialization routine add-device routine add-device routine dispatch routines dispatch routines dispatch routines dispatch routines start I/O routine start I/O routine

Control Flow for an IO Operation

Call ReadFile() Call ReadFile() Call NTReadFile() return to caller Call NTReadFile() return to caller INT 2E return to caller INT 2E return to caller Call NTReadFile() dismiss interrupt Call NTReadFile() dismiss interrupt Invoke driver dismiss interrupt Invoke driver dismiss interrupt Initiate I/O operation dismiss interrupt Initiate I/O operation dismiss interrupt

User mode Kernel mode Whether to wait depends

  • n overlapped flag

ReadFile NtReadFile KiSystemService NtReadFile Application Kernel32.dll Ntdll.dll Ntoskrnl.exe Ntoskrnl.exe Driver.sys

slide-6
SLIDE 6

Queueing and Completing a Synchronous Request Servicing a Device Interrupt (only Phase I)

slide-7
SLIDE 7

Servicing a Device Interrupt (Phase II) Completing an I/O Request (Phase I)

slide-8
SLIDE 8

Completing an I/O Request (Phase II) Buffering

  • perating system

user process no buffering single buffering double buffering circular buffering