430 likes | 558 Views
Lecture 12 I/O System. xlanchen@05/13/2005. Contents. I/O System Components I/O Data Structures Driver Loading, Initialization, and Installation I/O Processing. I/O System Components. I/O manager. The flow of a typical I/O request. I/O Manager.
E N D
Lecture 12 I/O System xlanchen@05/13/2005
Contents • I/O System Components • I/O Data Structures • Driver Loading, Initialization, and Installation • I/O Processing Understanding the Inside of Windows 2000
I/O System Components I/O manager Understanding the Inside of Windows 2000
The flow of a typical I/O request Understanding the Inside of Windows 2000
I/O Manager • The I/O manager defines the orderly framework, or model, within which I/O requests are delivered to device drivers. • Packet driven • I/O request packet (IRP) • Flexible I/O services Understanding the Inside of Windows 2000
Device Drivers • Types • File system drivers • Windows 2000 drivers • Legacy drivers • display drivers • WDM drivers • Bus drivers • Function drivers • Filter drivers Understanding the Inside of Windows 2000
user-mode drivers • Virtual device drivers (VDDs) • Win32 subsystem printer drivers • Driver components • Class drivers • Port drivers • Miniport drivers Understanding the Inside of Windows 2000
Layering of a FSD and a disk driver Understanding the Inside of Windows 2000
Adding a layered driver Understanding the Inside of Windows 2000
Structure of a Drive • The I/O system drives the execution of device drivers • Primary device driver routines Understanding the Inside of Windows 2000
Plug and Play (PnP) Manager Understanding the Inside of Windows 2000
Requirement hardware must comply with ACPI specification The six system power states See table 9-2 Power Manager Understanding the Inside of Windows 2000
System power-state transitions Sleeping waking Understanding the Inside of Windows 2000
I/O Data Structures • File Objects • Driver Objects and Device Objects • I/O Request Packets • I/O Completion Ports Understanding the Inside of Windows 2000
File Objects • File Object Attributes • Filename • Current byte offset • Share modes • Open mode flags • Pointer to device object • Pointer to the volume parameter block (VPB) • Pointer to section object pointers • Pointer to private cache map Understanding the Inside of Windows 2000
Opening a file object Understanding the Inside of Windows 2000
Driver Objects and Device Objects • A driver object represents an individual driver in the system. • A device object represents a physical or logical device on the system and describes its characteristics Understanding the Inside of Windows 2000
The driver object Understanding the Inside of Windows 2000
I/O Request Packets • IRP is where the I/O system stores information it needs to process an I/O request. Understanding the Inside of Windows 2000
Data structures involved in a single-layered driver I/O request Understanding the Inside of Windows 2000
IRP Stack Locations • IRP • a fixed header • one or more stack locations • IRP Buffer Management • Buffered I/O • Direct I/O • Neither I/O Understanding the Inside of Windows 2000
I/O Completion Ports • The IoCompletion Object • Applications use the IoCompletion executive object, which is exported to Win32 as a completion port, as the focal point for the completion of I/O associated with multiple file handles. Understanding the Inside of Windows 2000
I/O completion port operation Understanding the Inside of Windows 2000
Driver Loading, Initialization, and Installation • Explicit loading • Enumeration-based loading Understanding the Inside of Windows 2000
The Start Value • boot-start (0) • system-start (1) • auto-start (2) • demand-start (3) Understanding the Inside of Windows 2000
Device Enumeration • PnP manager • primary bus driver • device tree Understanding the Inside of Windows 2000
Example device tree Understanding the Inside of Windows 2000
Devnodes Understanding the Inside of Windows 2000
Driver Installation Understanding the Inside of Windows 2000
I/O Processing • Types of I/O • Synchronous I/O and Asynchronous I/O • Fast I/O • Mapped File I/O and File Caching • Scatter/Gather I/O Understanding the Inside of Windows 2000
Control flow for an I/O operation Understanding the Inside of Windows 2000
I/O Request to a Single-Layered Driver Understanding the Inside of Windows 2000
Servicing an Interrupt Phrase 1 Understanding the Inside of Windows 2000
Phrase 2 Understanding the Inside of Windows 2000
Completing an I/O Request Phrase 1 Understanding the Inside of Windows 2000
Phrase 2 Understanding the Inside of Windows 2000
I/O Requests to Layered Drivers Understanding the Inside of Windows 2000
Completing a layered I/O request Understanding the Inside of Windows 2000
Queuing associated IRPs Understanding the Inside of Windows 2000
Completing associated IRPs Understanding the Inside of Windows 2000
I/O Completion Port Operation Understanding the Inside of Windows 2000
Synchronization Understanding the Inside of Windows 2000