Ned some help with the GDT
Posted: Thu Jun 07, 2007 12:18 am
I understand what the GDT is for, but I'm not exactly sure how to create one.
I've come up with this code
gdt.h
gdt.s
But i'm almost %100 sure that this code won't work. How can I fix it?
I've come up with this code
gdt.h
Code: Select all
extern unsigned char gdt[4]
void fill_gdt(void)
{
unsigned char gdt[4];
gdt[0]=0x00;
gdt[1]=0x9A;
gdt[2]=0x92;
gdt[3]=0x00;
}
extern void _list_gdt(void);
Code: Select all
.global _list_gdt
.global gdt
.type _list_gdt,@function
_list_gdt:
lgdt $(gdt)
ret