2022-12-23 10:33:23 +00:00
|
|
|
#include "InitRD.h"
|
|
|
|
#include "arch/MMU.h"
|
|
|
|
#include "boot/bootboot.h"
|
|
|
|
#include "memory/MemoryManager.h"
|
|
|
|
#include <luna/Alignment.h>
|
|
|
|
|
|
|
|
TarStream g_initrd;
|
|
|
|
extern const BOOTBOOT bootboot;
|
|
|
|
|
|
|
|
void InitRD::initialize()
|
|
|
|
{
|
|
|
|
u64 virtual_initrd_address =
|
|
|
|
MemoryManager::get_kernel_mapping_for_frames(
|
|
|
|
bootboot.initrd_ptr, get_blocks_from_size(bootboot.initrd_size, ARCH_PAGE_SIZE), MMU::NoExecute)
|
|
|
|
.expect_value("Unable to map the initial ramdisk into virtual memory");
|
|
|
|
|
|
|
|
g_initrd.initialize((void*)virtual_initrd_address, bootboot.initrd_size);
|
2023-01-02 12:07:29 +00:00
|
|
|
}
|