limine: Specify that memory between 0 and 0x1000 is never to be marked usable

This commit is contained in:
mintsuki 2022-07-29 00:42:47 +02:00
parent eaeeb59be9
commit cd1107abe2
2 changed files with 5 additions and 1 deletions

View File

@ -657,7 +657,8 @@ struct limine_memmap_entry {
}; };
``` ```
Note: The kernel and modules loaded are not marked as usable memory. Note: Memory between 0 and 0x1000 is never marked as usable memory.
The kernel and modules loaded are not marked as usable memory.
They are marked as Kernel/Modules. The entries are guaranteed to be sorted by They are marked as Kernel/Modules. The entries are guaranteed to be sorted by
base address, lowest to highest. Usable and bootloader reclaimable entries base address, lowest to highest. Usable and bootloader reclaimable entries
are guaranteed to be 4096 byte aligned for both base and length. Usable and are guaranteed to be 4096 byte aligned for both base and length. Usable and

View File

@ -251,6 +251,9 @@ struct e820_entry_t *get_memmap(size_t *entries) {
#if uefi == 1 #if uefi == 1
pmm_reclaim_uefi_mem(memmap, &memmap_entries); pmm_reclaim_uefi_mem(memmap, &memmap_entries);
#endif #endif
memmap_alloc_range(0, 0x1000, MEMMAP_RESERVED, MEMMAP_USABLE, false, false, false);
sanitise_entries(memmap, &memmap_entries, true); sanitise_entries(memmap, &memmap_entries, true);
*entries = memmap_entries; *entries = memmap_entries;