1 | ; Project name : XTIDE Universal BIOS
|
---|
2 | ; Description : Int 13h function AH=48h, Get Extended Drive Parameters.
|
---|
3 |
|
---|
4 | ; Section containing code
|
---|
5 | SECTION .text
|
---|
6 |
|
---|
7 | ;--------------------------------------------------------------------
|
---|
8 | ; Int 13h function AH=48h, Get Extended Drive Parameters.
|
---|
9 | ;
|
---|
10 | ; AH48h_GetExtendedDriveParameters
|
---|
11 | ; Parameters:
|
---|
12 | ; SI: 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 | ; DS:SI: Ptr to Extended Drive Information Table to fill
|
---|
18 | ; Returns with INTPACK:
|
---|
19 | ; AH: Int 13h return status
|
---|
20 | ; DS:SI: Ptr to Extended Drive Information Table
|
---|
21 | ; CF: 0 if succesfull, 1 if error
|
---|
22 | ;--------------------------------------------------------------------
|
---|
23 | AH48h_HandlerForGetExtendedDriveParameters:
|
---|
24 | call AccessDPT_GetLbaSectorCountToBXDXAX
|
---|
25 |
|
---|
26 | ; Point DS:SI to Extended Drive Information Table to fill
|
---|
27 | mov ds, [bp+IDEPACK.intpack+INTPACK.ds]
|
---|
28 | mov cx, MINIMUM_EDRIVEINFO_SIZE
|
---|
29 | cmp [si+EDRIVE_INFO.wSize], cx
|
---|
30 | jb SHORT Prepare_ReturnFromInt13hWithInvalidFunctionError
|
---|
31 | je SHORT .SkipEddConfigurationParameters
|
---|
32 |
|
---|
33 | ; We do not support EDD Configuration Parameters so set to FFFF:FFFFh
|
---|
34 | mov cx, -1 ; FFFFh
|
---|
35 | mov [si+EDRIVE_INFO.fpEDDparams], cx
|
---|
36 | mov [si+EDRIVE_INFO.fpEDDparams+2], cx
|
---|
37 | mov cx, EDRIVE_INFO_size
|
---|
38 |
|
---|
39 | ; Fill Extended Drive Information Table in DS:SI
|
---|
40 | .SkipEddConfigurationParameters:
|
---|
41 | mov [si+EDRIVE_INFO.wSize], cx
|
---|
42 | mov WORD [si+EDRIVE_INFO.wFlags], FLG_DMA_BOUNDARY_ERRORS_HANDLED_BY_BIOS
|
---|
43 |
|
---|
44 | mov [di+EDRIVE_INFO.qwTotalSectors], ax
|
---|
45 | xor ax, ax ; Return with success
|
---|
46 | mov [di+EDRIVE_INFO.qwTotalSectors+2], dx
|
---|
47 | mov [di+EDRIVE_INFO.qwTotalSectors+4], bx
|
---|
48 | mov [di+EDRIVE_INFO.qwTotalSectors+6], ax
|
---|
49 | mov WORD [di+EDRIVE_INFO.wSectorSize], 512
|
---|
50 |
|
---|
51 | .ReturnWithError:
|
---|
52 | jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
|
---|