Luna/kernel/src/InitRD.cpp
apio 71b981175e
All checks were successful
continuous-integration/drone/push Build is passing
InitRD: Use MMU::translate_physical_address instead of allocating VM
This one is a perfect candidate, since we're just mapping a fixed continuous range of physical memory to virtual memory.
2023-02-27 13:27:21 +01:00

14 lines
319 B
C++

#include "InitRD.h"
#include "arch/MMU.h"
#include "boot/bootboot.h"
TarStream g_initrd;
extern const BOOTBOOT bootboot;
void InitRD::initialize()
{
u64 virtual_initrd_address = MMU::translate_physical_address(bootboot.initrd_ptr);
g_initrd.initialize((void*)virtual_initrd_address, bootboot.initrd_size);
}