Thank you LtG for taking time to help me
I retrieved the error code of the interrupt and i have 0x28 which correspond to gtd[5] i suppose.
I now know that it is a segment error
I currently set the following for my gdt :
Code:
gdt_set_gate(0, 0, 0, 0, 0); // Null segment
//0xAF instead of 0xCF because we are in 64bit
gdt_set_gate(1, 0, 0xFFFFFFFF, 0x9A, 0xAF); // Code segment
gdt_set_gate(2, 0, 0xFFFFFFFF, 0x92, 0xAF); // Data segment
gdt_set_gate(3, 0, 0xFFFFFFFF, 0xFA, 0xAF); // User mode code segment
gdt_set_gate(4, 0, 0xFFFFFFFF, 0xF2, 0xAF); // User mode data segment
i do not understand why i would have cs=28 when the interrupt 0 trigger and why it would try to return to it when i do iretq.
gdt[5] could be a tss put in place by the UEFI but as i flush the gdt again, it thought that the gdt was replaced by the new one (and so only have my segments). I tried with or without a tss as gdt[5] without any change in the behaviour
For the debugger, i can use QEMU but i have different behaviour (the stacks seems moved as the parameters send to the handlers is slightly shifted from some 64bit variable) and with the remote debugging of gdb the breakpoints are not triggered.