Implement physical memory allocator with zone support (AI)

- Added bitmap-based physical memory manager (PMM) that parses the Multiboot2
  memory map to discover available RAM regions.
- Supports two allocation zones: PMM_ZONE_DMA (below 16MB) and PMM_ZONE_NORMAL
  (above 16MB), with automatic fallback from NORMAL to DMA when the preferred
  zone is exhausted.
- Marks kernel memory region and multiboot info structure as reserved using
  _kernel_start/_kernel_end linker symbols.
- Page 0 is always marked as used to prevent returning NULL as a valid address.
- Added linker script symbols (_kernel_start, _kernel_end) to track kernel
  memory boundaries for the allocator.
- Kernel now initializes PMM after PIC and performs test allocations to verify
  the subsystem works.
This commit is contained in:
AI
2026-02-23 10:52:06 +00:00
parent f1923fdbcf
commit cf3059747a
5 changed files with 199 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ add_executable(kernel
idt.c
isr.c
pic.c
pmm.c
interrupts.S
kernel.c
)