System reboots after interrupt handler
Posted: Fri Aug 27, 2010 5:55 am
Hello,
after having set up the IDT for my kernel, I wanted to try it out with both an
and an
My interrupt handler is successfully called (debugging using videomem and infinite loops *g*) but after that the system (emulated in qemu) reboots.
I am using
called by interrupt methods defined by macros
and
registered with selector 0x08 and flags 0x8E.
Works neither with protected nor real mode, no userspace code is executed. Grub is used as the bootmanager.
Is this the defined behavior, or should the system be able to return to normal execution?
Edit:
Also, if I call in my interrupt handler, nothing is written at all. I'm currently debugging what fails.
after having set up the IDT for my kernel, I wanted to try it out with both an
Code: Select all
int a = 7 / 0; // For interrupt 0x00
Code: Select all
asm volatile("int $0x01");
I am using
Code: Select all
isr_common_stub:
pusha ; Pushes edi,esi,ebp,esp,ebx,edx,ecx,eax
push ds ; Save the data segment descriptor
mov ax, 0x10 ; Load the kernel data segment descriptor
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
xor ebp, ebp ; Create new stackframe
mov eax, esp
push eax
call _isr_handler
pop ax ; Restore original data segment descriptor
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
popa ; Pops edi,esi,ebp,esp,ebx,edx,ecx,eax
add esp, 0x08 ; Cleans up the pushed error code and pushed ISR number
sti
iret ; Pops 5 things at once: CS, EIP, EFLAGS; SS and ESPclear
Code: Select all
%macro ISR_NOERRCODE 1
[GLOBAL isr%1]
isr%1:
cli
push byte 0
push byte %1
jmp isr_common_stub
%endmacro
Code: Select all
%macro ISR_ERRCODE 1
[GLOBAL isr%1]
isr%1:
cli
push byte %1
jmp isr_common_stub
%endmacro
Works neither with protected nor real mode, no userspace code is executed. Grub is used as the bootmanager.
Is this the defined behavior, or should the system be able to return to normal execution?
Edit:
Also, if I call
Code: Select all
Console::getInstance()->write(str);