From f5f0f5ddae199121daebcd2213aabd81686cc074 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Tue, 24 Dec 2019 22:31:22 -0500 Subject: start of 0.0.9 branch, using multiboot this time --- src/kernel/mem.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/kernel/mem.h') diff --git a/src/kernel/mem.h b/src/kernel/mem.h index 2bfb3bf..1eb27bd 100644 --- a/src/kernel/mem.h +++ b/src/kernel/mem.h @@ -22,8 +22,21 @@ OF THIS SOFTWARE. #ifndef MEM_H #define MEM_H -#define MMAP ((uint16_t *)0x00002000) -void *allocate_pages(uint16_t n_pages, uint16_t proc_n); -void deallocate_pages(void *from, uint16_t n_pages); +enum special_mmap_codes { + FREE = 0, + HARDWARE = 1, + KERNEL = 2 +}; + +struct mmap_entry { + uint64_t base; + uint64_t length; + uint32_t whose; + struct mmap_entry *next; +} __attribute__ ((__packed__)); + +struct mmap_entry *mmap_start; +void *allocate_block(uint32_t size, uint16_t proc_n); +void deallocate_block(void *start); #endif \ No newline at end of file -- cgit v1.2.3