EasyDiff – 一个高效实用的处理器验证框架余子濠 中科院计算所 2019.11.13@深圳 EasyDiff – 一个高效实用的处理器验证框架 随机指令生成 随机指生成是一种有效的处理器
计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.
-
Upload
denis-boone -
Category
Documents
-
view
314 -
download
5
Transcript of 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.
![Page 1: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/1.jpg)
计算机系•信息处理实验室
Lecture 12 I/O System
xlanchen@05/13/2005
![Page 2: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/2.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 2计算机系
信息处理实验室
Contents
I/O System Components
I/O Data Structures
Driver Loading, Initialization, and Installation
I/O Processing
![Page 3: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/3.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 3计算机系
信息处理实验室
I/O System Components
I/O manager
![Page 4: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/4.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 4计算机系
信息处理实验室
The flow of a typical I/O request
![Page 5: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/5.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 5计算机系
信息处理实验室
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
![Page 6: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/6.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 6计算机系
信息处理实验室
Device Drivers
Types
File system drivers
Windows 2000 drivers
Legacy drivers
display drivers
WDM drivers
Bus drivers
Function drivers
Filter drivers
![Page 7: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/7.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 7计算机系
信息处理实验室
user-mode drivers Virtual device drivers (VDDs) Win32 subsystem printer drivers
Driver componentsClass driversPort drivers Miniport drivers
![Page 8: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/8.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 8计算机系
信息处理实验室
Layering of a FSD and a disk driver
![Page 9: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/9.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 9计算机系
信息处理实验室
Adding a layered driver
![Page 10: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/10.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 10计算机系
信息处理实验室
Structure of a Drive
The I/O system drives the execution of device drivers
Primary device driver routines
![Page 11: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/11.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 11计算机系
信息处理实验室
Plug and Play (PnP) Manager
![Page 12: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/12.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 12计算机系
信息处理实验室
Power Manager
Requirement
hardware must comply with ACPI specification
The six system power states
See table 9-2
![Page 13: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/13.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 13计算机系
信息处理实验室
System power-state transitions
Sleeping
waking
![Page 14: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/14.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 14计算机系
信息处理实验室
I/O Data Structures
File Objects Driver Objects and Device Objects I/O Request Packets I/O Completion Ports
![Page 15: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/15.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 15计算机系
信息处理实验室
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
![Page 16: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/16.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 16计算机系
信息处理实验室
Opening a file object
![Page 17: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/17.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 17计算机系
信息处理实验室
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
![Page 18: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/18.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 18计算机系
信息处理实验室
The driver object
![Page 19: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/19.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 19计算机系
信息处理实验室
I/O Request Packets
IRP is where the I/O system stores information it needs to process an I/O request.
![Page 20: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/20.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 20计算机系
信息处理实验室
Data structures involved in a single-layered driver I/O request
![Page 21: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/21.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 21计算机系
信息处理实验室
IRP Stack Locations
IRP
a fixed header
one or more stack locations
IRP Buffer Management
Buffered I/O
Direct I/O
Neither I/O
![Page 22: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/22.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 22计算机系
信息处理实验室
I/O Completion Ports
The IoCompletion ObjectApplications 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.
![Page 23: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/23.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 23计算机系
信息处理实验室
I/O completion port operation
![Page 24: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/24.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 24计算机系
信息处理实验室
Driver Loading, Initialization, and Installation
Explicit loading
Enumeration-based loading
![Page 25: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/25.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 25计算机系
信息处理实验室
The Start Value
boot-start (0)
system-start (1)
auto-start (2)
demand-start (3)
![Page 26: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/26.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 26计算机系
信息处理实验室
Device Enumeration
PnP manager
primary bus driver
device tree
![Page 27: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/27.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 27计算机系
信息处理实验室
Example device tree
![Page 28: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/28.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 28计算机系
信息处理实验室
Devnodes
![Page 29: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/29.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 29计算机系
信息处理实验室
Driver Installation
![Page 30: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/30.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 30计算机系
信息处理实验室
I/O Processing
Types of I/OSynchronous I/O and Asynchronous I/O
Fast I/OMapped File I/O and File CachingScatter/Gather I/O
![Page 31: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/31.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 31计算机系
信息处理实验室
Control flow for an I/O operation
![Page 32: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/32.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 32计算机系
信息处理实验室
I/O Request to a Single-Layered Driver
![Page 33: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/33.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 33计算机系
信息处理实验室
Servicing an Interrupt
Phrase 1
![Page 34: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/34.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 34计算机系
信息处理实验室
Phrase 2
![Page 35: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/35.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 35计算机系
信息处理实验室
Completing an I/O Request
Phrase 1
![Page 36: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/36.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 36计算机系
信息处理实验室
Phrase 2
![Page 37: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/37.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 37计算机系
信息处理实验室
I/O Requests to Layered Drivers
![Page 38: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/38.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 38计算机系
信息处理实验室
Completing a layered I/O request
![Page 39: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/39.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 39计算机系
信息处理实验室
Queuing associated IRPs
![Page 40: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/40.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 40计算机系
信息处理实验室
Completing associated IRPs
![Page 41: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/41.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 41计算机系
信息处理实验室
I/O Completion Port Operation
![Page 42: 计算机系 信息处理实验室 Lecture 12 I/O System xlanchen@05/13/2005.](https://reader033.fdocuments.net/reader033/viewer/2022050703/56649dbf5503460f94ab2dd4/html5/thumbnails/42.jpg)
xlanchen@05/13/2005 Understanding the Inside of Windows 2000 42计算机系
信息处理实验室
Synchronization