From 7344c5ed4a6d46d675f853733dd8d160ae410fa8 Mon Sep 17 00:00:00 2001 From: Aiken Harris Date: Sat, 6 Jun 2026 18:57:32 +0200 Subject: [PATCH] Add function to query kernel debugger active state --- xtoskrnl/includes/kd.hh | 1 + xtoskrnl/includes/kd/debug.hh | 31 +++++++++++++++++++++++++++++++ xtoskrnl/kd/debug.cc | 24 ++++++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 xtoskrnl/includes/kd/debug.hh create mode 100644 xtoskrnl/kd/debug.cc diff --git a/xtoskrnl/includes/kd.hh b/xtoskrnl/includes/kd.hh index 859cfc7..dc91213 100644 --- a/xtoskrnl/includes/kd.hh +++ b/xtoskrnl/includes/kd.hh @@ -13,5 +13,6 @@ #include #include +#include #endif /* __XTOSKRNL_KD_HH */ diff --git a/xtoskrnl/includes/kd/debug.hh b/xtoskrnl/includes/kd/debug.hh new file mode 100644 index 0000000..a112c9d --- /dev/null +++ b/xtoskrnl/includes/kd/debug.hh @@ -0,0 +1,31 @@ +/** + * PROJECT: ExectOS + * COPYRIGHT: See COPYING.md in the top level directory + * FILE: xtoskrnl/includes/kd/debug.hh + * DESCRIPTION: Kernel Debugger + * DEVELOPERS: Aiken Harris + */ + +#ifndef __XTOSKRNL_KD_DEBUG_HH +#define __XTOSKRNL_KD_DEBUG_HH + +#include + + +/* Kernel Debugger */ +namespace KD +{ + class Debugger + { + public: + STATIC PKD_PRINT_ROUTINE KdPrint; + + private: + STATIC BOOLEAN Active; + + public: + STATIC XTAPI BOOLEAN DebuggerActive(VOID); + }; +} + +#endif /* __XTOSKRNL_KD_DEBUG_HH */ diff --git a/xtoskrnl/kd/debug.cc b/xtoskrnl/kd/debug.cc new file mode 100644 index 0000000..f79a816 --- /dev/null +++ b/xtoskrnl/kd/debug.cc @@ -0,0 +1,24 @@ +/** + * PROJECT: ExectOS + * COPYRIGHT: See COPYING.md in the top level directory + * FILE: xtoskrnl/kd/debug.cc + * DESCRIPTION: Kernel Debugger + * DEVELOPERS: Aiken Harris + */ + +#include + + +/** + * Determines whether the interactive kernel debugger is currently active and controlling the execution flow. + * + * @return This routine returns TRUE if the kernel debugger is active, or FALSE otherwise. + * + * @since XT 1.0 + */ +XTAPI +BOOLEAN +KD::Debugger::DebuggerActive(VOID) +{ + return Active; +}