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);