Okay, here I am again
I am still getting (random?) #DF. Sometimes
Code: Select all
lidt fword ptr [whatever]
sti // here
add esp, 8Ch // or here
or later in memset for different destination addresses.
These addresses are valid and free to use, I checked it before (E820 memory map).
The problem is, #DF should push error code 0 on the stack, but it doesnt. Stack layout is EIP, CS, EFLAGS.
IDT seems to be fine:
Code: Select all
Interrupt Descriptor Table (base=0x0000000000303000, limit=167):
IDT[0x00]=32-Bit Interrupt Gate target=0x0008:0x00300751, DPL=0
IDT[0x01]=32-Bit Interrupt Gate target=0x0008:0x00300760, DPL=0
IDT[0x02]=32-Bit Interrupt Gate target=0x0008:0x0030076f, DPL=0
IDT[0x03]=32-Bit Interrupt Gate target=0x0008:0x0030077e, DPL=0
IDT[0x04]=32-Bit Interrupt Gate target=0x0008:0x0030078d, DPL=0
IDT[0x05]=32-Bit Interrupt Gate target=0x0008:0x0030079c, DPL=0
IDT[0x06]=32-Bit Interrupt Gate target=0x0008:0x003007ab, DPL=0
IDT[0x07]=32-Bit Interrupt Gate target=0x0008:0x003007ba, DPL=0
IDT[0x08]=32-Bit Interrupt Gate target=0x0008:0x003007c9, DPL=0
IDT[0x09]=32-Bit Interrupt Gate target=0x0008:0x003007d3, DPL=0
IDT[0x0a]=32-Bit Interrupt Gate target=0x0008:0x003007e2, DPL=0
IDT[0x0b]=32-Bit Interrupt Gate target=0x0008:0x003007ec, DPL=0
IDT[0x0c]=32-Bit Interrupt Gate target=0x0008:0x003007f6, DPL=0
IDT[0x0d]=32-Bit Interrupt Gate target=0x0008:0x00300800, DPL=0
IDT[0x0e]=32-Bit Interrupt Gate target=0x0008:0x0030080a, DPL=0
IDT[0x0f]=32-Bit Interrupt Gate target=0x0008:0x00000000, DPL=0
IDT[0x10]=32-Bit Interrupt Gate target=0x0008:0x00300814, DPL=0
IDT[0x11]=32-Bit Interrupt Gate target=0x0008:0x00300823, DPL=0
IDT[0x12]=32-Bit Interrupt Gate target=0x0008:0x0030082d, DPL=0
IDT[0x13]=32-Bit Interrupt Gate target=0x0008:0x0030083c, DPL=0
IDT[0x14]=32-Bit Interrupt Gate target=0x0008:0x0030084b, DPL=0
GDT seems to be fine also:
Code: Select all
Global Descriptor Table (base=0x00000000000085be, limit=24):
GDT[0x00]=??? descriptor hi=0x00000000, lo=0x00000000
GDT[0x01]=Code segment, base=0x00000000, limit=0xffffffff, Execute/Read, Non-Conforming, Accessed, 32-bit
GDT[0x02]=Data segment, base=0x00000000, limit=0xffffffff, Read/Write, Accessed
I found the same problem ("random" #DF after sti) on this forum, but the problem had something to do with PIC initialization (I dont do any hardware initialization yet).
Edit:
Code: Select all
CS = 0x08
DS = SS = ES = FS = GS = 0x10