Skip to content

Instantly share code, notes, and snippets.

@Z903
Z903 / pmm.c
Last active April 9, 2025 14:23
Physical Memory Manager (PMM) Frame Allocator
/*
* Physical Memory Manager (PMM) Frame Allocator by Z903
*
* This allocator manages physical memory frames in both 4KiB and 2MiB sizes using a two-layer
* hierarchical bitmap structure. It's optimized for efficient allocation and deallocation
* through two single-linked lists - one for 4KiB frames and one for 2MiB frames. The allocator
* can manage up to 64 GiB of physical memory.
*
* Public Functions:
* - void pmm_allocator_init(t_multiboot_info* mboot_info, t_u8 reserved_memory):