From c3a65f105f3be13ad0d0d68a49bba812ee60af76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kyle=20J=C2=A0Cardoza?= Date: Mon, 8 Jul 2024 00:42:08 -0400 Subject: [PATCH] Added documentation. --- doc/shells.md | 22 ---------------------- doc/syscalls.md | 10 ++++++++++ include/kernel/file.h | 4 ++++ 3 files changed, 14 insertions(+), 22 deletions(-) delete mode 100644 doc/shells.md create mode 100644 doc/syscalls.md diff --git a/doc/shells.md b/doc/shells.md deleted file mode 100644 index 82cf7e5..0000000 --- a/doc/shells.md +++ /dev/null @@ -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. diff --git a/doc/syscalls.md b/doc/syscalls.md new file mode 100644 index 0000000..e414c3e --- /dev/null +++ b/doc/syscalls.md @@ -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. + diff --git a/include/kernel/file.h b/include/kernel/file.h index 88194d7..b6bfbef 100644 --- a/include/kernel/file.h +++ b/include/kernel/file.h @@ -50,6 +50,10 @@ int file_init(char *pathname, 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. int file_close(struct file *file);