1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:57:35 +00:00

Kernel/riscv64: Add MMU initialization code

We initialize the MMU by first setting up the page tables for the
kernel image and the initial kernel stack.
Then we jump to a identity mapped page which makes the newly created
kernel root page table active by setting `satp` and then jumps to
`init`.
This commit is contained in:
Sönke Holz 2024-01-03 17:21:45 +01:00 committed by Andrew Kaster
parent 27860cfaa2
commit da33e2a564
4 changed files with 276 additions and 3 deletions

18
Kernel/Arch/riscv64/MMU.h Normal file
View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2023, Sönke Holz <sholz8530@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Forward.h>
#include <AK/Platform.h>
VALIDATE_IS_RISCV64()
namespace Kernel::Memory {
[[noreturn]] void init_page_tables_and_jump_to_init();
}