summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/syscall.md60
1 files changed, 56 insertions, 4 deletions
diff --git a/doc/syscall.md b/doc/syscall.md
index 9304785..3bfa00b 100644
--- a/doc/syscall.md
+++ b/doc/syscall.md
@@ -8,9 +8,9 @@ To resolve the message object, the kernel requires an object path and a path len
On x86_64, the encoding is as follows:
-| | Message Path | Message Path Length |
-|----------|--------------|---------------------|
-| Register | rdi | rsi |
+| Message Path | Message Path Length |
+|--------------|---------------------|
+| rdi | rsi |
If the message path exceeds the width of the message path register, the kernel will return `-EBADPATH`.
@@ -118,7 +118,7 @@ If the entry index exceeds `JOVE_OBJDIR_ENTRIES`, the kernel returns `-EOOB`.
|-----------------------------|:-------------------------------:|:-------------------------------------------------:|:-------------------------------:|
| SYSCALL_PAGEDIR_MAP_FRAME | JOVE_PERM_READ, JOVE_PERM_WRITE | JOVE_PERM_MUTATE | JOVE_PERM_READ, JOVE_PERM_WRITE |
| SYSCALL_PAGEDIR_MAP_TABLE | JOVE_PERM_READ, JOVE_PERM_WRITE | JOVE_PERM_READ, JOVE_PERM_WRITE, JOVE_PERM_MUTATE | |
-| SYSCALL_PAGEDIR_MAP_SHMEM | JOVE_PERM_READ, JOVE_PERM_WRITE | | JOVE_PERM_READ, JOVE_PERM_WRITE |
+| SYSCALL_PAGEDIR_MAP_SHMEM | JOVE_PERM_READ, JOVE_PERM_WRITE | JOVE_PERM_READ | JOVE_PERM_WRITE |
| SYSCALL_PAGEDIR_UNMAP_FRAME | JOVE_PERM_READ, JOVE_PERM_WRITE | | |
| SYSCALL_PAGEDIR_UNMAP_TABLE | JOVE_PERM_READ, JOVE_PERM_WRITE | | |
| SYSCALL_PAGEDIR_UNMAP_SHMEM | JOVE_PERM_READ, JOVE_PERM_WRITE | | |
@@ -262,3 +262,55 @@ If the virtual address does not have a page frame associated with it, the kernel
If the page frame pointed to by virtual address does not correspond to a shared memory frame, the kernel will return `-EBADOBJ`.
Successful unmapping returns `0`.
+
+### JOVE_OBJ_INITRD_FILE
+
+| Syscall | Target Permissions |
+|--------------------------|--------------------|
+| SYSCALL_INITRD_FILE_NAME | JOVE_PERM_READ |
+| SYSCALL_INITRD_FILE_SIZE | JOVE_PERM_READ |
+| SYSCALL_INITRD_FILE_READ | JOVE_PERM_READ |
+
+#### SYSCALL_INITRD_FILE_NAME
+
+Populates the message with the name of the target file.
+
+Names start with a size_t length specifier, which is followed by a NULL-terminated c-string.
+
+| Data | Name Length | Name | Null Terminator |
+|--------------|----------------|-------------|-----------------|
+| Size (bytes) | sizeof(size_t) | Name Length | 1 |
+
+
+If the message is too small for the file name, the kernel will return `-ETOOSMALL`.
+
+#### SYSCALL_INITRD_FILE_SIZE
+
+Returns the size of the target file in bytes.
+
+#### SYSCALL_INITRD_FILE_READ
+
+Populates the message with the bytes read from the target file.
+
+##### Payload
+
+| Data | Starting index | Read size |
+|--------------|----------------|----------------|
+| Size (bytes) | sizeof(size_t) | sizeof(size_t) |
+
+##### Return
+
+| Data | Data |
+|--------------|-----------|
+| Size (bytes) | Read size |
+
+
+If the message is too small for the syscall payload, the kernel will return `-ETOOSMALL`.
+
+If the starting index exceeds the file length, the kernel will return `-EOOB`.
+
+If the read size + starting index > file size, the kernel will return `-EOOB`.
+
+If the message is too small for the read bytes, the kernel will return `-ETOOBIG`.
+
+Successful reading returns `0`.