diff --git a/Kernel/Arch/init.cpp b/Kernel/Arch/init.cpp index 1a901a0ae2..755b99bb5c 100644 --- a/Kernel/Arch/init.cpp +++ b/Kernel/Arch/init.cpp @@ -186,14 +186,25 @@ extern "C" [[noreturn]] UNMAP_AFTER_INIT void init([[maybe_unused]] BootInfo con multiboot_framebuffer_type = boot_info.multiboot_framebuffer_type; #elif ARCH(AARCH64) // FIXME: For the aarch64 platforms, we should get the information by parsing a device tree instead of using multiboot. + auto [ram_base, ram_size] = RPi::Mailbox::the().query_lower_arm_memory_range(); + auto [vcmem_base, vcmem_size] = RPi::Mailbox::the().query_videocore_memory_range(); multiboot_memory_map_t mmap[] = { - { sizeof(struct multiboot_mmap_entry) - sizeof(u32), - (u64)0x0, - (u64)0x3F000000, - MULTIBOOT_MEMORY_AVAILABLE } + { + sizeof(struct multiboot_mmap_entry) - sizeof(u32), + (u64)ram_base, + (u64)ram_size, + MULTIBOOT_MEMORY_AVAILABLE, + }, + { + sizeof(struct multiboot_mmap_entry) - sizeof(u32), + (u64)vcmem_base, + (u64)vcmem_size, + MULTIBOOT_MEMORY_RESERVED, + }, + // FIXME: VideoCore only reports the first 1GB of RAM, the rest only shows up in the device tree. }; multiboot_memory_map = mmap; - multiboot_memory_map_count = 1; + multiboot_memory_map_count = 2; multiboot_modules = nullptr; multiboot_modules_count = 0;