100 lines
4.1 KiB
Plaintext
100 lines
4.1 KiB
Plaintext
DIFFERENCES AND NEW ADDITIONS
|
||
TO THE INT 24H HARD ERROR
|
||
HANDLER(s) FOR MSDOS 2.0
|
||
|
||
|
||
1.) Additional Constraints:
|
||
|
||
Under previous versions it was not explicitly stated
|
||
that an INT 24H handler must preserve the ES register.
|
||
It is now required that INT 24H handlers preserve ES.
|
||
|
||
When it is desired to ignore an error, the same
|
||
registers must be preserved as when it is desired to
|
||
retry the operation (SS,SP,DS,BX,CX,DX).
|
||
|
||
It was not clearly stated in the past, but it was
|
||
true, that only system calls 1-12 can be made by an INT
|
||
24H handler. Making any other calls will destroy the
|
||
DOS stack and thus its ability to retry or ignore an
|
||
error.
|
||
|
||
INT 24H Handlers should always return to the DOS
|
||
on a retry, ignore, or abort. Failure to return to the
|
||
DOS will leave the DOS in an unstable state until a non
|
||
1-12 function call is made.
|
||
|
||
2.) Additional features:
|
||
|
||
Character device errors are now handled by the INT
|
||
24H mechanism. Previously only Disk I/O errors were
|
||
handled by the INT 24H handler. Additional information
|
||
is now passed to the INT 24H handler in the BP and SI
|
||
registers (which need not be preserved).
|
||
|
||
BP:SI is a DWORD pointer to the Device Header of
|
||
the device causing the error. Information can be gotten
|
||
from this header as to whether the device is a block
|
||
or character device, and if the device is a character
|
||
device the name of the device can also be obtained. The
|
||
DEVICE-DRIVERS document for 2.0 contains the definition
|
||
of this header format.
|
||
|
||
NOTE: AL (drive number for Disk errors) is indeterminate
|
||
on character device errors. Bit 7 of AH is always
|
||
1 for character device errors, previously bit 7 was
|
||
1 only in the case of a bad memory image of the FAT.
|
||
|
||
LIST OF INT 24H ERROR CODES PASSED IN DI
|
||
|
||
0 Write Protect violation
|
||
1 Unknown Unit NEW
|
||
2 Drive not ready
|
||
3 Unknown command NEW
|
||
4 CRC error
|
||
5 Bad Drive Request Structure length NEW
|
||
6 Seek error
|
||
7 Unknown media NEW
|
||
8 Sector not found
|
||
|
||
9 Printer out of paper NEW
|
||
A Write Fault
|
||
B Read Fault NEW
|
||
C General Failure
|
||
|
||
As mentioned above BP:SI points to the device header:
|
||
|
||
BP:SI->
|
||
+--------------------------------------+
|
||
| DWORD Pointer to next device |
|
||
| (-1 if last device) |
|
||
+--------------------------------------+
|
||
| WORD Attributes |
|
||
| Bit 15 = 1 if char device 0 if blk |
|
||
| if bit 15 is 1 |
|
||
| Bit 0 = 1 if Current sti device |
|
||
| Bit 1 = 1 if Current sto output |
|
||
| Bit 2 = 1 if Current NUL device |
|
||
| Bit 3 = 1 if Current CLOCK dev |
|
||
| Bit 14 is the IOCTL bit (see below) |
|
||
| Bit 13 is the NON IBM FORMAT bit |
|
||
+--------------------------------------+
|
||
| WORD Pointer to Device strategy |
|
||
| entry point |
|
||
+--------------------------------------+
|
||
| WORD Pointer to Device interrupt |
|
||
| entry point |
|
||
+--------------------------------------+
|
||
| 8-BYTE character device name field |
|
||
| Character devices set a device name |
|
||
| For block devices the first byte is |
|
||
| The number of units |
|
||
+--------------------------------------+
|
||
|
||
To tell if the error occured on a block or character
|
||
device you must look at bit 15 in the attribute field (WORD
|
||
at BP:SI+4).
|
||
|
||
If the name of the character device is desired look at
|
||
the eight bytes starting at BP:SI+10.
|
||
|