From c1ec695ff66d8b701049945ff728f45c7e15eb9a Mon Sep 17 00:00:00 2001 From: antifallobst Date: Wed, 26 Apr 2023 20:14:06 +0200 Subject: [PATCH] feature (logger): implemented debug log macro which logs file and line number of its call in adition to a given format string --- inc/utils/logger.h | 2 ++ src/boot/kmain.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/inc/utils/logger.h b/inc/utils/logger.h index 6006ac1..dba1eb4 100644 --- a/inc/utils/logger.h +++ b/inc/utils/logger.h @@ -7,6 +7,8 @@ #define LOG_PORT 0x3F8 +#define DEBUG(f, args...) log(LOG_DEBUG, "%s:%d -> " f, __FILE_NAME__, __LINE__, ##args) + typedef enum { LOG_NONE, LOG_INFO, diff --git a/src/boot/kmain.c b/src/boot/kmain.c index b8cee57..7e5b3ee 100644 --- a/src/boot/kmain.c +++ b/src/boot/kmain.c @@ -60,6 +60,8 @@ void kmain(boot_info_T boot_info) { log(LOG_INFO, "!=====[ Kernel Initialized ]=====!\n"); + DEBUG("test %d", 1312); + pci_device_T* ahci_controller = pci_manager_find_device(PCI_CLASS_MASS_STORAGE_CONTROLLER, PCI_SUBCLASS_SERIAL_ATA_CONTROLLER, 1); CORE_HALT_FOREVER