[165] | 1 | ; Project name : XTIDE Universal BIOS |
---|
| 2 | ; Description : Int 13h function AH=42h, Extended Read Sectors. |
---|
| 3 | |
---|
| 4 | ; Section containing code |
---|
| 5 | SECTION .text |
---|
| 6 | |
---|
| 7 | ;-------------------------------------------------------------------- |
---|
| 8 | ; Int 13h function AH=42h, Extended Read Sectors. |
---|
| 9 | ; |
---|
| 10 | ; AH42h_HandlerForExtendedReadSectors |
---|
| 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 Disk Address Packet |
---|
| 18 | ; Returns with INTPACK: |
---|
| 19 | ; AH: Int 13h return status |
---|
| 20 | ; CF: 0 if succesfull, 1 if error |
---|
| 21 | ; Return with Disk Address Packet in INTPACK: |
---|
| 22 | ; .bSectorCount Number of sectors read successfully |
---|
| 23 | ;-------------------------------------------------------------------- |
---|
| 24 | ALIGN JUMP_ALIGN |
---|
| 25 | AH42h_HandlerForExtendedReadSectors: |
---|
| 26 | call AH42h_LoadDapToESSIandVerifyForTransfer |
---|
| 27 | call CommandLookup_GetEbiosIndexToBX |
---|
| 28 | mov ah, [cs:bx+g_rgbReadCommandLookup] |
---|
| 29 | mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ) |
---|
| 30 | %ifdef USE_186 |
---|
| 31 | push Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH |
---|
| 32 | jmp Idepack_ConvertDapToIdepackAndIssueCommandFromAH |
---|
| 33 | %else |
---|
| 34 | call Idepack_ConvertDapToIdepackAndIssueCommandFromAH |
---|
| 35 | jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH |
---|
| 36 | %endif |
---|
| 37 | |
---|
| 38 | |
---|
| 39 | ;-------------------------------------------------------------------- |
---|
| 40 | ; AH42h_LoadDapToESSIandVerifyForTransfer |
---|
| 41 | ; Parameters: |
---|
| 42 | ; SI: Same as in INTPACK |
---|
| 43 | ; SS:BP: Ptr to IDEPACK |
---|
| 44 | ; Parameters on INTPACK: |
---|
| 45 | ; DS:SI: Ptr to Disk Address Packet |
---|
| 46 | ; Returns: |
---|
| 47 | ; ES:SI: Ptr to Disk Address Packet (DAP) |
---|
| 48 | ; Exits from INT 13h if invalid DAP |
---|
| 49 | ; Corrupts registers: |
---|
| 50 | ; Nothing |
---|
| 51 | ;-------------------------------------------------------------------- |
---|
| 52 | ALIGN JUMP_ALIGN |
---|
| 53 | AH42h_LoadDapToESSIandVerifyForTransfer: |
---|
| 54 | mov es, [bp+IDEPACK.intpack+INTPACK.ds] ; ES:SI to point Disk Address Packet |
---|
| 55 | cmp BYTE [es:si+DAP.bSize], MINIMUM_DAP_SIZE |
---|
| 56 | jb SHORT .DapContentsNotValid |
---|
| 57 | cmp BYTE [es:si+DAP.bSectorCount], 0 |
---|
| 58 | jle SHORT .DapContentsNotValid ; Must be 1...127 |
---|
| 59 | ret |
---|
| 60 | .DapContentsNotValid: |
---|
| 61 | jmp AH2h_ExitInt13hSinceSectorCountInIntpackIsZero |
---|