Added kinfo, reduced global state

This commit is contained in:
ssimnb 2026-02-23 12:57:09 +01:00
parent 2213707c6a
commit e72c8fe6fd
30 changed files with 510 additions and 574 deletions

View file

@ -1,5 +1,15 @@
#pragma once
#include <stdint.h>
void kkill(void);
typedef struct kernel_info {
char *cmdline; // kernel commandline options (maybe split into char**'s?)
uint64_t hhdmoffset; // HHDM offset
uint64_t cpu_count; // number of cpus
uint64_t usable_memory; // amount of usable memory the system has
uint64_t bsp_id; // id of the bsp cpu
int64_t boot_timestamp; // timestamp at boot
} kernel_info;
typedef char link_symbol_ptr[];
@ -17,4 +27,6 @@ typedef char link_symbol_ptr[];
#define SIZE_IN_PAGES(size) size/PAGE_SIZE
void *kmalloc(uint64_t size);
struct kernel_info *get_kinfo();
void initialize_kinfo();
void kkill(void); // phase this out in favor of assert