summaryrefslogtreecommitdiff
path: root/asm/task.s
diff options
context:
space:
mode:
Diffstat (limited to 'asm/task.s')
-rw-r--r--asm/task.s37
1 files changed, 31 insertions, 6 deletions
diff --git a/asm/task.s b/asm/task.s
index 7611d4a..c29bdae 100644
--- a/asm/task.s
+++ b/asm/task.s
@@ -2,15 +2,21 @@
task_pusha:
pushf
-
- push $0x8
+ push $0x8 // code segment
push $userfunc
pusha
+
+ push %ds
+ push %es
+ push %fs
+ push %gs
+
/*
+
now stack looks like:
- param // esp+48
+ param // esp+64
returnaddy
eflags
@@ -26,9 +32,14 @@ task_pusha:
esi
edi
+ ds
+ es
+ fs
+ gs
+
*/
- mov 48(%esp),%eax // get address of alternative stack where we want to simulate the pusha
+ mov 64(%esp),%eax // get address of alternative stack where we want to simulate the pusha
mov (%esp),%ecx
mov %ecx,(%eax)
@@ -66,10 +77,24 @@ task_pusha:
mov 44(%esp),%ecx
mov %ecx,44(%eax)
+ mov 48(%esp),%ecx
+ mov %ecx,48(%eax)
+
+ mov 52(%esp),%ecx
+ mov %ecx,52(%eax)
+
+ mov 56(%esp),%ecx
+ mov %ecx,56(%eax)
+
+ pop %gs
+ pop %fs
+ pop %es
+ pop %ds
+
+ popa
+
pop %eax
pop %eax
pop %eax
- popa
-
ret