From e301006c1494674d94e1bcedcd3c3a638af7ec00 Mon Sep 17 00:00:00 2001 From: Danny Holman Date: Sun, 26 Nov 2023 18:49:11 -0600 Subject: arch: i386: alloc: add a physical memory manager Add a simple, bitmap-based physical memory management system. Signed-off-by: Danny Holman --- arch/i386/include/kernel/alloc.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 arch/i386/include/kernel/alloc.h (limited to 'arch/i386/include') diff --git a/arch/i386/include/kernel/alloc.h b/arch/i386/include/kernel/alloc.h new file mode 100644 index 0000000..986bcc5 --- /dev/null +++ b/arch/i386/include/kernel/alloc.h @@ -0,0 +1,13 @@ +#ifndef I386_ALLOC_H +#define I386_ALLOC_H + +#include +#include +#include + +int alloc_init(struct mboot_info *info); +void mark_bitmap(uint32_t paddr, int present); +uint32_t pfa_alloc_frame(void); +void pfa_free(uint32_t paddr, int num_frames); + +#endif -- cgit v1.2.3