From 89f7f1b114c1bbea3ad62808bf3653e1d2337d1f Mon Sep 17 00:00:00 2001 From: Aleksa Vučković Date: Wed, 27 Oct 2021 11:44:12 +0200 Subject: Added paging --- src/as/Makefile | 2 +- src/as/paging.s | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 src/as/paging.s (limited to 'src/as') diff --git a/src/as/Makefile b/src/as/Makefile index e2c476d..bd5664b 100644 --- a/src/as/Makefile +++ b/src/as/Makefile @@ -1,5 +1,5 @@ .PHONY: all all: $(AS_OBJECTS) -$(BUILD_DIR)/%.o: %.s +$(AS_OBJECT_DIR)/%.o: %.s $(AS) $< -o $@ diff --git a/src/as/paging.s b/src/as/paging.s new file mode 100644 index 0000000..2dd52d3 --- /dev/null +++ b/src/as/paging.s @@ -0,0 +1,21 @@ +.globl loadPageDirectory +loadPageDirectory: + push %ebp + mov %esp, %ebp + mov 8(%esp), %eax + mov %eax, %cr3 + mov %ebp, %esp + pop %ebp + ret + +.text +.globl enablePaging +enablePaging: + push %ebp + mov %esp, %ebp + mov %cr0, %eax + or $0x80000000, %eax + mov %eax, %cr0 + mov %ebp, %esp + pop %ebp + ret -- cgit v1.2.3