Configure Windows Kernel Debug Port via Registry
This guide provides an overview of configuring the Windows kernel to initialize with a custom debug port using the Windows Registry Editor. Modifying these low-level settings enables developers and system administrators to direct kernel debugging traffic through specific hardware ports or custom network configurations during early boot stages. Below are the direct steps required to configure the custom debug port parameters in the registry.
Step 1: Open the Registry Editor with Administrative Privileges
- Press
Win + Rto open the Run dialog box. - Type
regeditand pressEnter. - Select Yes when prompted by User Account Control (UAC) to grant administrative permissions.
Step 2: Navigate to the Kernel Configuration Key
In the Registry Editor address bar, navigate to the following path:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
Step 3: Create or Open the KernelDebugger Key
- Check if a key named
KernelDebuggerexists underControl. - If it does not exist, right-click the
Controlfolder, select New > Key, and name itKernelDebugger.
Step 4: Configure the Custom Debug Port Values
Within the KernelDebugger key, configure the specific
parameters required for your debugging interface:
- For Serial (COM) Debugging:
- Right-click the right pane, select New >
DWORD (32-bit) Value, and name it
Port. Set its value to your desired COM port number (e.g.,1for COM1,2for COM2) in decimal. - Right-click, select New > DWORD (32-bit)
Value, and name it
BaudRate. Set the value in decimal to your target baud rate (such as115200).
- Right-click the right pane, select New >
DWORD (32-bit) Value, and name it
- For Network (KDNET) Debugging:
- Right-click, select New > DWORD (32-bit)
Value, and name it
DebugPort. Set the value to your preferred network port (default is typically50000–50039in decimal). - Right-click, select New > String
Value, and name it
Keyif a specific encryption key is required for the connection.
- Right-click, select New > DWORD (32-bit)
Value, and name it
Step 5: Apply Changes and Restart
- Close the Registry Editor.
- Restart the machine to force the Windows kernel to initialize with the new debug port configuration during the next boot cycle. Ensure the host debugger is listening on the matching port and transport medium.