aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/boot.asm
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/boot.asm')
-rw-r--r--src/kernel/boot.asm25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/kernel/boot.asm b/src/kernel/boot.asm
index d533307..2501ed9 100644
--- a/src/kernel/boot.asm
+++ b/src/kernel/boot.asm
@@ -30,8 +30,13 @@ mboot:
dd start
; Endless loop
+extern kernel_main
stublet:
- extern kernel_main
+ ; Load multiboot information
+ push esp
+ push ebx
+
+ cli
call kernel_main
jmp $
@@ -45,6 +50,24 @@ stublet:
%include "src/kernel/interact.asm"
+global switch_to_user
+extern test_user
+switch_to_user:
+ sti
+ mov ax, 0x23
+ mov ds, ax
+ mov es, ax
+ mov fs, ax
+ mov gs, ax
+
+ mov eax, esp
+ push 0x23
+ push eax
+ pushf
+ push 0x1B
+ push test_user
+ iret
+
; Store the stack
SECTION .bss
resb 0x2000 ; Reserve 8KiB