1 | ; Project name : XTIDE Universal BIOS
|
---|
2 | ; Description : Int 13h function AH=25h, Get Drive Information.
|
---|
3 |
|
---|
4 | ; Section containing code
|
---|
5 | SECTION .text
|
---|
6 |
|
---|
7 | ;--------------------------------------------------------------------
|
---|
8 | ; Int 13h function AH=25h, Get Drive Information.
|
---|
9 | ;
|
---|
10 | ; AH25h_HandlerForGetDriveInformation
|
---|
11 | ; Parameters:
|
---|
12 | ; ES: Same as in INTPACK
|
---|
13 | ; DL: Translated Drive number
|
---|
14 | ; DS:DI: Ptr to DPT (in RAMVARS segment)
|
---|
15 | ; SS:BP: Ptr to IDEPACK
|
---|
16 | ; Parameters on INTPACK:
|
---|
17 | ; ES:BX: Ptr to buffer to receive 512-byte drive information
|
---|
18 | ; Returns with INTPACK:
|
---|
19 | ; AH: Int 13h return status
|
---|
20 | ; CF: 0 if succesfull, 1 if error
|
---|
21 | ;--------------------------------------------------------------------
|
---|
22 | ALIGN JUMP_ALIGN
|
---|
23 | AH25h_HandlerForGetDriveInformation:
|
---|
24 | mov al, 1 ; Read 1 sector
|
---|
25 | call Prepare_BufferToESSIforOldInt13hTransfer
|
---|
26 | %ifdef USE_186
|
---|
27 | push Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
|
---|
28 | ; Fall to AH25h_GetDriveInformationToBufferInESSI
|
---|
29 | %else
|
---|
30 | call AH25h_GetDriveInformationToBufferInESSI
|
---|
31 | jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
|
---|
32 | %endif
|
---|
33 |
|
---|
34 |
|
---|
35 | ;--------------------------------------------------------------------
|
---|
36 | ; AH25h_GetDriveInformationToBufferInESSI
|
---|
37 | ; Parameters:
|
---|
38 | ; DS:DI: Ptr to DPT (in RAMVARS segment)
|
---|
39 | ; ES:SI: Ptr to buffer to receive 512-byte drive information
|
---|
40 | ; Returns with INTPACK:
|
---|
41 | ; AH: Int 13h return status
|
---|
42 | ; CF: 0 if succesfull, 1 if error
|
---|
43 | ; Corrupts registers:
|
---|
44 | ; AL, BX, CX, DX
|
---|
45 | ;--------------------------------------------------------------------
|
---|
46 | ;ALIGN JUMP_ALIGN
|
---|
47 | AH25h_GetDriveInformationToBufferInESSI:
|
---|
48 | push es
|
---|
49 | push bp
|
---|
50 | push di
|
---|
51 | push si
|
---|
52 |
|
---|
53 | call AccessDPT_GetDriveSelectByteToAL
|
---|
54 | mov bh, al
|
---|
55 | eMOVZX ax, BYTE [di+DPT.bIdevarsOffset]
|
---|
56 | xchg bp, ax
|
---|
57 | call Device_IdentifyToBufferInESSIwithDriveSelectByteInBH
|
---|
58 |
|
---|
59 | pop si
|
---|
60 | pop di
|
---|
61 | pop bp
|
---|
62 | pop es
|
---|
63 | ret
|
---|