The E820 memory map you're parsing here is exactly what GRUB passes to every multiboot-compliant kernel, and it's the only way an OS learns which physical addresses are real RAM versus reserved for the VGA buffer, ACPI tables, or memory-mapped PCI devices. Allocating a page from a region you mistakenly marked usable is how kernels corrupt firmware data structures or write straight into device registers.