Dec 282017
Undocumented dos functions. | |||
---|---|---|---|
File Name | File Size | Zip Size | Zip Type |
DOSUNDOC.DOC | 8064 | 2683 | deflated |
Download File DOSUNDOC.ZIP Here
Contents of the DOSUNDOC.DOC file
==========================================================================
Internal DOS Interrupts (2.xx only)
(With some notes on Dos 3.xx)
==========================================================================
Orginal work Janet JackJanuary 1985
Revisions J. Weaver Jr. January 1985
John Cooper February 1985
Skip Gilbrech February 1985
Bob JackFebruary 1985
Jim KyleApril 1985
John Ruschmeyer July 1985
Bill Frolik July 1985
Ross M. GreenbergJuly 1985
Spyros Sakellariadis May 1986
* Indicates little known about this interrupt so far.
Refer to DOSINTS.DOC for similar documentation on all interrupts,
not just undocumented ones.
==========================================================================
INT 21
-----------------------------------------------------------
* REG AH = 18H - - does nothing (MSDOS generic)
On Return: AL = 0
-----------------------------------------------------------
* REG AH = 1DH - - does nothing (MSDOS generic)
On Return: AL = 0
-----------------------------------------------------------
* REG AH = 1EH - - does nothing (MSDOS generic)
On Return: AL = 0
-----------------------------------------------------------
REG AH = 1FH - - Get "DOS Disk Block" for default drive
See Function AH = 32
On Return: DS:BX Pointer to DOS Disk Block
-----------------------------------------------------------
* REG AH = 20H - - does nothing (MSDOS generic)
On Return: AL = 0
-----------------------------------------------------------
REG AH = 32H - - Get "DOS Disk Block"
Cf C.Petzold, PC Mag. Vol.5,no.8
On Entry: AH = 32h
DL = Number of Disk Drive (0=default, 1=A, etc)
On Return: AL = 00 if drive exists, FFh for invalid drive
DS:BXPointer to DOS Disk Block
Description of DOS Disk Block:
OffsetTypeData
----------------------------
00DB Drive: 0=A, 1=B, etc
01DBUnit within driver (0,1,2,etc)
02DWBytes per sector
04DBSectors per cluster - 1
05DBCluster to sector shift
06DWNo.of reserved sectors
08DBNo.of FATs
09DWNo. of root directory entries
0BDWSector no.of cluster 2 (1st data cluster)
0DDWNumber of clusters +1 (last cluster no.)
0FDBSectors for FAT
10DWSector number of directory
12DDAddress of device header
16DBMedia descriptor byte
17DB0 if disk has been accessed
18DDAddress of next DOS Disk Block (FFFF if last)
22DBCurrent Working Directory (2.0 only) (64 bytes)
-----------------------------------------------------------
REG AH = 34H - - Return DOS Callable Vector
On Return: ES:BX contains DOS Callable Vector
When byte pointed to by this vector is non-zero, a DOS
function call is in progress. DOS is non-reentrant due to
its use of internal stacks (see Interrupt 28h, below),
and must not be called if this byte is non-zero.
In DOS 3.10 changed to word value, with preceeding byte.If
ES:BX contain address, proc is:
push ES
pop DS
mov SI,BX
dec SI
lodsw
xchg AL,AH
cmp AX,1
-----------------------------------------------------------
REG AH=37h - - multifunction (MSDOS generic)
AL=0Read switch character (returns current character in DL)
1Set switch character (specify new character in DL)
2Read device availability (as set by function AL=3)
3Set device availability, where:
DL=0 means /DEV/ must preceed device names
DL#0 means /DEV/ need not preceed device names
Returns: DL =Switch character (if AL=0 or 1)
Device availability flag (if AL=2 or 3)
Error return: AL=0FFh means the value in AL was not in the range 0-3.
Note: Functions 2 & 3 appear not to be implemented for dos 3.x
-----------------------------------------------------------
REG AH = 45H - - Dup
On Entry: As documented in DOS manual
On Return: Ditto
More useful than documentation suggests. See Software
Toolbox Column in Dr.Dobb's Journal, June 1986, by Ray
Duncan, for details. Important function is to update
a directory without closing current file, to prevent
embarassing crashes. Dup your file handle, close the
duplicated file.
-----------------------------------------------------------
REG AH = 46H - - Forcdup
On Entry: As documented in DOS manual
On Return: Ditto
More useful than documentation suggests. See Software
Toolbox Column in Dr.Dobb's Journal, June 1986, by Ray
Duncan, for details. Important function is to control
behaviour of child processes created with EXEC function.
-----------------------------------------------------------
REG AH = 50H - - Set Current PSP Segment
On Entry: Reg BX = Segment address of new PSP
On Return: No return codes - swaps PSP's regarded as current by DOS
Open File information, etc is stored in the PSP DOS views as
current. If a program (eg a resident program) creates a need
for a second PSP, then the second PSP should be set as current
to make sure DOS closes that as opposed to the first when the
second application finishes. See PC Mag Vol.5, No 9, p.314 for
discussion.
-----------------------------------------------------------
REG AH = 51H - - Get PSP Segment (MSDOS generic)
On Return: BX = Current PSP Segment
Used as complement to Function AH = 50h
-----------------------------------------------------------
REG AH = 52H - - Get Pointer to "DOS Disk Block" for Drive A:
(Cf Function AH=32)
On Return: ES:BXPointer to DOS Disk Block for Drive A:
-----------------------------------------------------------
REG AH = 53H - - Translate BPB Table to "DOS Disk Block"
On Return: DS:SIPointer to BIOS Parameter Block
ES:BPPointer to DOS Disk Block
-----------------------------------------------------------
REG AH = 55H - - Create PSP (MSDOS generic)
Like Function AH = 26H but creates "child" PSP rather
than copying existing one.
==========================================================================
INT 28 - Internal routine for MSDOS
This interrupt is continuously called by DOS itself whenever it is
in a wait state (i.e., when it is waiting for keyboard input) during
a function call of 01h through 0Ch. DOS uses 3 separate internal
stacks: one for calls 01h through 0Ch; another for calls 0Dh and
above; and a third for calls 01h through 0Ch when a Critical Error
is in progress. When Interrupt 28h is called, any calls above 0Ch
can be executed without destroying the internal Stack used by DOS
at the time.
It is used primarily by the PRINT.COM routines, but any number of
other routines could be chained to it by saving the original vector,
and calling it with a FAR call (or just JMPing to it) at the end of
the new routine. Until PRINT.COM installs its own routine, this
interrupt vector simply points to an IRET opcode. It is used in
many memory resident routines which themselves call DOS, and usually
used in conjunction with Interrupt 21h, Function AH = 32h.
DEBUG itself uses DOS call 0Ah for keyboard input, so you can end up
in an endless loop if you are not careful.
==========================================================================
INT 29 - Internal routine for MSDOS
* This interrupt is called from the DOS output routines
if output is going to a device rather than a file, and the
device driver's attribute word has bit 3 (04H) set to "1".
Nothing more is known about it.
==========================================================================
Internal DOS Interrupts (2.xx only)
(With some notes on Dos 3.xx)
==========================================================================
Orginal work Janet JackJanuary 1985
Revisions J. Weaver Jr. January 1985
John Cooper February 1985
Skip Gilbrech February 1985
Bob JackFebruary 1985
Jim KyleApril 1985
John Ruschmeyer July 1985
Bill Frolik July 1985
Ross M. GreenbergJuly 1985
Spyros Sakellariadis May 1986
* Indicates little known about this interrupt so far.
Refer to DOSINTS.DOC for similar documentation on all interrupts,
not just undocumented ones.
==========================================================================
INT 21
-----------------------------------------------------------
* REG AH = 18H - - does nothing (MSDOS generic)
On Return: AL = 0
-----------------------------------------------------------
* REG AH = 1DH - - does nothing (MSDOS generic)
On Return: AL = 0
-----------------------------------------------------------
* REG AH = 1EH - - does nothing (MSDOS generic)
On Return: AL = 0
-----------------------------------------------------------
REG AH = 1FH - - Get "DOS Disk Block" for default drive
See Function AH = 32
On Return: DS:BX Pointer to DOS Disk Block
-----------------------------------------------------------
* REG AH = 20H - - does nothing (MSDOS generic)
On Return: AL = 0
-----------------------------------------------------------
REG AH = 32H - - Get "DOS Disk Block"
Cf C.Petzold, PC Mag. Vol.5,no.8
On Entry: AH = 32h
DL = Number of Disk Drive (0=default, 1=A, etc)
On Return: AL = 00 if drive exists, FFh for invalid drive
DS:BXPointer to DOS Disk Block
Description of DOS Disk Block:
OffsetTypeData
----------------------------
00DB Drive: 0=A, 1=B, etc
01DBUnit within driver (0,1,2,etc)
02DWBytes per sector
04DBSectors per cluster - 1
05DBCluster to sector shift
06DWNo.of reserved sectors
08DBNo.of FATs
09DWNo. of root directory entries
0BDWSector no.of cluster 2 (1st data cluster)
0DDWNumber of clusters +1 (last cluster no.)
0FDBSectors for FAT
10DWSector number of directory
12DDAddress of device header
16DBMedia descriptor byte
17DB0 if disk has been accessed
18DDAddress of next DOS Disk Block (FFFF if last)
22DBCurrent Working Directory (2.0 only) (64 bytes)
-----------------------------------------------------------
REG AH = 34H - - Return DOS Callable Vector
On Return: ES:BX contains DOS Callable Vector
When byte pointed to by this vector is non-zero, a DOS
function call is in progress. DOS is non-reentrant due to
its use of internal stacks (see Interrupt 28h, below),
and must not be called if this byte is non-zero.
In DOS 3.10 changed to word value, with preceeding byte.If
ES:BX contain address, proc is:
push ES
pop DS
mov SI,BX
dec SI
lodsw
xchg AL,AH
cmp AX,1
-----------------------------------------------------------
REG AH=37h - - multifunction (MSDOS generic)
AL=0Read switch character (returns current character in DL)
1Set switch character (specify new character in DL)
2Read device availability (as set by function AL=3)
3Set device availability, where:
DL=0 means /DEV/ must preceed device names
DL#0 means /DEV/ need not preceed device names
Returns: DL =Switch character (if AL=0 or 1)
Device availability flag (if AL=2 or 3)
Error return: AL=0FFh means the value in AL was not in the range 0-3.
Note: Functions 2 & 3 appear not to be implemented for dos 3.x
-----------------------------------------------------------
REG AH = 45H - - Dup
On Entry: As documented in DOS manual
On Return: Ditto
More useful than documentation suggests. See Software
Toolbox Column in Dr.Dobb's Journal, June 1986, by Ray
Duncan, for details. Important function is to update
a directory without closing current file, to prevent
embarassing crashes. Dup your file handle, close the
duplicated file.
-----------------------------------------------------------
REG AH = 46H - - Forcdup
On Entry: As documented in DOS manual
On Return: Ditto
More useful than documentation suggests. See Software
Toolbox Column in Dr.Dobb's Journal, June 1986, by Ray
Duncan, for details. Important function is to control
behaviour of child processes created with EXEC function.
-----------------------------------------------------------
REG AH = 50H - - Set Current PSP Segment
On Entry: Reg BX = Segment address of new PSP
On Return: No return codes - swaps PSP's regarded as current by DOS
Open File information, etc is stored in the PSP DOS views as
current. If a program (eg a resident program) creates a need
for a second PSP, then the second PSP should be set as current
to make sure DOS closes that as opposed to the first when the
second application finishes. See PC Mag Vol.5, No 9, p.314 for
discussion.
-----------------------------------------------------------
REG AH = 51H - - Get PSP Segment (MSDOS generic)
On Return: BX = Current PSP Segment
Used as complement to Function AH = 50h
-----------------------------------------------------------
REG AH = 52H - - Get Pointer to "DOS Disk Block" for Drive A:
(Cf Function AH=32)
On Return: ES:BXPointer to DOS Disk Block for Drive A:
-----------------------------------------------------------
REG AH = 53H - - Translate BPB Table to "DOS Disk Block"
On Return: DS:SIPointer to BIOS Parameter Block
ES:BPPointer to DOS Disk Block
-----------------------------------------------------------
REG AH = 55H - - Create PSP (MSDOS generic)
Like Function AH = 26H but creates "child" PSP rather
than copying existing one.
==========================================================================
INT 28 - Internal routine for MSDOS
This interrupt is continuously called by DOS itself whenever it is
in a wait state (i.e., when it is waiting for keyboard input) during
a function call of 01h through 0Ch. DOS uses 3 separate internal
stacks: one for calls 01h through 0Ch; another for calls 0Dh and
above; and a third for calls 01h through 0Ch when a Critical Error
is in progress. When Interrupt 28h is called, any calls above 0Ch
can be executed without destroying the internal Stack used by DOS
at the time.
It is used primarily by the PRINT.COM routines, but any number of
other routines could be chained to it by saving the original vector,
and calling it with a FAR call (or just JMPing to it) at the end of
the new routine. Until PRINT.COM installs its own routine, this
interrupt vector simply points to an IRET opcode. It is used in
many memory resident routines which themselves call DOS, and usually
used in conjunction with Interrupt 21h, Function AH = 32h.
DEBUG itself uses DOS call 0Ah for keyboard input, so you can end up
in an endless loop if you are not careful.
==========================================================================
INT 29 - Internal routine for MSDOS
* This interrupt is called from the DOS output routines
if output is going to a device rather than a file, and the
device driver's attribute word has bit 3 (04H) set to "1".
Nothing more is known about it.
==========================================================================
December 28, 2017
Add comments