Int 24 C - Dos 1+ - Critical Error Handler [D]


Notes: invoked when a critical (usually hardware) error is encountered by DOS
(see #2231); should never be called directly
when DOS terminates a program, it copies the previous value of the
INT 24 vector out of the PSP (see #1066) and into the interrupt
vector table

See Also: INT 21/AH=95h

(Table 2231)
Values critical error handler is called with:
AH = type and processing flags (see #2232)
AL = drive number if AH bit 7 clear
BP:SI -> device driver header (see #1332 at INT 21/AH=52h)
(BP:[SI+4] bit 15 set if character device)
DI low byte contains error code if AH bit 7 set (see #2233)
STACK: DWORD return address for INT 24 call
WORD flags pushed by INT 24
WORD original AX on entry to INT 21
WORD BX
WORD CX
WORD DX
WORD SI
WORD DI
WORD BP
WORD DS
WORD ES
DWORD return address for INT 21 call
WORD flags pushed by INT 21

Return: AL = action code (see #2234)
SS,SP,DS,ES,BX,CX,DX preserved

Notes: the only DOS calls the handler may make are INT 21/AH=01h-0Ch,30h,59h
if the handler returns to the application by popping the stack, DOS
will be in an unstable state until the first call with AH > 0Ch
for DOS 3.1+, IGNORE (AL=00h) is turned into FAIL (AL=03h) on network
critical errors
if IGNORE specified but not allowed, it is turned into FAIL
if RETRY specified but not allowed, it is turned into FAIL
if FAIL specified but not allowed, it is turned into ABORT
(DOS 3.0+) if a critical error occurs inside the critical error
handler, the DOS call is automatically failed (AL set to 03h and
the INT 24 call skipped)

Bitfields for critical error type and processing flags:
Bit(s) Description (Table 2232)
7 clear = disk I/O error
set = -- if block device, bad FAT image in memory
-- if char device, error code in DI
6 unused
5 Ignore allowed (DOS 3.0+)
4 Retry allowed (DOS 3.0+)
3 Fail allowed (DOS 3.0+)
2-1 disk area of error
00 = DOS area 01 = FAT
10 = root dir 11 = data area
0 set if write, clear if read

(Table 2233)
Values for critical error code:
00h write-protection violation attempted
01h unknown unit for driver
02h drive not ready
03h unknown command given to driver
04h data error (bad CRC)
05h bad device driver request structure length
06h seek error
07h unknown media type
08h sector not found
09h printer out of paper
0Ah write fault
0Bh read fault
0Ch general failure
0Dh (DOS 3.0+) sharing violation
0Eh (DOS 3.0+) lock violation
0Fh invalid disk change
10h (DOS 3.0+) FCB unavailable
11h (DOS 3.0+) sharing buffer overflow
12h (DOS 4.0+) code page mismatch
13h (DOS 4.0+) out of input
14h (DOS 4.0+) insufficient disk space

(Table 2234)
Values for critical error handler action code:
00h ignore error and continue processing request
01h retry operation
02h terminate program as though INT 21/AH=4Ch called (INT 20h for DOS 1.x)
03h fail system call in progress (DOS 3+)