[116] | 1 | ; Project name : XTIDE Universal BIOS |
---|
[3] | 2 | ; Description : Int 13h function AH=1h, Read Disk Status. |
---|
| 3 | |
---|
[376] | 4 | ; |
---|
[526] | 5 | ; XTIDE Universal BIOS and Associated Tools |
---|
| 6 | ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team. |
---|
[376] | 7 | ; |
---|
| 8 | ; This program is free software; you can redistribute it and/or modify |
---|
| 9 | ; it under the terms of the GNU General Public License as published by |
---|
| 10 | ; the Free Software Foundation; either version 2 of the License, or |
---|
| 11 | ; (at your option) any later version. |
---|
[526] | 12 | ; |
---|
[376] | 13 | ; This program is distributed in the hope that it will be useful, |
---|
| 14 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
[526] | 16 | ; GNU General Public License for more details. |
---|
[376] | 17 | ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
---|
[526] | 18 | ; |
---|
[376] | 19 | |
---|
[3] | 20 | ; Section containing code |
---|
| 21 | SECTION .text |
---|
| 22 | |
---|
| 23 | ;-------------------------------------------------------------------- |
---|
| 24 | ; Int 13h function AH=1h, Read Disk Status. |
---|
| 25 | ; |
---|
| 26 | ; AH1h_HandlerForReadDiskStatus |
---|
| 27 | ; Parameters: |
---|
[148] | 28 | ; DL: Translated Drive number |
---|
| 29 | ; DS:DI: Ptr to DPT (in RAMVARS segment) |
---|
[150] | 30 | ; SS:BP: Ptr to IDEREGS_AND_INTPACK |
---|
| 31 | ; Returns with INTPACK: |
---|
[3] | 32 | ; AH: Int 13h floppy return status |
---|
| 33 | ; CF: 0 if AH = RET_HD_SUCCESS, 1 otherwise (error) |
---|
| 34 | ;-------------------------------------------------------------------- |
---|
| 35 | ALIGN JUMP_ALIGN |
---|
| 36 | AH1h_HandlerForReadDiskStatus: |
---|
[148] | 37 | LOAD_BDA_SEGMENT_TO ds, ax, ! |
---|
[258] | 38 | |
---|
| 39 | %ifdef MODULE_SERIAL_FLOPPY |
---|
| 40 | test dl, dl |
---|
[294] | 41 | js .HardDisk |
---|
| 42 | mov ah, [BDA.bFDRetST] ; Unlike for hard disks below, floppy version does not clear the status |
---|
[258] | 43 | jmp .done |
---|
[294] | 44 | .HardDisk: |
---|
[258] | 45 | %endif |
---|
[294] | 46 | |
---|
| 47 | xchg ah, [BDA.bHDLastSt] ; Load and clear last error (AH is cleared with the LOAD_BDA_SEGMENT_TO above) |
---|
| 48 | |
---|
[258] | 49 | .done: |
---|
[294] | 50 | %ifndef USE_186 |
---|
[150] | 51 | call Int13h_SetErrorCodeToIntpackInSSBPfromAH |
---|
[148] | 52 | jmp Int13h_ReturnFromHandlerWithoutStoringErrorCode |
---|
[294] | 53 | %else |
---|
| 54 | push Int13h_ReturnFromHandlerWithoutStoringErrorCode |
---|
| 55 | jmp Int13h_SetErrorCodeToIntpackInSSBPfromAH |
---|
| 56 | %endif |
---|