atapi!IdeReadWrite函数分析下之Send read command
第一部分:
#define SRB_USES_DMA(Srb) (((ULONG_PTR)Srb->SrbExtension) & 2)
[+0x028] SrbExtension : 0x2 [Type: void *]
第二部分:
#define IDE_COMMAND_READ_DMA 0xC8
//
// Send read command.
//
if (SRB_USES_DMA(Srb)) {
IdePortOutPortByte (
baseIoAddress1->Command,
IDE_COMMAND_READ_DMA);
#define IdePortOutPortByte(addr, data) WRITE_PORT_UCHAR(addr, data)
第三部分:
0: kd> dt HW_DEVICE_EXTENSION 0x895e98a8 esi=895e98a8
atapi!HW_DEVICE_EXTENSION
+0x000 CurrentSrb : 0x89529734 _SCSI_REQUEST_BLOCK
+0x004 BaseIoAddress1 : _IDE_REGISTERS_1
+0x028 BaseIoAddress2 : _IDE_REGISTERS_2
+0x034 BaseIoAddress1Length : 8
+0x038 BaseIoAddress2Length : 1
0: kd> dx -id 0,0,899a2278 -r1 (*((atapi!_IDE_REGISTERS_1 *)0x895e98ac))
(*((atapi!_IDE_REGISTERS_1 *)0x895e98ac)) [Type: _IDE_REGISTERS_1]
[+0x000] RegistersBaseAddress : 0x1f0 : Unable to read memory at Address 0x1f0 [Type: unsigned char *]
[+0x004] Data : 0x1f0 : Unable to read memory at Address 0x1f0 [Type: unsigned short *]
[+0x008] Error : 0x1f1 : Unable to read memory at Address 0x1f1 [Type: unsigned char *]
[+0x00c] BlockCount : 0x1f2 : Unable to read memory at Address 0x1f2 [Type: unsigned char *]
[+0x010] BlockNumber : 0x1f3 : Unable to read memory at Address 0x1f3 [Type: unsigned char *]
[+0x014] CylinderLow : 0x1f4 : Unable to read memory at Address 0x1f4 [Type: unsigned char *]
[+0x018] CylinderHigh : 0x1f5 : Unable to read memory at Address 0x1f5 [Type: unsigned char *]
[+0x01c] DriveSelect : 0x1f6 : Unable to read memory at Address 0x1f6 [Type: unsigned char *]
[+0x020] Command : 0x1f7 : Unable to read memory at Address 0x1f7 [Type: unsigned char *]
第四部分:
0: kd> p
atapi!IdeReadWrite+0x1da:
f729cd04 68c8000000 push 0C8h
0: kd> p
atapi!IdeReadWrite+0x1df:
f729cd09 ff7624 push dword ptr [esi+24h]
0: kd> r
eax=00000060 ebx=804f4d68 ecx=000000e0 edx=000001f5 esi=895e98a8 edi=89529734
0: kd> pr
eax=00000060 ebx=804f4d68 ecx=000000e0 edx=000001f5 esi=895e98a8 edi=89529734
eip=f729cd0c esp=f78d5ef0 ebp=f78d5f0c iopl=0 nv up ei pl nz na po nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000202
atapi!IdeReadWrite+0x1e2:
f729cd0c ffd3 call ebx {hal!WRITE_PORT_UCHAR (804f4d68)}
0: kd> dd 0x025fe000
025fe000 ???????? ???????? ???????? ????????
025fe010 ???????? ???????? ???????? ????????
025fe020 ???????? ???????? ???????? ????????
025fe030 ???????? ???????? ???????? ????????
025fe040 ???????? ???????? ???????? ????????