Wrote syscall interrupt handler in assembly

This commit is contained in:
2021-04-19 06:53:39 -05:00
parent 0af53bcfc8
commit 755f2a3d69
2 changed files with 25 additions and 6 deletions

View File

@@ -1,5 +1,28 @@
.section .text
.global isr_syscall
.type isr_syscall, @function
isr_syscall:
cli
push %edx
push %ecx
push %ebx
push %eax
push $kernel_state
mov $0x10, %ax
mov %ax, %ds
mov %ax, %es
mov %ax, %fs
mov %ax, %gs
call do_syscall
add $0x14, %esp
mov $0x23, %cx
mov %cx, %ds
mov %cx, %es
mov %cx, %fs
mov %cx, %gs
iret
.global isr_preempt
.type isr_preempt, @function
isr_preempt:
@@ -7,11 +30,11 @@ isr_preempt:
push %esp
push $0x800
call save_context
sub $8, %esp
add $8, %esp
push $0x800
push $kernel_state
call next_process
sub $8, %esp
add $8, %esp
push %eax
call load_context