From da471de9d1367f6f69b5a5d3a21109b737d31024 Mon Sep 17 00:00:00 2001 From: Carlos Maiolino Date: Tue, 7 Oct 2025 08:13:55 +0200 Subject: mm: enable paging Add infra-structure to enable and manipulate page tables in the processor. Signed-off-by: Carlos Maiolino --- src/mm/paging.asm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/mm/paging.asm (limited to 'src/mm/paging.asm') diff --git a/src/mm/paging.asm b/src/mm/paging.asm new file mode 100644 index 0000000..7f79489 --- /dev/null +++ b/src/mm/paging.asm @@ -0,0 +1,25 @@ +[BITS 32] + +section .asm + + global paging_load_directory + global enable_paging + + paging_load_directory: + push ebp + mov ebp, esp + mov eax, [ebp + 8] + + mov cr3, eax + + pop ebp + ret + + enable_paging: + push ebp + mov ebp, esp + mov eax, cr0 + or eax, 0x80000000 + mov cr0, eax + pop ebp + ret -- cgit v1.2.3