Chapter
3
MS-DOS
INITIALIZATION AND
COMMAND
PROCESSOR
When the system is reset or started with an MS-DOS disk in
Drive
A,
the ROM (Read Only Memory) bootstrap gains control.
The boot sector is read from the disk into memory and given
control. The IOSYS and MSDOS.SYS files are then read into
memory, and the boot process begins.
The
Command
Processor
The command processor supplied with MS-DOS (file COM-
MAND.COM) consists
of
three parts:
0
A resident portion resides in memory immediately following
MSDOS.SYS and its data area. This portion contains routines
to
process Interrupts
23H
(CONTROL-C Exit Address) and
24H
(Fatal Error Abort Address), as well as a routine to re-
load the transient portion,
if
needed. All standard MS-DOS er-
ror handling is done within this portion of COMMAND.COM,
including the display of error messages and processing the
Abort, Retry, or Ignore message replies.
An initialization portion follows the resident portion. During
start-up, the initialization portion is given control. It contains
the AUTOEXEC file processor setup routine. The initializa-
tion portion determines the segment address at which pro-
grams can be loaded. It is overlaid by the first program
COMMAND.COM loads because
it
is no longer needed.
e
A transient portion is loaded at the high end
of
memory. This
part contains all of the internal command processors and the
batch file processor. The transient part of the command pro-
cessor produces the system prompt (such as A>), reads the
command from the keyboard (or batch file), and causes the
command to be executed. For external commands, it builds a
command line and issues the EXEC function call (function
call
4BH)
to load and transfer control
to
the program.
161