Refine and export kernel debugger printing
All checks were successful
Builds / ExectOS (amd64, release) (push) Successful in 26s
Builds / ExectOS (amd64, debug) (push) Successful in 29s
Builds / ExectOS (i686, debug) (push) Successful in 30s
Builds / ExectOS (i686, release) (push) Successful in 28s

This commit is contained in:
2025-09-14 01:25:56 +02:00
parent 79ec28641a
commit f321ca908b
12 changed files with 143 additions and 19 deletions

23
xtoskrnl/includes/dbg.hh Normal file
View File

@@ -0,0 +1,23 @@
/**
* PROJECT: ExectOS
* COPYRIGHT: See COPYING.md in the top level directory
* FILE: xtoskrnl/includes/dbg.hh
* DESCRIPTION: Kernel debugging support
* DEVELOPERS: Aiken Harris <harraiken91@gmail.com>
*/
#ifndef __XTOSKRNL_DBG_HH
#define __XTOSKRNL_DBG_HH
#include <xtos.hh>
/* Redefine DebugPrint macro for the kernel to enable early debugging */
#undef DebugPrint
#ifdef DBG
#define DebugPrint(Format, ...) if(KD::DebugIo::KdPrint) KD::DebugIo::KdPrint(Format, __VA_ARGS__);
#else
#define DebugPrint(Format, ...) ((VOID)NULL)
#endif
#endif /* __XTOSKRNL_DBG_HH */

View File

@@ -2,7 +2,7 @@
* PROJECT: ExectOS
* COPYRIGHT: See COPYING.md in the top level directory
* FILE: xtoskrnl/includes/kd/dbgio.hh
* DESCRIPTION:
* DESCRIPTION: Kernel Debugger I/O support
* DEVELOPERS: Aiken Harris <harraiken91@gmail.com>
*/
@@ -17,6 +17,9 @@ namespace KD
{
class DebugIo
{
public:
STATIC PKD_PRINT_ROUTINE KdPrint;
private:
STATIC KD_DEBUG_MODE DebugMode;
STATIC PKD_INIT_ROUTINE IoProvidersInitRoutines[KDBG_PROVIDERS_COUNT];
@@ -25,7 +28,10 @@ namespace KD
STATIC ULONG SerialPortList[COMPORT_COUNT];
public:
STATIC XTCDECL VOID DbgPrint(PCWSTR Format, ...);
STATIC XTCDECL VOID DbgPrint(PCWSTR Format,
...);
STATIC XTCDECL VOID DbgPrintEx(PCWSTR Format,
VA_LIST Arguments);
STATIC XTAPI XTSTATUS InitializeDebugIoProviders(VOID);
STATIC XTAPI VOID SetPrintRoutine(PKD_PRINT_ROUTINE DebugPrintRoutine);

View File

@@ -27,6 +27,7 @@ extern "C" {
#include <ar.hh>
#include <dbg.hh>
#include <ex.hh>
#include <hl.hh>
#include <kd.hh>