diff options
author | Danny Holman <dholman@gymli.org> | 2023-11-26 18:49:11 -0600 |
---|---|---|
committer | Danny Holman <dholman@gymli.org> | 2023-11-26 18:49:11 -0600 |
commit | e301006c1494674d94e1bcedcd3c3a638af7ec00 (patch) | |
tree | a103471da838811db0d8e949b6b51b307011f445 /arch/i386/include | |
parent | 40cbd20b997c2cbcacb2095e7487609bca1c0040 (diff) |
arch: i386: alloc: add a physical memory manager
Add a simple, bitmap-based physical memory management system.
Signed-off-by: Danny Holman <dholman@gymli.org>
Diffstat (limited to 'arch/i386/include')
-rw-r--r-- | arch/i386/include/kernel/alloc.h | 13 |
1 files changed, 13 insertions, 0 deletions
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 <kernel/multiboot.h> +#include <stdint.h> +#include <stddef.h> + +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 |