fix: PMM total_memory overflow — MMAP reserved regions near 4GB inflated highest_addr
Root cause: Multiboot2 MMAP includes a BIOS reserved region at
0xFFFC0000-0x100000000. The end address (0x100000000) overflows
uint32_t when stored in a uint64_t local variable, and (unsigned)
truncation yields 0 — hence '[PMM] total_memory bytes: 0x0'.
Fixes:
- Use uint32_t locals (32-bit x86 caps RAM at 512 MB anyway)
- Clamp MMAP end addresses to 0xFFFFFFFF before comparison
- Only track highest_avail from AVAILABLE regions, not reserved
- Use 'if' instead of 'else if' so both BASIC_MEMINFO and MMAP
are processed in the same pass
- Print total_memory and freed_frames in decimal with MB suffix
Before: [PMM] total_memory bytes: 0x0
After: [PMM] total_memory:
134086656 bytes (127 MB)
83/83 smoke tests pass, cppcheck clean.