diff options
| author | Miguel <m.i@gmx.at> | 2018-10-04 00:53:30 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-10-04 00:53:30 +0200 |
| commit | ce16fe524c14ccaae67fb634105da5aef08ead48 (patch) | |
| tree | 03990f29389bd4c55f40b804b809c7060c24c739 /kernel/interrupts.c | |
| parent | a455cd5af26bf8731e7c981a9421b16ab34dae6f (diff) | |
moving framebuffer access completely to userspace
Diffstat (limited to 'kernel/interrupts.c')
| -rw-r--r-- | kernel/interrupts.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/kernel/interrupts.c b/kernel/interrupts.c index 49c0191..4aa9db3 100644 --- a/kernel/interrupts.c +++ b/kernel/interrupts.c @@ -64,13 +64,32 @@ void interrupt_register(uint32_t irq, uint32_t func_addr) */ uint32_t interrupt_handler(uint32_t esp, uint32_t irq) { - uint32_t *stack; - if(handlers[irq]!=0) { uint32_t (*f)(uint32_t esp)=handlers[irq]; esp=f(esp); apic_eoi(); + return esp; + } + + if(irq==INTERRUPT_APIC_TIMER) + { + klog ("tick"); + esp=scheduler_run(esp,-1); + apic_eoi(); + return esp; + } + + kpanic("unhandled interrupt %d",irq); + + + uint32_t *stack; + + if(handlers[irq]!=0) + { + //uint32_t (*f)(uint32_t esp)=handlers[irq]; + //esp=f(esp); + apic_eoi(); } else if(irq!=INTERRUPT_SYSCALL&&irq!=INTERRUPT_IPI&&irq!=INTERRUPT_APIC_TIMER) @@ -83,7 +102,7 @@ uint32_t interrupt_handler(uint32_t esp, uint32_t irq) { case INTERRUPT_SYSCALL: stack=esp; - task_syscall(stack[11],stack[8],stack[10],stack[9]); //eax,ebx,ecx,edx + // task_syscall(stack[11],stack[8],stack[10],stack[9]); //eax,ebx,ecx,edx break; @@ -105,7 +124,7 @@ uint32_t interrupt_handler(uint32_t esp, uint32_t irq) // reschedule to kernel worker on these if(irq==INTERRUPT_SYSCALL||irq==INTERRUPT_KEYBOARD||irq==INTERRUPT_MOUSE) { - scheduler_wake_worker(esp); + // scheduler_wake_worker(esp); esp=scheduler_run(esp,-1); } |
