windows driver response Power Event

这篇博客记录了一次Windows内核调试的过程,包括连接到Windows 7 19041版本的目标系统,初始化Kernel Debugger,处理设备驱动的启动、电源管理和系统状态变化。在调试过程中,提到了设备驱动的加载失败、设备关系查询以及系统从工作状态到休眠、重启和关闭的转换。此外,还涉及到驱动对系统电源状态的响应,如PowerSystemWorking和PowerSystemShutdown。

#S5->S0
Waiting to reconnect...
USB2: Write opened
Connected to Windows 7 19041 x64 target at (Sun Jun  6 13:33:03.551 2021 (UTC + 8:00)), ptr64 TRUE
Kernel Debugger connection established.  (Initial Breakpoint requested)
Symbol search path is: srv*C:\Symbols*http://msdl.microsoft.com/download/symbols;E:\symbols\win10X6420H2
Executable search path is: 
Windows 7 Kernel Version 19041 MP (1 procs) Free x64
Built by: 19041.1.amd64fre.vb_release.191206-1406
Machine Name:
Kernel base = 0xfffff807`23a00000 PsLoadedModuleList = 0xfffff807`2462a2b0
System Uptime: 0 days 0:00:00.203
minio\security\base\lsa\security\driver\asyncsspi.cxx - SspiInitAsyncInterface
IOINIT: Built-in driver \Driver\hwpolicy failed to initialize with status - 0xC000025E
KDTARGET: Refreshing KD connection
ImagePath = \
>> DeviceControlLayer::FwStorageAccessor::worker(179): FW reading worker has started
<< DeviceControlLayer::FwStorageAccessor::worker(244): FW reading worker has finished
BusEnum.SYS: Driver Entry 
BusEnum.SYS: Add Device: 0xFFFFCA0FDD321DA0
BusEnum.SYS: AddDevice: FFFFCA0FDF6515D0 to FFFFCA0FDD321DA0->FFFFCA0FDD321DA0 (\Device\00000011) 
BusEnum.SYS: FDO IRP_MN_QUERY_LEGACY_BUS_INFORMATION IRP:0xFFFFCA0FDD681060
BusEnum.SYS: FDO IRP_MN_FILTER_RESOURCE_REQUIREMENTS IRP:0xFFFFCA0FDD681060
BusEnum.SYS: FDO IRP_MN_START_DEVICE IRP:0xFFFFCA0FDD69C420
BusEnum.SYS: FDO IRP_MN_QUERY_ID IRP:0xFFFFCA0FDD69C420
BusEnum.SYS: FDO IRP_MN_QUERY_ID IRP:0xFFFFCA0FDD69C420
BusEnum.SYS: FDO IRP_MN_QUERY_CAPABILITIES IRP:0xFFFFCA0FDD69C420
BusEnum.SYS: FDO IRP_MN_QUERY_PNP_DEVICE_STATE IRP:0xFFFFCA0FDD69C420
BusEnum.SYS: FDO IRP_MN_QUERY_DEVICE_RELATIONS IRP:0xFFFFCA0FDD69C420
    QueryDeviceRelation Type: BusRelations
    #PDOS present = 0
    #PDOs reported = 0
BusEnum.SYS: FDO: unknown_syscontrol_irp
===========================================================================================================================================
#S0->S3
0: kd> g
[Router Dll]: >> Dot11ExtIhvProcessSessionChange[Router Dll]: no security plugin was loaded[Router Dll]: << RC for Dot11ExtIhvProcessSessionChange - 55CIntelCpLSPCONSvcModule::OnPowerEvent() 0x4 instance already created 000001BD57545F70 
BusEnum.SYS: FDO IRP_MN_QUERY_POWER IRP:0xFFFFCA0FEE69CA20 PowerSystemWorking PowerDeviceD0
HAL: Wake in 4294967295 seconds on AC and in 4294967295 seconds on DC
BusEnum.SYS: FDO IRP_MN_SET_POWER IRP:0xFFFFCA0FEE17BA20 PowerSystemWorking PowerDeviceD0
    Request to set System state to PowerSystemSleeping3

<Return>    

#S3->S0    
===========================================================================================================================================
#S0->S4
2: kd> g
BusEnum.SYS: FDO IRP_MN_QUERY_POWER IRP:0xFFFFCA0FEE688D30 PowerSystemWorking PowerDeviceD0
HAL: Wake in 4294967295 seconds on AC and in 4294967295 seconds on DC
BusEnum.SYS: FDO IRP_MN_SET_POWER IRP:0xFFFFCA0FEC9457A0 PowerSystemWorking PowerDeviceD0
    Request to set System state to PowerSystemHibernate
Hibernate occurred
WARNING: Inaccessible path: 'C:\Users\burly\Documents\Visual Studio 2010\Projects'
Waiting to reconnect...

<Return>

#S4->S0
2: kd> g
USB2: Write opened
Connected to Windows 7 19041 x64 target at (Sun Jun  6 13:46:58.697 2021 (UTC + 8:00)), ptr64 TRUE
Kernel Debugger connection established.  (Initial Breakpoint requested)
Symbol search path is: srv*C:\Symbols*http://msdl.microsoft.com/download/symbols;E:\symbols\win10X6420H2
Executable search path is: 
Windows 7 Kernel Version 19041 MP (4 procs) Free x64
Product: WinNt, suite: TerminalServer SingleUserTS
Built by: 19041.1.amd64fre.vb_release.191206-1406
Machine Name:
Kernel base = 0xfffff807`23a00000 PsLoadedModuleList = 0xfffff807`2462a2b0
Debug session time: Fri Feb 19 10:06:59.773 2021 (UTC + 8:00)
System Uptime: 0 days 0:09:47.287
BusEnum.SYS: FDO IRP_MN_SET_POWER IRP:0xFFFFCA0FEE8BD010 PowerSystemWorking PowerDeviceD0
    Request to set System state to PowerSystemWorking
HAL: Wake in 4294967295 seconds on AC and in 4294967295 seconds on DC
===========================================================================================================================================
#S0->Restart
2: kd> g

BusEnum.SYS: FDO IRP_MN_SET_POWER IRP:0xFFFFCA0FED844C80 PowerSystemWorking PowerDeviceD0
    Request to set System state to PowerSystemShutdown
Shutdown occurred at (Sun Jun  6 13:53:17.444 2021 (UTC + 8:00))...unloading all symbol tables.
WARNING: Inaccessible path: 'C:\Users\burly\Documents\Visual Studio 2010\Projects'
Waiting to reconnect...

<Return>

Connected to Windows 7 19041 x64 target at (Sun Jun  6 13:54:56.624 2021 (UTC + 8:00)), ptr64 TRUE
Kernel Debugger connection established.  (Initial Breakpoint requested)
Symbol search path is: srv*C:\Symbols*http://msdl.microsoft.com/download/symbols;E:\symbols\win10X6420H2
Executable search path is: 
Windows 7 Kernel Version 19041 MP (1 procs) Free x64
Built by: 19041.1.amd64fre.vb_release.191206-1406
Machine Name:
Kernel base = 0xfffff806`76e00000 PsLoadedModuleList = 0xfffff806`77a2a2b0
System Uptime: 0 days 0:00:00.195
BusEnum.SYS: Driver Entry 
BusEnum.SYS: Add Device: 0xFFFFB208468CCD70
BusEnum.SYS: AddDevice: FFFFB20848CC6260 to FFFFB208468CCD70->FFFFB208468CCD70 (\Device\00000011) 
BusEnum.SYS: FDO IRP_MN_QUERY_LEGACY_BUS_INFORMATION IRP:0xFFFFB20846A8A520
BusEnum.SYS: FDO IRP_MN_FILTER_RESOURCE_REQUIREMENTS IRP:0xFFFFB20846A8A520
Thotkey LEDSTATE = 0x00000001
BusEnum.SYS: FDO IRP_MN_START_DEVICE IRP:0xFFFFB20846AAC020
BusEnum.SYS: FDO IRP_MN_QUERY_ID IRP:0xFFFFB20846AAC020
BusEnum.SYS: FDO IRP_MN_QUERY_ID IRP:0xFFFFB20846AAC020
BusEnum.SYS: FDO IRP_MN_QUERY_CAPABILITIES IRP:0xFFFFB20846AAC020
BusEnum.SYS: FDO IRP_MN_QUERY_PNP_DEVICE_STATE IRP:0xFFFFB20846AAC020
BusEnum.SYS: FDO IRP_MN_QUERY_DEVICE_RELATIONS IRP:0xFFFFB20846AAC020
    QueryDeviceRelation Type: BusRelations
    #PDOS present = 0
    #PDOs reported = 0
BusEnum.SYS: FDO: unknown_syscontrol_irp
===========================================================================================================================================
#S0->S5
3: kd> g
BusEnum.SYS: FDO IRP_MN_SET_POWER IRP:0xFFFFB20856502B00 PowerSystemWorking PowerDeviceD0
    Request to set System state to PowerSystemShutdown
Shutdown occurred at (Sun Jun  6 14:02:19.871 2021 (UTC + 8:00))...unloading all symbol tables.
WARNING: Inaccessible path: 'C:\Users\burly\Documents\Visual Studio 2010\Projects'
Waiting to reconnect...

<Return>

USB2: Write opened
Connected to Windows 7 19041 x64 target at (Sun Jun  6 14:04:25.611 2021 (UTC + 8:00)), ptr64 TRUE
Kernel Debugger connection established.  (Initial Breakpoint requested)
Symbol search path is: srv*C:\Symbols*http://msdl.microsoft.com/download/symbols;E:\symbols\win10X6420H2
Executable search path is: 
Windows 7 Kernel Version 19041 MP (1 procs) Free x64
Built by: 19041.1.amd64fre.vb_release.191206-1406
Machine Name:
Kernel base = 0xfffff806`72c00000 PsLoadedModuleList = 0xfffff806`7382a2b0
System Uptime: 0 days 0:00:00.194
IOINIT: Built-in driver \Driver\hwpolicy failed to initialize with status - 0xC000025E
KDTARGET: Refreshing KD connection
ImagePath = \
BusEnum.SYS: Driver Entry 
BusEnum.SYS: Add Device: 0xFFFFC30BFB4CBD70
BusEnum.SYS: AddDevice: FFFFC30BFD5CECD0 to FFFFC30BFB4CBD70->FFFFC30BFB4CBD70 (\Device\00000011) 
BusEnum.SYS: FDO IRP_MN_QUERY_LEGACY_BUS_INFORMATION IRP:0xFFFFC30BFB691CE0
BusEnum.SYS: FDO IRP_MN_FILTER_RESOURCE_REQUIREMENTS IRP:0xFFFFC30BFB691CE0
BusEnum.SYS: FDO IRP_MN_START_DEVICE IRP:0xFFFFC30BFB6AC0E0
BusEnum.SYS: FDO IRP_MN_QUERY_ID IRP:0xFFFFC30BFB6AC0E0
BusEnum.SYS: FDO IRP_MN_QUERY_ID IRP:0xFFFFC30BFB6AC0E0
BusEnum.SYS: FDO IRP_MN_QUERY_CAPABILITIES IRP:0xFFFFC30BFB6AC0E0
BusEnum.SYS: FDO IRP_MN_QUERY_PNP_DEVICE_STATE IRP:0xFFFFC30BFB6AC0E0
BusEnum.SYS: FDO IRP_MN_QUERY_DEVICE_RELATIONS IRP:0xFFFFC30BFB6AC0E0
    QueryDeviceRelation Type: BusRelations
    #PDOS present = 0
    #PDOs reported = 0
BusEnum.SYS: FDO: unknown_syscontrol_irp
 

高速相机闪光灯LED驱动电路的设计通常 involves several key components and considerations to ensure high efficiency, proper current regulation, and fast response times. Based on the information provided, a design can be conceptualized that integrates a suitable LED driver IC, a supercapacitor for energy storage, and a DC/DC converter to manage the power flow efficiently. ### 电路设计要点 #### 1. 电源管理 The power supply section should be designed to handle the input voltage range from the battery, typically a lithium-ion cell with a nominal voltage of 3.7V and a full charge voltage of 4.2V. The DC/DC converter should be capable of stepping up or down the voltage as required by the LED load, which in this case requires a current of 1 to 2A for a duration of 120ms to achieve the desired flash effect [^1]. #### 2. 超级电容器充电 A supercapacitor is used to store energy that can be quickly released to provide the high current needed for the LED flash. To prevent damage to the supercapacitor due to inrush current, a controlled charging circuit is necessary. This can be achieved using a dedicated LED flash driver IC that also manages the charging of the supercapacitor, thereby simplifying the design and reducing the PCB space required [^1]. #### 3. LED驱动器选择 For the LED driver, an IC like the LTC3452 can be considered. It offers high efficiency (≥85%) across the entire lithium-ion battery voltage range, supports a wide VIN range (2.7V to 5.5V), provides independent main/camera current control, delivers up to 425mA of continuous output current, includes internal soft start, offers open/short LED protection, PWM brightness control, and has a typical LED current matching error of less than 2.5% [^2]. ### 电路图参考 Unfortunately, I cannot directly provide circuit diagrams, but I can describe how to construct one based on typical applications. A basic circuit would involve connecting the battery to the input of the DC/DC converter, which is then connected to the supercapacitor. The output of the DC/DC converter should be connected to the LED driver IC, which controls the current through the LED during the flash event. Here's a simplified pseudocode representation of how the components might be connected in a schematic: ```plaintext Battery (+) -----> [DC/DC Converter Input] -----> [DC/DC Converter Output] -----> [LED Driver Input] | v [Supercapacitor Charging Circuit] | v [LED Driver Output] -----> [LED] ``` The actual implementation would require careful consideration of component selection, PCB layout, and thermal management to ensure reliable operation under high current conditions. ### 示例代码 示例代码并不适用于硬件电路设计,因为它是用于软件编程的。然而,如果涉及到微控制器来控制某些部分,比如 adjusting the PWM brightness control, then a simple code snippet could look like this: ```c // Assuming a microcontroller is used to control the PWM brightness void setupPWM() { // Configure PWM pin as output pinMode(LED_PWM_PIN, OUTPUT); // Set PWM frequency and duty cycle analogWrite(LED_PWM_PIN, BRIGHTNESS_LEVEL); // BRIGHTNESS_LEVEL ranges from 0 (off) to 255 (full brightness) } ``` 请注意,这段代码仅作为一个示例,并且假设存在一个微控制器来调节PWM亮度控制。实际的实现细节会根据所选的具体硬件和设计需求有所不同。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值