摘 要:為使PCI設備具有電源管理功能,需要操作系統和驅動程序的配合來控制設備的電源狀態。通過研究Windows操作系統下系統和設備的電源策略,提出WDM驅動程序中處理系統電源IRP控制設備電源狀態的電源管理方案。說明處理電源管理IRP的工作機制,在基于Windows XP的系統上證明基于這種方案的WDM驅動程序運行穩定。
關鍵詞:電源管理; WDM; PCI; IRP
中圖分類號:TN302.7 文獻標識碼:A
文章編號:1004-373X(2010)14-0196-03
Driver Development of Power Management for PCI Device
CHENG Hai-quan1,2, HU Jun1, XU Shu-yan1, XIE Ai-ping3
(1. Space Optics Research Department, Changchun Institute of Optics, Fine Mechanics and Physics, Chinese Academy of Sciences, Changchun 130033, China;
2. Graduate School, Chinese Academy of Sciences, Beijing 100039, China;
3. College of Communication Engineering, Jilin University, Changchun 130032, China)
Abstract: The cooperation of operating system (OS) and driver is needed to control the power status of equipments for making PCI device to possess the function of power management. By the aid of the study on the power supply of systems and devices under Windows OS, a power management scheme is proposed to control the power status of equipments through processing system power IRP in WDM driver. WDM driver's mechanism of processing the power management IRP is elaborated. An experiment shows that WDM driver based on this scheme can work well with Windows XP.
Keywords: power management; WDM; PCI; IRP
0 引 言
隨著計算機軟硬件技術發展,要求設備能夠從待機或睡眠中快速啟動;要求在不使用時,移動設備能夠保持待機或休眠以節省電能的情況越來越多,傳統的冷啟動或熱啟動(復位啟動)已不能滿足人們的要求。微軟在Windows操作系統下設計了電源管理構架,為系統和設備的電源管理需求提供了廣泛的支持。目前Windows系統下的電源管理支持(advanced configuration and power interface ,ACPI) 高級配置和電源界面工業標準。
根據微軟的WDM驅動程序模型,很容易寫出具有一定功能的驅動程序,可是在設備運行了一段時間后,當系統要進入待機或休眠狀態時,就會發現桌面上彈出一個窗口——禁止待機。出現這種現象是由操作系統的默認電源管理策略所致,實際的原因在于驅動程序中沒有寫關于電源管理的代碼。本文中研究的WDM驅動就是為了使設備配合操作系統支持系統的待機和休眠。
1 系統和設備的電源策略
電源管理主要涉及操作系統和設備,系統電源狀態指示整個系統的總體電源使用,而設備電源狀態指示各個設備使用多少能量。……