summaryrefslogtreecommitdiff
path: root/asm/int_clock_handler.asm
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2014-12-01 21:49:22 +0100
committerMichal Idziorek <m.i@gmx.at>2014-12-01 21:49:22 +0100
commitd8331335ff1720ce28eba45afe1a02814b38b033 (patch)
treef671279d258477321699d158765f576512851e3a /asm/int_clock_handler.asm
parent100be313c22bd6116b1adc5eb30f5db56f4b0772 (diff)
finally implemented fork() syscall
Diffstat (limited to 'asm/int_clock_handler.asm')
-rw-r--r--asm/int_clock_handler.asm44
1 files changed, 12 insertions, 32 deletions
diff --git a/asm/int_clock_handler.asm b/asm/int_clock_handler.asm
index 627e432..6301dc6 100644
--- a/asm/int_clock_handler.asm
+++ b/asm/int_clock_handler.asm
@@ -1,45 +1,25 @@
global int_clock_handler
[extern task_switch_next]
-
[bits 32]
-int_clock_handler:
-
- cli
-
- ;Notice there is no IRQ number or error code - we don't need them
-
-; inc byte [CLOCK_COUNTER]
-
-; cmp byte [CLOCK_COUNTER], 0x2
-; jne skip_clock
-
-; mov byte [CLOCK_COUNTER], 0x00
+int_clock_handler:
+cli
pusha ;Push all standard registers
- mov eax, esp
- mov esp,0x1000 ;put the stack outside of virtual memory in kernel space!
- push eax ;Push pointer to all the stuff we just pushed
- call task_switch_next ;Call C code
-
- ;pop ebx
+mov eax, esp ;save current stack pointer in esp
+mov esp, 0x1000 ;now put the stack outside of virtual memory in kernel space!
- ;compare:
- ;cmp eax,ebx
- ;jne compare
-
- mov esp, eax ;Replace the stack with what the C code gave us
+push eax ;Push pointer to all the stuff we just pushed
+call task_switch_next ;Call C code
+mov esp, eax ;Replace the stack with what the C code gave us
-; skip_clock:
- 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
- popa ;Put the standard registers back
+popa ;Put the standard registers back
+sti
- ;We didn't push an error code or IRQ number, so we don't have to edit esp now
- sti
-
- iretd ;Interrupt-Return
+iretd ;Interrupt-Return