diff options
author | Benji Dial <benji@benjidial.net> | 2024-07-27 16:57:39 -0400 |
---|---|---|
committer | Benji Dial <benji@benjidial.net> | 2024-07-27 16:57:39 -0400 |
commit | fbfc078e9f44c1c1e95c9c484f1d5650bcf631b7 (patch) | |
tree | cab539c8cbbac81d895b6f8be695f3f53bf8f4d5 /documentation | |
parent | 9af5588c30c4126a2800aae1afcb0de2c373dc6c (diff) | |
download | hilbert-os-fbfc078e9f44c1c1e95c9c484f1d5650bcf631b7.tar.gz |
lots and lots of userspace stuff
Diffstat (limited to 'documentation')
-rw-r--r-- | documentation/compositor.txt | 2 | ||||
-rw-r--r-- | documentation/euler/heap.txt | 32 | ||||
-rw-r--r-- | documentation/kernel-interfaces/syscalls.txt | 25 | ||||
-rw-r--r-- | documentation/kernel/panics.txt | 1 |
4 files changed, 27 insertions, 33 deletions
diff --git a/documentation/compositor.txt b/documentation/compositor.txt index 7442d51..4d8e70f 100644 --- a/documentation/compositor.txt +++ b/documentation/compositor.txt @@ -13,7 +13,7 @@ data types: color: opaque dword (result of encode color system call). - from c++, use __euler_encode_color in euler/syscall.hpp. + from c++, use euler::syscall::encode_color in euler/syscall.hpp. color rectangle: multiple hilbert colors, top to bottom by row, left to right within row diff --git a/documentation/euler/heap.txt b/documentation/euler/heap.txt deleted file mode 100644 index de1deec..0000000 --- a/documentation/euler/heap.txt +++ /dev/null @@ -1,32 +0,0 @@ -this file documents dynamic memory allocation and deallocation in userspace. -the unused areas of a process's usable mapped memory are divided into "chunks" -with a start and a length, satisfying the following properties: - a) the length of a chunk is a positive power of 2 - b) the start of a chunk is a multiple of its length - c) let s be a power of 2 and k be an integer. there are never two chunks with - length s and starts s * (2 * k) and s * (2 * k + 1). if ever an operation - would result in two such chunks, they are combined into one chunk with - length 2 * s and start 2 * s * k. - -a "chunk info page" is divided into 512 64-bit integers describing up to 255 -chunks and a pointer to another chunk info page. for each n from 0 to 254: - if the (2 * n)'th integer (where the first integer is the 0th one) is 0: - the (2 * n + 1)'th integer is unused. - if the (2 * n)'th integer is not 0: - the (2 * n)'th integer describes the length of a chunk - the (2 * n + 1)'th integer describes the start of the same chunk -the 510th integer is a pointer to the next chunk info page, and the 511th -integer is never used. - -when a program calls new or malloc with needed size s, we find a free chunk of -length at least s + 8. we then remove that chunk from the list of free chunks, -and add back in whatever is left after the first s + 8 bytes, if anything. -in the first 8 bytes of the original chunk, we store the value s + 8. the -remainder of the orginal chunk is returned to the program. - -during that process, if there isn't a chunk with the needed size, one or more -new pages are requested from the kernel to create such a chunk. - -when a program calls delete or free with pointer ptr, we read the integer in -the 8 bytes starting at ptr - 8 into a variable s. we then add the region -starting at ptr - 8 with length s to the free memory. diff --git a/documentation/kernel-interfaces/syscalls.txt b/documentation/kernel-interfaces/syscalls.txt index ca93b56..399eb19 100644 --- a/documentation/kernel-interfaces/syscalls.txt +++ b/documentation/kernel-interfaces/syscalls.txt @@ -20,6 +20,7 @@ stream result: 12 = other end closed 13 = already exists 14 = not sized + 15 = not readable encode color: rax in: 0 @@ -173,3 +174,27 @@ get other end process handle: rdi in: stream handle rax out: stream result rdi out: process handle (if rax = success) + +start thread: + rax in: 20 + rdi in: entry point + rsi in: argument + at entry, rsp is set to the top of a new stack, rdi is set + to the argument, and the other registers are undefined. + +clear socket read queue: + rax in: 21 + rdi in: stream handle + rax out: number of bytes cleared (0 on bad handle or not a socket) + +get environment variable length: + rax in: 22 + rdi in: pointer to variable name + rsi in: variable name length + rax out: variable value length, or -1 if unset + +get environment variable value: + rax in: 23 + rdi in: pointer to variable name + rsi in: variable name length + rdx in: pointer to buffer for variable value diff --git a/documentation/kernel/panics.txt b/documentation/kernel/panics.txt index e1b6ec1..5c09490 100644 --- a/documentation/kernel/panics.txt +++ b/documentation/kernel/panics.txt @@ -3,6 +3,7 @@ panic. the following are the defined colors so far: #48a6ed - failed to get root node of initfs #5f8860 - no initfs module was given #7e874d - failed to look up /bin/init + #8077a6 - pure virtual function called (i think this should never happen?) #9af5e6 - an unimplemented path in the kernel #ba40bb - cpu exception occurred #c39db3 - failed to parse /bin/init |