From 7d5a9792e57b4088cce5cc97837eb04016b57a4d Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 31 Oct 2019 00:49:00 +0100 Subject: Implemented basic syscalls and user mode Doesn't completely work right now --- src/kernel/boot.asm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/kernel/boot.asm') 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 -- cgit v1.2.3