[150] | 1 | ; Project name : XTIDE Universal BIOS
|
---|
| 2 | ; Description : Sets IDE Device specific parameters to DPT.
|
---|
| 3 |
|
---|
| 4 | ; Section containing code
|
---|
| 5 | SECTION .text
|
---|
| 6 |
|
---|
| 7 | ;--------------------------------------------------------------------
|
---|
| 8 | ; IdeDPT_Finalize
|
---|
| 9 | ; Parameters:
|
---|
| 10 | ; DS:DI: Ptr to Disk Parameter Table
|
---|
| 11 | ; ES:SI: Ptr to 512-byte ATA information read from the drive
|
---|
[160] | 12 | ; CS:BP: Ptr to IDEVARS for the controller
|
---|
[150] | 13 | ; Returns:
|
---|
[258] | 14 | ; CF: Clear, IDE interface only supports hard disks
|
---|
[150] | 15 | ; Corrupts registers:
|
---|
[242] | 16 | ; AX
|
---|
[150] | 17 | ;--------------------------------------------------------------------
|
---|
| 18 | IdeDPT_Finalize:
|
---|
| 19 | ; Fall to .StoreBlockMode
|
---|
| 20 |
|
---|
| 21 | ;--------------------------------------------------------------------
|
---|
| 22 | ; .StoreBlockMode
|
---|
| 23 | ; Parameters:
|
---|
| 24 | ; DS:DI: Ptr to Disk Parameter Table
|
---|
| 25 | ; ES:SI: Ptr to 512-byte ATA information read from the drive
|
---|
[160] | 26 | ; CS:BP: Ptr to IDEVARS for the controller
|
---|
[150] | 27 | ; Returns:
|
---|
| 28 | ; Nothing
|
---|
| 29 | ; Corrupts registers:
|
---|
[242] | 30 | ; AX
|
---|
[150] | 31 | ;--------------------------------------------------------------------
|
---|
| 32 | .StoreBlockMode:
|
---|
[276] | 33 | mov al, 1 ; Block mode will be enabled on AH=9h
|
---|
[150] | 34 | mov ah, [es:si+ATA1.bBlckSize] ; Max block size in sectors
|
---|
| 35 | mov [di+DPT_ATA.wSetAndMaxBlock], ax
|
---|
[160] | 36 | ; Fall to IdeDPT_StoreReversedAddressLinesFlagIfNecessary
|
---|
[150] | 37 |
|
---|
[160] | 38 | ;--------------------------------------------------------------------
|
---|
| 39 | ; IdeDPT_StoreReversedAddressLinesFlagIfNecessary
|
---|
| 40 | ; Parameters:
|
---|
| 41 | ; DS:DI: Ptr to Disk Parameter Table
|
---|
| 42 | ; CS:BP: Ptr to IDEVARS for the controller
|
---|
| 43 | ; Returns:
|
---|
[258] | 44 | ; CF: Always clear, we don't support floppies on the IDE inteface
|
---|
[160] | 45 | ; Corrupts registers:
|
---|
| 46 | ; Nothing
|
---|
| 47 | ;--------------------------------------------------------------------
|
---|
| 48 | IdeDPT_StoreReversedAddressLinesFlagIfNecessary:
|
---|
| 49 | cmp BYTE [cs:bp+IDEVARS.bDevice], DEVICE_XTIDE_WITH_REVERSED_A3_AND_A0
|
---|
| 50 | jne SHORT .EndDPT
|
---|
| 51 | or BYTE [di+DPT.bFlagsHigh], FLGH_DPT_REVERSED_A0_AND_A3
|
---|
[150] | 52 |
|
---|
| 53 | .EndDPT:
|
---|
[258] | 54 | clc
|
---|
[150] | 55 | ret
|
---|