[148] | 1 | ; Project name : XTIDE Universal BIOS |
---|
[3] | 2 | ; Description : Int 13h function AH=2h, Read Disk Sectors. |
---|
| 3 | |
---|
| 4 | ; Section containing code |
---|
| 5 | SECTION .text |
---|
| 6 | |
---|
| 7 | ;-------------------------------------------------------------------- |
---|
| 8 | ; Int 13h function AH=2h, Read Disk Sectors. |
---|
| 9 | ; |
---|
| 10 | ; AH2h_HandlerForReadDiskSectors |
---|
| 11 | ; Parameters: |
---|
[148] | 12 | ; AL, CX, DH, ES: Same as in INTPACK |
---|
| 13 | ; DL: Translated Drive number |
---|
| 14 | ; DS:DI: Ptr to DPT (in RAMVARS segment) |
---|
[150] | 15 | ; SS:BP: Ptr to IDEPACK |
---|
| 16 | ; Parameters on INTPACK: |
---|
[221] | 17 | ; AL: Number of sectors to read (1...128) |
---|
[3] | 18 | ; CH: Cylinder number, bits 7...0 |
---|
| 19 | ; CL: Bits 7...6: Cylinder number bits 9 and 8 |
---|
| 20 | ; Bits 5...0: Starting sector number (1...63) |
---|
| 21 | ; DH: Starting head number (0...255) |
---|
| 22 | ; ES:BX: Pointer to buffer recieving data |
---|
[150] | 23 | ; Returns with INTPACK: |
---|
[3] | 24 | ; AH: Int 13h/40h floppy return status |
---|
[249] | 25 | ; AL: Burst error length if AH returns 11h (we never return error code 11h) |
---|
| 26 | ; Number of sectors actually read (only valid if CF set for someBIOSes) |
---|
[3] | 27 | ; CF: 0 if successfull, 1 if error |
---|
| 28 | ;-------------------------------------------------------------------- |
---|
| 29 | ALIGN JUMP_ALIGN |
---|
| 30 | AH2h_HandlerForReadDiskSectors: |
---|
[221] | 31 | call Prepare_BufferToESSIforOldInt13hTransfer |
---|
| 32 | call Prepare_GetOldInt13hCommandIndexToBX |
---|
[165] | 33 | mov ah, [cs:bx+g_rgbReadCommandLookup] |
---|
[150] | 34 | mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ) |
---|
| 35 | %ifdef USE_186 |
---|
[249] | 36 | push Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAHandTransferredSectorsFromCL |
---|
[150] | 37 | jmp Idepack_TranslateOldInt13hAddressAndIssueCommandFromAH |
---|
| 38 | %else |
---|
| 39 | call Idepack_TranslateOldInt13hAddressAndIssueCommandFromAH |
---|
[249] | 40 | jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAHandTransferredSectorsFromCL |
---|
[150] | 41 | %endif |
---|