Re-Add Debug Info, and Make it Print to COM1

This commit is contained in:
Tyler McGurrin 2025-05-31 12:23:55 -04:00
parent 16ab26257e
commit 5298dfd20b
3 changed files with 14 additions and 12 deletions

View File

@ -21,10 +21,12 @@ $(BUILD_DIR)/main_floppy.img: bootloader kernel
dd if=$(BUILD_DIR)/stage1.bin of=$(BUILD_DIR)/main_floppy.img conv=notrunc
mmd -i $(BUILD_DIR)/main_floppy.img "::boot"
mmd -i $(BUILD_DIR)/main_floppy.img "::misc"
mmd -i $(BUILD_DIR)/main_floppy.img "::misc/src"
mcopy -v -i $(BUILD_DIR)/main_floppy.img $(BUILD_DIR)/kernel.bin "::boot"
mcopy -i $(BUILD_DIR)/main_floppy.img $(BUILD_DIR)/nboot.bin "::nboot.bin"
mcopy -v -i $(BUILD_DIR)/main_floppy.img kparams "::boot"
mcopy -v -i $(BUILD_DIR)/main_floppy.img $(BUILD_DIR)/nboot.bin "::nboot.bin"
mcopy -v -i $(BUILD_DIR)/main_floppy.img test "::boot"
mcopy -v -i $(BUILD_DIR)/main_floppy.img kparams "::boot"
mcopy -s -i $(BUILD_DIR)/main_floppy.img src/* "::misc/src"
#
# Bootloader

View File

@ -42,7 +42,7 @@ void keyboard()
{
keyboard_scancode = i686_inb(PS2_KEYBOARD_PORT);
// Debug Message, need to make a serial output thingy :)
// printf("Keycode = %d Port = %d\n", keycode, PS2_KEYBOARD_PORT);
Serial_Printf(COM1_PORT, "Keycode = %d Port = %d\n", keyboard_scancode, PS2_KEYBOARD_PORT);
}
void __attribute__((section(".entry"))) start(BootParams* bootParams) {
@ -76,18 +76,18 @@ void __attribute__((section(".entry"))) start(BootParams* bootParams) {
Floppy_Drive_Start(1);
Print_Storage_Types(masterFDDType, slaveFDDType);
// printf("Kernel Params: %s\n", bootParams->KernelParams);
Serial_Printf(COM1_PORT, "Hello World!");
// Debug Info for Memory :3 i REALLY need to make a like serial debug output thingy
// printf("Boot Device: %x\n", bootParams->BootDevice);
// printf("Memory Region Count: %x\n", bootParams->Memory.RegionCount);
// for (int i = 0; i < bootParams->Memory.RegionCount; i++) {shell example
// printf("Memory: start=0x%llx length=0x%llx type=0x%x\n",
// bootParams->Memory.Regions[i].Begin, bootParams->Memory.Regions[i].Length, bootParams->Memory.Regions[i].Type);
// }
// Debug Info for Memory
Serial_Printf(COM1_PORT, "Memory Debug Info:\n");
Serial_Printf(COM1_PORT, "Boot Device: %x\n", bootParams->BootDevice);
Serial_Printf(COM1_PORT, "Memory Region Count: %x\n", bootParams->Memory.RegionCount);
for (int i = 0; i < bootParams->Memory.RegionCount; i++) {
Serial_Printf(COM1_PORT, "Memory: start=0x%llx length=0x%llx type=0x%x\n",
bootParams->Memory.Regions[i].Begin, bootParams->Memory.Regions[i].Length, bootParams->Memory.Regions[i].Type);
}

View File

@ -6,5 +6,5 @@
#pragma once
#define LOGO " _ _____ _ __________________\n / | / / | / | / / _/_ __/ ____/\n / |/ / /| | / |/ // / / / / __/ \n / /| / ___ |/ /| // / / / / /___ \n/_/ |_/_/ |_/_/ |_/___/ /_/ /_____/ \n"
#define VERSION "RD-00023"
#define VERSION "RD-00024"
#define BOOTLOGO " _ ______ ____ ____ ______\n / | / / __ )/ __ \\/ __ /_ __/\n / |/ / __ / / / / / / // / \n / /| / /_/ / /_/ / /_/ // / \n/_/ |_/_____/\\____/\\____//_/ \n"