Ring 3 ready

- Fixed issue with setting up the Task Segment Register
This commit is contained in:
2023-02-13 22:44:47 +01:00
parent 1f90a5d862
commit c9a036bfbb
5 changed files with 38 additions and 31 deletions

View File

@ -36,6 +36,8 @@ extern "C"
#include "serial.h"
#include "time.h"
#include "definitions.h"
extern "C" void LoadGlobalDescriptorTable();
/*
Copyright © Nigel Barink 2023
@ -50,18 +52,19 @@ extern "C" void kernel_main ()
startSuperVisorTerminal();
}
extern "C" void early_main()
{
init_serial();
kterm_init();
setup_tss();
initGDT();
//setup_tss();
initidt();
LoadGlobalDescriptorTable();
flush_tss();
printf("Memory setup complete!\n");
// Enable interrupts
asm volatile("STI");
@ -73,7 +76,7 @@ extern "C" void early_main()
initHeap();
printf("Enable Protected mode and jump to kernel main\n");
// Set the protected bit of control register 0
// this will put the CPU into protected mode