楼主查过中断大全吗?参数都弄错了(你把si写成了di): IBM/MS INT 13 Extensions - GET DRIVE PARAMETERS AH = 48h DL = drive (80h-FFh) DS:SI -> buffer for drive parameters (see #00273) Return:CF clear if successful AH = 00h DS:SI buffer filled CF set on error AH = error code (see #00234)
其中ds:si必须指向以下格式的结构(你根本就没有对结构做初始化):
Offset Size Description (Table 00273)
00h WORD (call) size of buffer
(001Ah for v1.x, 001Eh for v2.x, 42h for v3.0)
(ret) size of returned data
02h WORD information flags (see #00274)04h DWORD number of physical cylinders on drive
08h DWORD number of physical heads on drive
0Ch DWORD number of physical sectors per track
10h QWORD total number of sectors on drive
18h WORD bytes per sector
---v2.0+ ---
1Ah DWORD -> EDD configuration parameters (see #00278)FFFFh:FFFFh if not available
---v3.0 ---
1Eh WORD signature BEDDh to indicate presence of Device Path info
20h BYTE length of Device Path information, including signature and this
byte (24h for v3.0)
21h 3 BYTEs reserved (0)
24h 4 BYTEs ASCIZ name of host bus ("ISA" or "PCI")
28h 8 BYTEs ASCIZ name of interface type
"ATA"
"ATAPI"
"SCSI"
"USB"
"1394" IEEE 1394 (FireWire)
"FIBRE" Fibre Channel
30h 8 BYTEs Interface Path (see #00275)38h 8 BYTEs Device Path (see #00276)40h BYTE reserved (0)
41h BYTE checksum of bytes 1Eh-40h (two's complement of sum, which makes
the 8-bit sum of bytes 1Eh-41h equal 00h)
Note: If the size is less than 30 on call, the final DWORD will not be
returned by a v2.x implementation; similarly for the Device Path info