Now I've got 64 bit long mode working I am trying to set up software interrupts before I enable the hardware ones. The table seems to be working well but the issue seems to be when I use a software interrupt for example int 33, the iretq sends the kernel into somewhere it shouldn't. The registers before the iretq are
Code: Select all
rax=0100043900000000 rbx=0000000000000000 rcx=0000000000000000 rdx=0000000000000000
rsi=0000000040000010 rdi=0000000040001000 r8 =0000000000000000 r9 =0000000000000003
r10=00000000000000f0 r11=000000000100002a r12=0000000000000000 r13=0000000000000000
r14=0000000000000000 r15=0000000000000000 iopl=0 nv up di pl zr na po nc
rip=000000000100046a rsp=0000000000ffff98 rbp=0000000000000000
cs=0008 ds=0010 es=0010 fs=0010 gs=0010 ss=0010 rflags=00000046
Code: Select all
%0000000000ffff98: 0000000001000437 0000000000000008
%0000000000ffffa8: 0000000000000002 0000000000ffffc0
%0000000000ffffb8: 0000000000000010 0000000000000000
%0000000000ffffc8: 0000000000000000 0000000000000000
Code: Select all
int 33
jmp $
Default_Int: ;Default interrupt
pushraxrdi ;pusha macro
mov r8,0
mov r9,3
mov r11,PINT ;print 'Interrupt!'
mov r10,0xf0
call printc
popraxrdi ;popa macro
iretq
Bipman