From fbc0a09d85fcf60cda63934791d477a012c35ec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kyle=20J=C2=A0Cardoza?= Date: Mon, 8 Jul 2024 17:24:17 -0400 Subject: [PATCH] Documentation of kernel API --- doc/syscalls.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/doc/syscalls.md b/doc/syscalls.md index 17bc8fe..f3b7200 100644 --- a/doc/syscalls.md +++ b/doc/syscalls.md @@ -225,4 +225,33 @@ string, which must contain a fully-qualified pathname -- something of the form `[drive]:/[dir]/[dir2]/filename.ext`, such as `sd0:/games/kaboom/readme.ansi`. If the file is successfully opened, the carry flag will be cleared and the C -accumulator will contain the file handle. On error, the carry flag will be \ No newline at end of file +accumulator will contain the file handle. On error, the carry flag will be + +## 0x0E: Close File + +Arguments: + C: 0x0E + X: File handle + +Return Values: + C: Error code + +This call attempts to close the file referred to by the provided file handle. +On success, the carry flag will be cleared, and the C accumulator will contain +a status code of 0x0000. On error, the carry flag will be set, and the C +accumulator will contain an error code. + +## 0x0F: Duplicate File Handle + +Arguments: + C: 0x0F + X: File handle + +Return Values: + C: File handle or error code + +This call attempts to duplicate the provided file handle. The new file handle +will be exactly identical to the provided one, and either may be used at any time. +On success, the carry flag will be cleared, and the C accumulator will contain +the duplicate file handle. On error, the carry flag will be set, and the C +accumulator will contain an error code. \ No newline at end of file