Wrote syscall interrupt handler in assembly
This commit is contained in:
@@ -65,7 +65,3 @@ void isr_timer(struct interrupt_frame_t *frame)
|
||||
printf("Timer tick.\n");
|
||||
apic_eoi();
|
||||
}
|
||||
|
||||
void isr_syscall(struct interrupt_frame_t *frame)
|
||||
{
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user