From 070de9c196a8ce3cbedd556170680afc0812cbf7 Mon Sep 17 00:00:00 2001 From: Nocturn9x Date: Fri, 18 Nov 2022 01:54:03 +0100 Subject: [PATCH] Nicer error messages + bootsector fix --- src/boot/mbr.s | 8 ++++---- src/boot/util/disk.s | 4 ++-- src/kernel/main.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/boot/mbr.s b/src/boot/mbr.s index 7a4b491..6a129c4 100644 --- a/src/boot/mbr.s +++ b/src/boot/mbr.s @@ -47,9 +47,9 @@ jmp $ ; Keeps jumping at the current address (loops forever) ; Here we define our variables: They need to be defined after the ; halting because otherwise they will be executed as code -real_mode_msg: db "TSBL is starting up", 0 -protected_mode_msg: db "Switched to protected mode", 0 -loading_kernel_msg: db "Loading kernel into memory", 0 +real_mode_msg: db "TSOS: Booting", 0 +protected_mode_msg: db "TSOS: Protected mode OK", 0 +loading_kernel_msg: db "TSOS: Loading kernel", 0 boot_drive: db 0 @@ -58,7 +58,7 @@ load_kernel: ; Loads the kernel into memory mov si, loading_kernel_msg call bios_println mov bx, kernel_offset - mov dh, 4 + mov dh, 3 mov dl, [boot_drive] call load_disk ret diff --git a/src/boot/util/disk.s b/src/boot/util/disk.s index 3fce252..f09be8a 100644 --- a/src/boot/util/disk.s +++ b/src/boot/util/disk.s @@ -57,5 +57,5 @@ disk_loop: jmp $ -disk_read_error_msg: db "Read error: ", 0 -disk_sectors_error_msg: db "Sector read count error", 0 +disk_read_error_msg: db "TSOS: Read error: ", 0 +disk_sectors_error_msg: db "TSOS: Sector read count error", 0 diff --git a/src/kernel/main.c b/src/kernel/main.c index eb1f56f..f1af790 100644 --- a/src/kernel/main.c +++ b/src/kernel/main.c @@ -26,7 +26,7 @@ i32 kmain(void) { // Newline so we skip the log // messages from the bootloader - kprint("\nTSOS kernel started!"); + kprint("\nTSOS: Kernel load OK"); // TODO... return 0x022172; // :D } \ No newline at end of file