Added documentation.

This commit is contained in:
Kyle J Cardoza 2024-07-08 00:42:08 -04:00
parent 40a3f39981
commit c3a65f105f
3 changed files with 14 additions and 22 deletions

View File

@ -1,22 +0,0 @@
# Shells
Turaco-DOS reserves a portion of main memory for a "shell", a
program which exists to load and run other programs, and handle
their return values. This shell might be a command line, or some
other program that manages other programs, such as a batch file
interpreter.
The active shell has a "resident" portion of memory, which stays
in memory as long as the shell is active, and a "transient" portion
of memory which is only used while the shell is not running an
external program.
When the shell runs a program, and that program exits, its main
function returns a two-byte value; this value is stored in a
specific memory address, and used by the shell as the "status"
code for the program's exit. Like Unix, a zero value is considered
a normal exit, with any positive value being some type of error.
Additionaly, when running a program, the shell can provide the
program with a sequence of arguments, which populate the two
arguments to the main() function.

10
doc/syscalls.md Normal file
View File

@ -0,0 +1,10 @@
# System Calls
The system API is exposed to user code using the COP interrupt.
The high byte of the C accumulator is loaded with a function number;
the other registers are loaded with call-specific data (or nothing),
and any return values are placed in the same registers.
What follows is a list of the system calls, their numbers, and
register arguments they take, and what if any values they return.

View File

@ -50,6 +50,10 @@ int file_init(char *pathname, struct file *file);
int file_open(struct file *file); int file_open(struct file *file);
int file_ioctl(struct file *file,
unsigned short operation,
void *arg);
// Closes an open file, given a unique ID. // Closes an open file, given a unique ID.
int file_close(struct file *file); int file_close(struct file *file);