diff options
author | Benji Dial <benji@benjidial.net> | 2024-01-13 16:43:49 -0500 |
---|---|---|
committer | Benji Dial <benji@benjidial.net> | 2024-01-13 16:43:49 -0500 |
commit | 4130562b1555cabe441efe9420cebe12e7ed8d39 (patch) | |
tree | beaf0012373aab2c3a13fe0147a5cda4af28ef78 /documentation/syscalls.txt | |
parent | 882e74b2191c059a9226cbd8bcb51c97da36247c (diff) | |
download | hilbert-os-4130562b1555cabe441efe9420cebe12e7ed8d39.tar.gz |
application loading
Diffstat (limited to 'documentation/syscalls.txt')
-rw-r--r-- | documentation/syscalls.txt | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/documentation/syscalls.txt b/documentation/syscalls.txt new file mode 100644 index 0000000..cbba5e3 --- /dev/null +++ b/documentation/syscalls.txt @@ -0,0 +1,27 @@ +on application entry: + there is a 1MiB - 8KiB area mapped writable and not + executable with guard pages on either side, and rsp is + set to the top of that. all other registers are set to 0. + +for all system calls: + rax, rdi, rsi, rdx are in/out paramters. + rbx, rbp, rsp, r12-r15 are preserved. + rcx, rflags, r8-r11 are clobbered. + +encode color: + rax in: 0 + edi in: r + g * 256 + b * 65536 + eax out: encoded color + +get framebuffer: + rax in: 1 + rax out: pointer to framebuffer + rdi out: width + height * 2 ** 32 + esi out: pitch + framebuffer is always 32 bpp. use the encode color syscall + to encode colors. pitch is in dwords, not in bytes. + +draw framebuffer: + rax in: 2 + this draws changes to the framebuffer gotten by the get framebuffer + system call. (currently, the entire thing is copied, not just changes.) |