Chapter
1
I
System Calls
Console, Printer, and Disk InputiOutput Calls
The console and printer system calls let you interface with the
console device and the printer without using machine-specific
codes. You will still be able to take advantage
of
specific capabil-
ities (such as clear the screen or position the cursor on your dis-
play
or
double-strike and underline on your printer). You do this
by using constants for the required codes and reassembling with
the correct constant values for the attributes.
Many system calls that perform disk input and output require
the placing
of
values into
or
the reading
of
values from
2
system
control blocks: the File Control Block (FCB) and the directory
entry. For a description
of
the FCB, see the section “File Control
Block’ in Chapter
2.
For details on the directory entry, see
“Disk Directory” in Chapter 4.
Hierarchical Directories
MS-DOS supports hierarchical (tree-structured) directories, sim-
ilar
to
those found in the
XENIX
operating system. (For infor-
mation on tree-structured directories, refer
to
the MS-DOS
User’s Guide.)
The following system calls are compatible with the
XENIX
system:
Function 39H
Function 3AH
Function 3BH
Function 3CH
Function 3DH
Function 3FH
Function 40H
Function 41H
Function 42H
Function 43H
Function 44H
Function 45H
Function 46H
Function 4BH
Function 4CH
Function 4DH
create a subdirectory
remove
a
directory entry
change the current directory
create
a
file
open a file
read from a file
or
device
write to a file
or
device
delete
a
directory entry
move a file pointer
change attributes
110
control for devices
duplicate a file handle
force
a
duplicate
of
a
file handle
load and execute a program
terminate a process
retrieve the return code
of
a child
process
10