Code: Select all
global _gdtFlush
extern _gdtPtr
_gdtFlush:
lgdt[_gdtPtr]
mov ax, 0x10
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
jmp 0x08:flush2
flush2:
retCode: Select all
global _gdtFlush
extern _gdtPtr
_gdtFlush:
lgdt[_gdtPtr]
mov ax, 0x10
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
jmp 0x08:flush2
flush2:
retDidn't understand exactly your problem. The above code was working normally, you changed the label "flush2" to "return", it crashed, then changed it back to "flush2" and crashed too?osdf_1 wrote:I had this code to set up my GDT [.......] and decided to change the "flush2" label for "return". When I ran my kernel I got a Triple fault. So I changed it back to the way it was before, but I still get the Triple fault. What could be going wrong? I tested it on two emulators and got the same in both.
Code: Select all
struct gdtEntry
{
unsigned short limitLow;
unsigned short baseLow;
unsigned char baseMiddle;
unsigned char access;
unsigned char granularity;
unsigned char baseHigh;
} __attribute__((packed));