NMI Support Patch 13:

[NMIDEBUG]: Add new NMI Debug driver. It registers an NMI callback on startup. The callback does nothing useful at the moment, but you can enhance it to add all sorts of debugging information that would otherwise be unavailable in situations such as an interrupt storm, IRQL hang, etc. When you send an NMI, such as by using QEMU, you should see the driver print a string.

svn path=/trunk/; revision=44878
This commit is contained in:
ReactOS Portable Systems Group 2010-01-02 04:50:08 +00:00
parent 91636ec6ed
commit 475b0fd7cb
4 changed files with 72 additions and 0 deletions

View file

@ -20,4 +20,7 @@
<directory name="null">
<xi:include href="null/null.rbuild" />
</directory>
<directory name="nmidebug">
<xi:include href="nmidebug/nmidebug.rbuild" />
</directory>
</group>

View file

@ -0,0 +1,49 @@
/*
* PROJECT: ReactOS NMI Debug Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/base/nmidebug/nmidebug.c
* PURPOSE: Driver Code
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <ntddk.h>
/* FUNCTIONS ******************************************************************/
BOOLEAN
NTAPI
NmiDbgCallback(IN PVOID Context,
IN BOOLEAN Handled)
{
//
// Let the user know we are alive
//
DbgPrint("NMI Callback entered! Letting the system crash...\n");
//
// Do not handle the NMI
//
return FALSE;
}
NTSTATUS
NTAPI
DriverEntry(IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath)
{
PAGED_CODE();
//
// Register NMI callback
//
KeRegisterNmiCallback(&NmiDbgCallback, NULL);
//
// Return success
//
return STATUS_SUCCESS;
}
/* EOF */

View file

@ -0,0 +1,9 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="nmidebug" type="kernelmodedriver" installbase="system32/drivers" installname="nmidebug.sys">
<include base="null">.</include>
<library>ntoskrnl</library>
<library>hal</library>
<file>nmidebug.c</file>
<file>nmidebug.rc</file>
</module>

View file

@ -0,0 +1,11 @@
#include <winver.h>
#include <ntverp.h>
#define VER_FILETYPE VFT_DRV
#define VER_FILESUBTYPE VFT2_DRV_SYSTEM
#define VER_FILEDESCRIPTION_STR "NMI debug driver"
#define VER_INTERNALNAME_STR "NMIDEBUG.SYS"
#define VER_ORIGINALFILENAME_STR "NMIDEBUG.SYS"
#define VER_LANGNEUTRAL
#include "common.ver"