Curle
aba82eaacb
This was a doozy. I had to recompile gcc with a custom target to get it to output the CRT{BEGIN/END}.o files with proper 64 bit relocations. The CMakeLists.txt file was also edited to allow these files to be linked (thereby actually adding the support) as well as to automatically create the boot image upon build.
57 lines
1.1 KiB
C
57 lines
1.1 KiB
C
#include <kernel/chroma.h>
|
|
|
|
/************************
|
|
*** Team Kitty, 2020 ***
|
|
*** Chroma ***
|
|
***********************/
|
|
|
|
/* This file is the entry point to the system.
|
|
* It dictates the order of operations of everything the kernel actually does.
|
|
* If a function isn't fired here, directly or indirectly, it is not run.
|
|
*/
|
|
|
|
|
|
|
|
size_t KernelAddr = (size_t) &LoadAddr;
|
|
size_t KernelEnd = (size_t) &end;
|
|
|
|
|
|
int Main(void) {
|
|
|
|
|
|
SerialPrintf("\r\nBooting Chroma..\r\n");
|
|
SerialPrintf("Kernel loaded at 0x%p, ends at 0x%p, is %d bytes long.\r\n", KernelAddr, KernelEnd, KernelEnd - KernelAddr);
|
|
|
|
SerialPrintf("The bootloader has put the paging tables at 0x%p.\r\n", ReadControlRegister(3));
|
|
|
|
TraversePageTables();
|
|
|
|
ListMemoryMap();
|
|
|
|
InitPrint();
|
|
|
|
WriteStringWithFont("Initty Testing");
|
|
|
|
SetupInitialGDT();
|
|
SetupIDT();
|
|
InitInterrupts();
|
|
|
|
PCIEnumerate();
|
|
|
|
InitMemoryManager();
|
|
MemoryTest();
|
|
|
|
InitPaging();
|
|
|
|
|
|
for(;;) { }
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
void Exit(int ExitCode) {
|
|
SerialPrintf("Kernel stopped with code %x\r\n", ExitCode);
|
|
|
|
} |