Compare commits
2 Commits
519aa347dd
...
71b981175e
Author | SHA1 | Date | |
---|---|---|---|
71b981175e | |||
f0a3f99cf9 |
@ -1,18 +1,13 @@
|
|||||||
#include "InitRD.h"
|
#include "InitRD.h"
|
||||||
#include "arch/MMU.h"
|
#include "arch/MMU.h"
|
||||||
#include "boot/bootboot.h"
|
#include "boot/bootboot.h"
|
||||||
#include "memory/MemoryManager.h"
|
|
||||||
#include <luna/Alignment.h>
|
|
||||||
|
|
||||||
TarStream g_initrd;
|
TarStream g_initrd;
|
||||||
extern const BOOTBOOT bootboot;
|
extern const BOOTBOOT bootboot;
|
||||||
|
|
||||||
void InitRD::initialize()
|
void InitRD::initialize()
|
||||||
{
|
{
|
||||||
u64 virtual_initrd_address =
|
u64 virtual_initrd_address = MMU::translate_physical_address(bootboot.initrd_ptr);
|
||||||
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);
|
g_initrd.initialize((void*)virtual_initrd_address, bootboot.initrd_size);
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ namespace MemoryManager
|
|||||||
void init()
|
void init()
|
||||||
{
|
{
|
||||||
init_physical_frame_allocator();
|
init_physical_frame_allocator();
|
||||||
KernelVM::init();
|
|
||||||
MMU::setup_initial_page_directory();
|
MMU::setup_initial_page_directory();
|
||||||
|
|
||||||
auto frame_bitmap = g_frame_bitmap.lock();
|
auto frame_bitmap = g_frame_bitmap.lock();
|
||||||
@ -108,6 +108,8 @@ namespace MemoryManager
|
|||||||
|
|
||||||
auto virtual_bitmap_base = MMU::translate_physical_address(phys);
|
auto virtual_bitmap_base = MMU::translate_physical_address(phys);
|
||||||
frame_bitmap->initialize((void*)virtual_bitmap_base, frame_bitmap->size_in_bytes());
|
frame_bitmap->initialize((void*)virtual_bitmap_base, frame_bitmap->size_in_bytes());
|
||||||
|
|
||||||
|
KernelVM::init();
|
||||||
}
|
}
|
||||||
|
|
||||||
void do_lock_frame(u64 index, Bitmap& bitmap)
|
void do_lock_frame(u64 index, Bitmap& bitmap)
|
||||||
|
Loading…
Reference in New Issue
Block a user