To do so, I created a TSS and added it to the GDT. (base=Address of TSS, limit=sizeof(TSS), access=0xE9, gran=0xCF)
Then, I set in the new TSS eip, cr3, cs, ds, es, fs, gs, ss, esp and eflags of the handler.
To set the task gate into the IDT, I am using index=8, base=0, selector=0x30, flags=0x85.
Now I am trying some tests to check if it works:
Code: Select all
asm volatile("int $8");
/
asm volatile("jmp $(0x30),$0");
However, when I try to do a double fault (ie. by changing esp to a unmapped page and then trying to push/pop something), the handler does not work
In qemu it crashes.
In bochs and vmware works.
In vbox doesn't crash but the handler isn't executed.
Why whould this happen? Am I missing some flag?
Thanks,
Gzaloprgm