Add debugging to the bootstrap, reformat some function names
This commit is contained in:
parent
c22bd248e3
commit
b13f7e6755
|
@ -43,12 +43,12 @@ __attribute__((aligned(4096))) static size_t FirstPageTable[512] = {0};
|
|||
*/
|
||||
|
||||
//Play sound using built in speaker
|
||||
static void play_sound(uint32_t nFrequence) {
|
||||
static void playPCSpeaker(uint32_t frequency) {
|
||||
uint32_t Div;
|
||||
uint8_t tmp;
|
||||
|
||||
//Set the PIT to the desired frequency
|
||||
Div = 1193180 / nFrequence;
|
||||
Div = 1193180 / frequency;
|
||||
WritePort(0x0043, 0xb6, 1);
|
||||
WritePort(0x0042, (uint8_t) (Div), 1);
|
||||
WritePort(0x0042, (uint8_t) (Div >> 8), 1);
|
||||
|
@ -61,22 +61,22 @@ __attribute__((aligned(4096))) static size_t FirstPageTable[512] = {0};
|
|||
}
|
||||
|
||||
//make it shutup
|
||||
static void nosound() {
|
||||
static void stopPCSpeaker() {
|
||||
uint8_t tmp = ReadPort(0x0061, 1) & 0xFC;
|
||||
|
||||
WritePort(0x0061, tmp, 1);
|
||||
}
|
||||
|
||||
//Make a beep
|
||||
void beep() {
|
||||
play_sound(1000);
|
||||
timer_wait(10);
|
||||
nosound();
|
||||
void beepPCSpeaker() {
|
||||
playPCSpeaker(1000);
|
||||
awaitTicks(10);
|
||||
stopPCSpeaker();
|
||||
//set_PIT_2(old_frequency);
|
||||
}
|
||||
|
||||
|
||||
void timer_wait(int ticks){
|
||||
void awaitTicks(int ticks) {
|
||||
uint64_t FinalTick = time + ticks;
|
||||
|
||||
int i = 0;
|
||||
|
@ -94,9 +94,19 @@ void PrepareSystem(FILELOADER_PARAMS* FLOP) {
|
|||
|
||||
|
||||
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. */
|
||||
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();
|
||||
InstallIDT();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user