From 6da70f16c584ee897a4ac4f51d016a615c84042b Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Fri, 18 Sep 2026 15:46:18 -0400 Subject: cleanup for real hw attempt --- api/error.h | 2 ++ api/init.h | 7 ++++++- api/obj.h | 2 +- api/syscall.h | 31 +++++++++++++++++++++++++++++++ 4 files changed, 40 insertions(+), 2 deletions(-) (limited to 'api') diff --git a/api/error.h b/api/error.h index 229c6c8..5e0e936 100644 --- a/api/error.h +++ b/api/error.h @@ -13,5 +13,7 @@ #define EALIGN 10 #define EEXIST 11 #define EBUSY 12 +#define EEMPTY 13 +#define EFULL 14 #endif diff --git a/api/init.h b/api/init.h index d23327f..ef538b4 100644 --- a/api/init.h +++ b/api/init.h @@ -6,14 +6,19 @@ enum { ROOTDIR_PROCESSORS_I, ROOTDIR_PAGEDIR_I, ROOTDIR_UNTYPED_I, + ROOTDIR_HWMEMORY_I, ROOTDIR_PCB_I, ROOTDIR_IOPB_I, - ROOTDIR_ACPI_I, ROOTDIR_INTERRUPTS_I, ROOTDIR_INITRD_I, ROOTDIR_MESSAGE_I, }; +struct init_payload +{ + void *rsdp; +}; + #define ROOTDIR_SERIAL_COM_I 0x80 #define ROOTDIR_FRAMEBUFFER_I 0x81 #define ROOTDIR_VIRTTERM_I 0x82 diff --git a/api/obj.h b/api/obj.h index 10f7b65..04513c1 100644 --- a/api/obj.h +++ b/api/obj.h @@ -10,7 +10,7 @@ enum JOVE_OBJ_OBJDIR, JOVE_OBJ_PAGEDIR, JOVE_OBJ_PROCESSOR, - JOVE_OBJ_ACPI_TABLE, + JOVE_OBJ_HWMEMORY, JOVE_OBJ_INT_HANDLE, JOVE_OBJ_PROCESS, JOVE_OBJ_INITRD_FILE, diff --git a/api/syscall.h b/api/syscall.h index 8c35270..4bb2eb2 100644 --- a/api/syscall.h +++ b/api/syscall.h @@ -115,6 +115,37 @@ struct syscall_pagedir_map objpath_part_t untyped_path[]; }; +/**If a page frame is present at the virtual address, the kernel will: + * mark the page frame as not present. + * untype the page frame and move it to the none path. + * return 0. + * If a page frame is not present at the virtual address, the kernel will return EEMPTY. + * Follows the rules defined by struct syscall_pagedir_unmap + * */ +#define SYSCALL_PAGEDIR_UNMAP_FRAME 2 + +/**If a page table is present at the virtual address, one of two things will happen: + * If the page table has present entries, the kernel will return EBUSY. + * Otherwise, the kernel will: + * mark the page table as not present. + * untype the page frame and move it to the none path. + * return 0. + * If a page table is not present at the virtual address, the kernel will return EEMPTY. + * Follows the rules defined by the struct syscall_pagedir_unmap + * */ +#define SYSCALL_PAGEDIR_UNMAP_TABLE 3 + +/**If the virtual address is above JOVE_USER_MEMORY_LIMIT, the kernel will return EBADARG. + * If none_pathlen exceeds the length of the message, the kernel will return ETOOBIG. + * If none_path does not point to a JOVE_OBJ_NONE object, the kernel will return EBADOBJ. + * */ +struct syscall_pagedir_unmap +{ + uintptr_t virtual_address; + uint16_t none_pathlen; + objpath_part_t none_path[]; +}; + #define SYSCALL_VTT_WRITE 0 #endif -- cgit v1.2.3