From: Rhett Date: Sun, 1 Sep 2013 22:55:17 +0000 (-0700) Subject: Stubs for a simple system call X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=1f47d663bdb5edc9a8008dd18b4bf71422a83489;p=arcanos.git Stubs for a simple system call --- diff --git a/inc/idt.h b/inc/idt.h index 8ce5c51..0bd66b2 100644 --- a/inc/idt.h +++ b/inc/idt.h @@ -26,6 +26,8 @@ IDT* phys_idtp; #define HIGH_OFFSET(x) ((x >> 16)) #define LOW_OFFSET(x) ((x & 0x0000FFFF)) +#define SYSCALL_IRQ 0x80 + void reset_idt(); void set_idt_entry(uint8_t number, void (*handler)(), uint16_t type); void load_idt(); diff --git a/kern/init.c b/kern/init.c index 52ba583..8f41e58 100644 --- a/kern/init.c +++ b/kern/init.c @@ -13,6 +13,7 @@ #define CHECK_FLAG(flags,bit) ((flags) & (1 << (bit))) extern void keyboard_isr(); +extern void syscall_isr(); extern void load_partitions(); void i386_init(multiboot_info_t* mbi); @@ -133,6 +134,7 @@ i386_init(multiboot_info_t* mbi) PIC_remap(32, 40); //PIC1 - 32-39, PIC2 - 40-47; set_idt_entry(33, keyboard_isr, INTERRUPT_GATE_TYPE_ATTR); PIC_set_mask(1, 0); + set_idt_entry(SYSCALL_IRQ, syscall_isr, INTERRUPT_GATE_TYPE_ATTR); load_idt(); asm("sti"); //Interrupts are on now, bitches. _kern_print("Interrupts enabled.\n"); diff --git a/kern/interrupts/interrupt_handlers.c b/kern/interrupts/interrupt_handlers.c index d9cffaa..5481b5e 100644 --- a/kern/interrupts/interrupt_handlers.c +++ b/kern/interrupts/interrupt_handlers.c @@ -75,6 +75,11 @@ void _interrupt_handler(uint8_t number) while(1); } +void _syscall_interrupt() +{ + _kern_print("System call interrupt has been called\n"); +} + void _keyboard_interrupt() { uint8_t new_scan_code=0; diff --git a/kern/interrupts/interrupts.S b/kern/interrupts/interrupts.S index fc5c990..93dc10e 100644 --- a/kern/interrupts/interrupts.S +++ b/kern/interrupts/interrupts.S @@ -186,6 +186,13 @@ isr_30: popal iret +.globl syscall_isr +syscall_isr: + pushal + call _syscall_interrupt + popal + iret + .globl keyboard_isr keyboard_isr: pushal