Add debugging to the bootstrap, reformat some function names

This commit is contained in:
Curle 2019-09-11 03:58:53 +01:00
parent c22bd248e3
commit b13f7e6755

View File

@ -43,12 +43,12 @@ __attribute__((aligned(4096))) static size_t FirstPageTable[512] = {0};
*/ */
//Play sound using built in speaker //Play sound using built in speaker
static void play_sound(uint32_t nFrequence) { static void playPCSpeaker(uint32_t frequency) {
uint32_t Div; uint32_t Div;
uint8_t tmp; uint8_t tmp;
//Set the PIT to the desired frequency //Set the PIT to the desired frequency
Div = 1193180 / nFrequence; Div = 1193180 / frequency;
WritePort(0x0043, 0xb6, 1); WritePort(0x0043, 0xb6, 1);
WritePort(0x0042, (uint8_t) (Div), 1); WritePort(0x0042, (uint8_t) (Div), 1);
WritePort(0x0042, (uint8_t) (Div >> 8), 1); WritePort(0x0042, (uint8_t) (Div >> 8), 1);
@ -61,22 +61,22 @@ __attribute__((aligned(4096))) static size_t FirstPageTable[512] = {0};
} }
//make it shutup //make it shutup
static void nosound() { static void stopPCSpeaker() {
uint8_t tmp = ReadPort(0x0061, 1) & 0xFC; uint8_t tmp = ReadPort(0x0061, 1) & 0xFC;
WritePort(0x0061, tmp, 1); WritePort(0x0061, tmp, 1);
} }
//Make a beep //Make a beep
void beep() { void beepPCSpeaker() {
play_sound(1000); playPCSpeaker(1000);
timer_wait(10); awaitTicks(10);
nosound(); stopPCSpeaker();
//set_PIT_2(old_frequency); //set_PIT_2(old_frequency);
} }
void timer_wait(int ticks){ void awaitTicks(int ticks) {
uint64_t FinalTick = time + ticks; uint64_t FinalTick = time + ticks;
int i = 0; int i = 0;
@ -94,9 +94,19 @@ void PrepareSystem(FILELOADER_PARAMS* FLOP) {
SetupPrinting(FLOP->GPU_Info->GPUs[0]); SetupPrinting(FLOP->GPU_Info->GPUs[0]);
ClearScreen(Print_Info.defaultGPU);
printf("1");
SetupPrinting(FLOP->GPU_Info->GPUs[1]);
ClearScreen(Print_Info.defaultGPU);
printf("2");
/* All print functions are now available. */ /* All print functions are now available. */
printf("ready!"); printf("ready!");
serialInit();
serialPrintf("Kernel has been given control of the computer.\nStarting bootstrap init.\n");
FLOP->RTServices->ResetSystem(EfiResetShutdown, EFI_SUCCESS, 0, L"");
InstallGDT(); InstallGDT();
InstallIDT(); InstallIDT();