Table des matières

Int 24h - Critical Error Handler

invoked when a critical (usually hardware) error is encountered; should never be called directly

Input registers and meanings

Critical Error Handler is invoked with those resgisters as parameters:

AH Register

bit Dos type and processing flags
7 0 : disk I/O error
1 : if block device, bad FAT image in memory
if char device, error code in DI
6 unused
5 3+ 1 if Ignore allowed,
0 if not
4 3+ 1 if Retry allowed,
0 if not
3 3+ 1 if Fail allowed,
0 if not
2 disk area of error
00 = DOS area
01 = FAT
10 = root dir
11 = data area
1
0 1 if write,
0 if read

AL register

Drive number if AH bit 7 clear

BP:SI

Pointer to device driver header (BP:[SI+4] bit 15 set if char device)

DI

DI value Dos version low byte contains error code if AH bit 7 set
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 3+ sharing violation
0Eh 3+ violation
0Fh invalid disk change
10h 3+ FCB unavailable
11h 3+ sharing buffer overflow
12h 4+ code page mismatch
13h 4+ out of input
14h 4+ insufficient disk space

Stack

Size Meaning
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

mandatory return values

Handler must return:

AL meaning
00h ignore error and continue processing request
01h retry operation
02h terminate program through the equivalent of INT 21h,4Ch (INT 20h for DOS 1.x)
03h fail system call in progress

SS,SP,DS,ES,BX,CX,DX preserved

Notes & Comments

  • 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
  • if a critical error occurs inside the critical error handler, the DOS call is automatically failed (DOS 3+)

Back