//+---------------------------------------------------------------------------- // // File: main.c // // Module: // // Synopsis: // // Created: sgasch 4 Jul 2003 // //+---------------------------------------------------------------------------- #include "kernel.h" #include "hal.h" #include "rtl.h" extern char __bss_start; extern char end; void ZeroBSS(void) { BYTE *pBssStart, *pBssEnd; pBssStart = &__bss_start; pBssEnd = &end; // Fill .bss section with zero RtlSetMemory((void *)pBssStart, '\0', (pBssEnd - pBssStart)); } void _assert(CHAR *szFunction, CHAR *szFile, ULONG uLine) { HalVideoSetCursorPosition(0, 0); HalVideoPrint("ASSERTION in %s at %s line %u.\n", szFunction, szFile, uLine); while(1) { ; } } // // Entry point of the kernel. Not called main because I don't care to // listen to gcc's warnings about argc and argv anymore. // int KernelEntry(BIOS_HARDWARE_BLOCK *phw) { ZeroBSS(); HalVideoInitialize(phw); HalInitializeInterrupts(); HalVideoPrint("Interrupts initialized.\n"); hang: HalReadTimestampCounter(); HalVideoPrint("Timestamp Counter: %u%u\n", ((g_ullTimeStampCounter >> 32) & 0xffffffff), (g_ullTimeStampCounter & 0xffffffff)); goto hang; return(-1); }