From 44f9642bfc9ce9f740d508670befb569e06621a2 Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Mon, 19 Oct 2026 11:06:32 -0400 Subject: add debug console. start work on userland pagedir manipulation tools --- doc/syscall.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'doc/syscall.md') diff --git a/doc/syscall.md b/doc/syscall.md index 6d7583f..aa2fd1f 100644 --- a/doc/syscall.md +++ b/doc/syscall.md @@ -220,6 +220,9 @@ Successful links return 0. | Syscall | Target Permissions | Subject Permissions | Subject Conditional Permissions | |-----------------------------|:-------------------------------:|:-------------------------------------------------:|:-------------------------------:| +| SYSCALL_PAGEDIR_GET_MAPPING | JOVE_PERM_READ, JOVE_PERM_WRITE | | + | +| SYSCALL_PAGEDIR_TRANSFER | JOVE_PERM_READ, JOVE_PERM_WRITE | JOVE_PERM_READ, JOVE_PERM_WRITE | | | 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 | @@ -228,6 +231,48 @@ Successful links return 0. | SYSCALL_PAGEDIR_UNMAP_SHMEM | JOVE_PERM_READ, JOVE_PERM_WRITE | | | +#### SYSCALL_PAGEDIR_GET_MAPPING + +Returns the mapping information for the given virtual address in a machine-agnostic format. + +| Data | Virtual address | +|--------------|-----------------| +| Size (bytes) | sizeof(void*) | + +If the virtual address exceeds `JOVE_USERMEMORY_LIMIT`, the kernel will return `-EOOB`. + +If the page directory does not contain a page table for the given address, the kernel will return `-ENOMAP`. + +Successful calls populate the message buffer with the mapping information and returns `0`. + +| Data | Mapping information | +|--------------|----------------------------------------| +| Size (bytes) | sizeof(struct syscall_pagedir_mapping) | + + +#### SYSCALL_PAGEDIR_TRANSFER + +Moves a page mapping from one page directory to another. + +In the target pagedir: the entry data is cleared. + +In the subject pagedir: the entry data is replaced by the target entry data. + +| Data | Target Address | Subject Address | Subject Path Length | Subject Path | +|--------------|----------------|-----------------|------------------------|----------------------------------------------| +| Size (bytes) | sizeof(void*) | sizeof(void*) | sizeof(objpath_part_t) | sizeof(objpath_part_t) * subject_path_length | + +If the subject path does not point to a `JOVE_OBJ_PAGEDIR` object, the kernel will return `-EBADOBJ`. + +If the target/subject address exceeds `JOVE_USERMEMORY_LIMIT`, the kernel will return `-EOOB`. + +If the target directory does not have a page table for the target address, the kernel will return `-ENOMAP`. + +If the subject directory does not have a page table for the subject address, the kernel will return `-ENOMAP`. + +If the subject mapping is marked as present, the kernel will return `-EHASMAP`. + + #### SYSCALL_PAGEDIR_MAP_FRAME Attempts to map a given untyped memory span to the given virtual address with passed permissions. -- cgit v1.2.3