From e8c6577617bffa4402c07c7aa20e3c24f03c1c20 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sun, 6 Sep 2020 00:48:07 -0400 Subject: program loading, others big kernel additions: paging, elf loading, separate kernel and user page allocation it now properly loads and runs sd0:bin/init.elf still need to determine which disk was booted from, and start the init on that disk --- doc/ints.txt | 52 +++++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 25 deletions(-) (limited to 'doc/ints.txt') diff --git a/doc/ints.txt b/doc/ints.txt index 1da08fd..2a97049 100644 --- a/doc/ints.txt +++ b/doc/ints.txt @@ -1,30 +1,32 @@ -int 0x30 - exit task -int 0x31 - yield to scheduler -int 0x33 - extend data section by eax bytes - actual amount extended returned in eax +quit task is int 0x38 -int 0x32 - system call + +yield task is int 0x39 +eax is cleared on yield + + +syscall is int 0x30 system call number in eax args in ebx, ecx, edx, esi, edi result in eax + note: do not assume eax is unmodified if there is no value to be returned +modifies ecx, edx + +file system calls have units of bytes unless otherwise specified +functions returning handles or pointers use 0 to indicate error +functions returning "success" use 1 for success and 0 for failure +see keys.txt for the return type of the "get key" system call + +invalid system call numbers change eax to -1, and have no other effect. + - function | eax | eax out | ebx | ecx | edx | esi | edi ----------------|-----|-----------|---------------|--------|--------|-----|----- - vga_blank | 0x0 | | | | | | - vga_set_color | 0x1 | | color | | | | - vga_printch | 0x2 | | char | | | | - vga_printsz | 0x3 | | sz string | | | | - vga_printsn | 0x4 | | non-sz string | length | | | - | | | | | | | - fs_open | 0x5 | handle | path | | | | - fs_open_root | 0x6 | handle | | | | | - fs_new | 0x7 | handle | path | | | | - fs_close | 0x8 | | handle | | | | - fs_delete | 0x9 | | path | | | | - fs_exists | 0xa | does | path | | | | - fs_seek | 0xb | seeked by | handle | by | | | - fs_tell | 0xc | position | handle | | | | - fs_read | 0xd | read | handle | max | buffer | | - fs_write | 0xe | written | handle | max | buffer | | - | | | | | | | - plef_run | 0xf | handle | image path | | | | \ No newline at end of file + function | eax | eax out | ebx | ecx | edx | esi | edi +---------------|-----|---------------|---------------|-------------|-------|--------|----- + open file | 0x0 | handle | drive number | path | | | + close file | 0x1 | | handle | | | | + file read | 0x2 | read | handle | file offset | count | buffer | + get file size | 0x3 | size | handle | | | | + start task | 0x4 | success | drive number | path | | | + log string | 0x5 | | sz string | | | | + get key | 0x6 | keycode | | | | | + allocate ram | 0x7 | start pointer | pages | | | | \ No newline at end of file -- cgit v1.2.3