blob: 593bb64145f873bf36baa0d2f6c4e69a22516ee1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#include <kernel/syscall.h>
#include <kernel/io.h>
#include <stddef.h>
int handle_syscall(struct isr_frame *frame) {
switch (frame->eax) {
case SYS_REBOOT:
kprintf("REBOOT NOT SUPPORTED\n");
break;
default:
kprintf("Error: Invalid system call number: %d\n", frame->eax);
}
return 0;
}
void dump_reg(struct isr_frame *frame) {
kprintf("Registers at interrupt:\n");
kprintf("\tEAX = %x\n", frame->eax);
kprintf("\tEBX = %x\n", frame->ebx);
kprintf("\tECX = %x\n", frame->ecx);
kprintf("\tEDX = %x\n", frame->edx);
kprintf("\tESI = %x\n", frame->esi);
kprintf("\tEDI = %x\n", frame->edi);
kprintf("\tEIP = %x\n", frame->eip);
kprintf("Current code selector: %d\n", frame->cs);
}
|