diff options
| author | Michal Idziorek <m.i@gmx.at> | 2014-10-21 19:08:03 +0200 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2014-10-21 19:08:03 +0200 |
| commit | d25834310293c8a30b4a31418ff4ffd8fad8ef24 (patch) | |
| tree | 97ae696211f7709002d80ecbfb8595123611d3c1 /asm | |
| parent | 5b9ea685dfd12415774e4e97ad387c601dd2b43b (diff) | |
started implementing our first fool-shell.
Diffstat (limited to 'asm')
| -rw-r--r-- | asm/int_syscall_handler.asm | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/asm/int_syscall_handler.asm b/asm/int_syscall_handler.asm index 37bc71a..bd787de 100644 --- a/asm/int_syscall_handler.asm +++ b/asm/int_syscall_handler.asm @@ -3,7 +3,8 @@ global int_syscall_handler [extern example_syscall] [extern example_syscall_2] -[extern syscall_outbyte] +[extern syscall_write] +[extern syscall_read] [bits 32] int_syscall_handler: @@ -21,31 +22,53 @@ int_syscall_handler: je call_example_syscall_2 cmp eax, 61 - je call_outbyte + je call_write + + cmp eax, 62 + je call_read done: + mov ebx,eax + + mov al, 0x20 ;Port number AND command number to Acknowledge IRQ + out 0x20, al ;Acknowledge IRQ, so we keep getting interrupts + + mov eax,ebx + + sti + +done_blocking: + pop ebx pop ecx pop edx mov ebx,eax - mov al, 0x20 ;Port number AND command number to Acknowledge IRQ - out 0x20, al ;Acknowledge IRQ, so we keep getting interrupts - sti iret ;Interrupt-Return + call_example_syscall: call example_syscall jmp done -call_example_syscall_2 +call_example_syscall_2: call example_syscall_2 jmp done -call_outbyte - call syscall_outbyte +call_write: + call syscall_write jmp done +call_read: + + 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 + + jmp done_blocking + |
