From 5298dfd20ba9a8219a22a43e1ef2a96c223a8fd0 Mon Sep 17 00:00:00 2001 From: Tyler McGurrin Date: Sat, 31 May 2025 12:23:55 -0400 Subject: [PATCH] Re-Add Debug Info, and Make it Print to COM1 --- Makefile | 6 ++++-- src/kernel/main.c | 18 +++++++++--------- src/libs/version.h | 2 +- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 8c6cec5..9693bf2 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/src/kernel/main.c b/src/kernel/main.c index 55b6657..fcdb407 100644 --- a/src/kernel/main.c +++ b/src/kernel/main.c @@ -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); + } diff --git a/src/libs/version.h b/src/libs/version.h index 940dd9a..205476d 100644 --- a/src/libs/version.h +++ b/src/libs/version.h @@ -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"