Change gdt setup, set state different

This commit is contained in:
Gitea 2021-01-10 14:42:49 -06:00
parent 2f33f55512
commit d19b6f69e5

View file

@ -27,8 +27,8 @@ void setup_gdt(void) {
struct GDT gdt[4]; struct GDT gdt[4];
gdt[0].base = 0; gdt[0].limit = 0; gdt[0].type = 0; gdt[0].base = 0; gdt[0].limit = 0; gdt[0].type = 0;
gdt[1].base = 0; gdt[1].limit = 0xFFFFFFFF; gdt[1].type = 0x9A; gdt[1].base = 0x4000000; gdt[1].limit = 0x3FFFFFF; gdt[1].type = 0x9A;
gdt[2].base = 0; gdt[2].limit = 0xFFFFFFFF; gdt[2].type = 0x92; gdt[2].base = 0x8000000; gdt[2].limit = 0x3FFFFFF; gdt[2].type = 0x92;
gdt[3].base = (unsigned int) tss; gdt[3].limit=sizeof(tss); gdt[3].type = 0x89; gdt[3].base = (unsigned int) tss; gdt[3].limit=sizeof(tss); gdt[3].type = 0x89;
unsigned short int GDT[4]; unsigned short int GDT[4];
@ -40,10 +40,12 @@ void setup_gdt(void) {
set_gdt(GDT, sizeof(GDT)); set_gdt(GDT, sizeof(GDT));
} }
extern void enter_pmode(void);
int init(void) { int init(void) {
NMI_disable(); printf("Setting up GDT...\n");
A20_enable();
setup_gdt(); setup_gdt();
printf("Enabling interrupts...\n");
idt_init(); idt_init();
printf("Fenix Dev Pre-release v0.0.3\n"); printf("Fenix Dev Pre-release v0.0.3\n");
return 0; return 0;