summaryrefslogtreecommitdiff
path: root/asm/usermode.s
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-08-17 21:41:21 +0200
committerMiguel <m.i@gmx.at>2018-08-17 21:41:21 +0200
commitc15925a24efe14f437d8a2699500241a58fdc8f9 (patch)
treec0db3a7d2a4f857324735df35e9cc1f0539c5f24 /asm/usermode.s
parent6fd78c2ff950310d8372ec0353553cc4a5a43e72 (diff)
cleanup and working on fifo pipes
Diffstat (limited to 'asm/usermode.s')
-rw-r--r--asm/usermode.s15
1 files changed, 9 insertions, 6 deletions
diff --git a/asm/usermode.s b/asm/usermode.s
index acf4b04..67eca04 100644
--- a/asm/usermode.s
+++ b/asm/usermode.s
@@ -1,8 +1,9 @@
-.global asm_usermode
-.extern userfunc
+.global usermode
-# pass address to func to exec (TODO)
-asm_usermode:
+usermode:
+
+ mov 0x4(%esp),%edx //get adress of passed : void func()
+ //to be called in ring 3
// 0x23 is user data segment (|2 low bits)
// 0x1b is user code segment (|2 low bits)
@@ -13,6 +14,7 @@ asm_usermode:
mov %ax, %es
mov %ax, %fs
mov %ax, %gs
+
// ss is handled by iret
mov %esp, %eax
@@ -25,10 +27,11 @@ asm_usermode:
//mov $0x200, %eax
//push %eax // eflags image
pushl $0x1B // return code segment selector
- push $userfunc // return instruction pointer
+ push %edx // return instruction pointer
+
iret
- jmp . // will never be reached?
+ jmp . // never to be reached