diff options
Diffstat (limited to 'kernel/mem.h')
| -rw-r--r-- | kernel/mem.h | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/kernel/mem.h b/kernel/mem.h index 76d12b0..6871e11 100644 --- a/kernel/mem.h +++ b/kernel/mem.h @@ -1,6 +1,31 @@ +/** + * @file + * + * Physical Memory Manager + * ======================= + * + * Allocating and Deallocating memory pagewise. Run mem_init() first. + * + * + * Memory Map + * ---------- + * This will allow to mark a bit on/off for each page to indicte if it is + * currently used or not. + * + * Remember that we have 4096 bytes per page so we need 1048576 bits to + * cover the whole 32bit addressable memory 2^32 byte (4GB). + * + * This results in a 128KiB map we which allocate statically. + */ + #include "multiboot.h" -typedef uint32_t physical_address; -physical_address* pmmngr_alloc_block (); -void pmmngr_free_block (physical_address* p); + +/** + * Init the physical memory manager. Please provide the multiboot_information + * strucutre filled by your bootloader (as grub). + * This is required for memory map et al. + */ uint32_t mem_init(multiboot_information *info); +void* mem_alloc_block (); +void mem_free_block(void* p); uint32_t mem_get_free_blocks_count(); |
