summaryrefslogtreecommitdiff
path: root/asm
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-08-21 17:54:28 +0200
committerMiguel <m.i@gmx.at>2018-08-21 17:54:28 +0200
commit6c926175afbf1f9ec2715fb007acc28588b36c4a (patch)
treee35451d0c8e5c3f3b6033b919f405a40fd6128fc /asm
parent8a5fbdabb24250a76feed770bce64d7e3e4f61de (diff)
cleaning up multitasking
Diffstat (limited to 'asm')
-rw-r--r--asm/int_mouse_handler.asm5
-rw-r--r--asm/int_syscall_handler.asm4
-rw-r--r--asm/task.s75
3 files changed, 80 insertions, 4 deletions
diff --git a/asm/int_mouse_handler.asm b/asm/int_mouse_handler.asm
index 6872af0..9816950 100644
--- a/asm/int_mouse_handler.asm
+++ b/asm/int_mouse_handler.asm
@@ -7,9 +7,10 @@ int_mouse_handler:
call mouse_handler
- mov al, 0x20 ;Port number AND command number to Acknowledge IRQ
+ mov al, 0x20 ; Port number AND command number to Acknowledge IRQ
out 0xa0, al ; came from slave
- out 0x20, al ;Acknowledge IRQ, so we keep getting interrupts
+ out 0x20, al ; Acknowledge IRQ, so we keep getting interrupts
+
popa
iret ;Interrupt-Return
diff --git a/asm/int_syscall_handler.asm b/asm/int_syscall_handler.asm
index 952faae..a26592f 100644
--- a/asm/int_syscall_handler.asm
+++ b/asm/int_syscall_handler.asm
@@ -221,8 +221,8 @@ call_unhandled:
;; TODO: redesign this shit!
call_read:
- mov al, 0x20 ;Port number AND command number to Acknowledge IRQ
- out 0x20, al ;Acknowledge IRQ, so we keep getting interrupts
+ ;//mov al, 0x20 ;Port number AND command number to Acknowledge IRQ
+ ;//out 0x20, al ;Acknowledge IRQ, so we keep getting interrupts
sti
call syscall_read
diff --git a/asm/task.s b/asm/task.s
new file mode 100644
index 0000000..7611d4a
--- /dev/null
+++ b/asm/task.s
@@ -0,0 +1,75 @@
+.global task_pusha
+task_pusha:
+
+ pushf
+
+ push $0x8
+ push $userfunc
+
+ pusha
+ /*
+ now stack looks like:
+
+ param // esp+48
+ returnaddy
+
+ eflags
+ code segment
+ userfunc
+
+ eax // rest by popa
+ ecx
+ edx
+ ebx
+ esp
+ ebp
+ esi
+ edi
+
+ */
+
+ mov 48(%esp),%eax // get address of alternative stack where we want to simulate the pusha
+
+ mov (%esp),%ecx
+ mov %ecx,(%eax)
+
+ mov 4(%esp),%ecx
+ mov %ecx,4(%eax)
+
+ mov 8(%esp),%ecx
+ mov %ecx,8(%eax)
+
+ mov 12(%esp),%ecx
+ mov %ecx,12(%eax)
+
+ mov 16(%esp),%ecx
+ mov %ecx,16(%eax)
+
+ mov 20(%esp),%ecx
+ mov %ecx,20(%eax)
+
+ mov 24(%esp),%ecx
+ mov %ecx,24(%eax)
+
+ mov 28(%esp),%ecx
+ mov %ecx,28(%eax)
+
+ mov 32(%esp),%ecx
+ mov %ecx,32(%eax)
+
+ mov 36(%esp),%ecx
+ mov %ecx,36(%eax)
+
+ mov 40(%esp),%ecx
+ mov %ecx,40(%eax)
+
+ mov 44(%esp),%ecx
+ mov %ecx,44(%eax)
+
+ pop %eax
+ pop %eax
+ pop %eax
+
+ popa
+
+ ret