diff options
author | Jon Santmyer <jon@jonsantmyer.com> | 2025-07-30 14:32:01 -0400 |
---|---|---|
committer | Jon Santmyer <jon@jonsantmyer.com> | 2025-07-30 14:32:01 -0400 |
commit | b905869a35f062a4e5072f10bec3a2ba3db0e365 (patch) | |
tree | 0666691804878857b4bb07daca8a54f5ddb8ae0b /include/object.h | |
download | jove-kernel-b905869a35f062a4e5072f10bec3a2ba3db0e365.tar.gz jove-kernel-b905869a35f062a4e5072f10bec3a2ba3db0e365.tar.bz2 jove-kernel-b905869a35f062a4e5072f10bec3a2ba3db0e365.zip |
working userland with some invoke syscalls
Diffstat (limited to 'include/object.h')
-rw-r--r-- | include/object.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/include/object.h b/include/object.h new file mode 100644 index 0000000..0a71b5f --- /dev/null +++ b/include/object.h @@ -0,0 +1,61 @@ +#ifndef _JOVE_OBJECT_H +#define _JOVE_OBJECT_H + +#include <stdint.h> + +#if defined(__x86_64__) +#include "arch/x86_64/object.h" +#endif + +enum +{ + /* Generic objects */ + KO_NONE = 0, + KO_OBJECT_DIRECTORY, + KO_INIT_DATA, + KO_MEMORY_UNTYPED, + KO_MEMORY_MAPPED_PAGE, //4KiB Fixed Width + KO_MEMORY_MAPPING_PAGE, //4Kib Fixed Width + KO_INITRD_FILE, + KO_TCB, + KO_KERNEL_STACK, + KO_MESSAGE, + /* Device objects*/ + KO_DEV_INVALID = 0x100, + KO_DEV_PROCESSOR, + KO_DEV_UART +}; + +typedef uintmax_t obj_path_t; +typedef uint16_t obj_type_t; + +typedef struct jove_ObjectDirectoryEntry +{ + obj_type_t type; + union { + struct { + char lock : 1; + char u0 : 7; + char u1; +}; + unsigned short flg; + }; + uintmax_t data; +} objdir_entry_t; + +#define OBJECT_DIRECTORY_MAX_ENTRIES 256 + +//The first entry always represents itself, which allows the kernel to ignore +//some checks. +//The data variable also contains the next free index for this directory. +typedef struct jove_ObjectDirectory +{ + union { + objdir_entry_t self; + objdir_entry_t entries[OBJECT_DIRECTORY_MAX_ENTRIES]; + }; +} objdir_t; + +objdir_entry_t *objdir_seek(objdir_t *dir, uintmax_t index); + +#endif |