56
« am: 21. May 2012, 18:29 »
Ich hab die GDT & IDT jetzt neu mit der geschickteren Variante über structs implementiert. Also daran liegts nicht.
Ich denke der Fehler müsste dann ist den Stubs liegen, eigentlich ist doch alles richtig.?!
// handle_interrupt aus common_handler.c
.extern handle_interrupt
.macro int_stub nr
.global int_handler\nr
int_handler\nr:
push $0
push $\nr
jmp common_intr_handler
.endm
//Exeptions haben extra-stubs
// (siehe: kernel/interrupt/handler/exeption/handler.S)
//IRQs
int_stub 0x20
// 0x21: direct call
int_stub 0x22
int_stub 0x23
int_stub 0x24
int_stub 0x25
int_stub 0x26
int_stub 0x27
int_stub 0x28
int_stub 0x29
int_stub 0x2A
int_stub 0x2B
int_stub 0x2C
int_stub 0x2D
int_stub 0x2E
int_stub 0x2F
//Syscalls
int_stub 0x30
common_intr_handler:
push %ebp
push %edi
push %esi
push %edx
push %ecx
push %ebx
push %eax
// Kernel-Datensegmente laden
mov $0x10, %ax
mov %ax, %ds
mov %ax, %es
// ISR aufrufen
push %esp
call handle_interrupt
mov %eax, %esp //Neuen Stack laden
// User-Datensegmente laden
mov $0x23, %ax
mov %ax, %ds
mov %ax, %es
// Neue cpu herstellen
pop %eax
pop %ebx
pop %ecx
pop %edx
pop %esi
pop %edi
pop %ebp
// Errorcode und Interruptnummer vom Stack nehmen
add $8, %esp
iret
Wo könnten andere Fehler/Ursachen für den Sprung sein?