aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/boot.asm
diff options
context:
space:
mode:
authorMarvin Borner2019-10-31 00:49:00 +0100
committerMarvin Borner2019-10-31 00:49:00 +0100
commit7d5a9792e57b4088cce5cc97837eb04016b57a4d (patch)
tree11eac7aa426f3cb597a3ebd2b08cef0d99e9c0cf /src/kernel/boot.asm
parent91439462f5ad77eb128658229724c9a3660a2068 (diff)
Implemented basic syscalls and user mode
Doesn't completely work right now
Diffstat (limited to 'src/kernel/boot.asm')
-rw-r--r--src/kernel/boot.asm19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/kernel/boot.asm b/src/kernel/boot.asm
index fad05ff..8f24066 100644
--- a/src/kernel/boot.asm
+++ b/src/kernel/boot.asm
@@ -50,6 +50,25 @@ stublet:
%include "src/kernel/interact.asm"
+global switch_to_user
+switch_to_user:
+ cli
+ mov ax,0x23
+ mov ds,ax
+ mov es,ax
+ mov fs,ax
+ mov gs,ax
+
+ mov eax,esp
+ push 0x23
+ push eax
+ pushf
+ pop eax
+ or eax, 0x200
+ push eax
+ push 0x1B
+ iret
+
; Store the stack
SECTION .bss
resb 0x2000 ; Reserve 8KiB