Chapter
1
I
System
Calls
Note that all open files of a process are duplicated in the
child process after an Exec call. This is extremely power-
ful; the parent process has control over the meanings of
stdin, stdout, stderr, stdaux, and stdprn. The parent could,
for example, write
a
series of records to
a
file, open the
file as standard input, open
a
listing file as standard out-
put, and then Exec
a
sort program that takes its input
from stdin and writes to stdout.
Also inherited (or passed from the parent) is an “environ-
ment.” This is a block
of
text strings (less than
32K
bytes total) that convey various configuration parameters.
The format of the environment
is
as follows:
(paragraph boundary)
BYTE ASCIIZ string
2
I
...
BYTE ASCIIZ string n
BYTE of zero
Typically the environment strings have the form:
parameter
=
value
For example, COMMAND.COM might pass
its
execution
search path
as:
PATH
=
A: B1N;B: BASIC LIB
A zero value of the environment address causes the child
process to inherit a copy of the parent’s environment
unchanged.
Entry Conditions:
AH
=
4BH
DS:DX
=
pointer to
ASCIIZ
pathname
ES:BX
=
pointer to parameter
block
AL
=
function
code
OOH
=
load and execute program
03H
=
load program
~
127