diff --git a/reactos/drivers/fs/vfat/create.c b/reactos/drivers/fs/vfat/create.c index 60fae006cc4..f70a081ee84 100644 --- a/reactos/drivers/fs/vfat/create.c +++ b/reactos/drivers/fs/vfat/create.c @@ -1,4 +1,4 @@ -/* $Id: create.c,v 1.20 2001/03/06 23:31:44 cnettel Exp $ +/* $Id: create.c,v 1.21 2001/03/07 08:57:09 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -674,7 +674,7 @@ VfatCreateFile (PDEVICE_OBJECT DeviceObject, PIRP Irp) { Irp->IoStatus.Information = 0; Irp->IoStatus.Status = STATUS_OBJECT_NAME_INVALID; - return(Status); + return(STATUS_OBJECT_NAME_INVALID); } c++; } diff --git a/reactos/drivers/input/keyboard/keyboard.c b/reactos/drivers/input/keyboard/keyboard.c index 4f499c2866d..b2542c8dd96 100644 --- a/reactos/drivers/input/keyboard/keyboard.c +++ b/reactos/drivers/input/keyboard/keyboard.c @@ -108,6 +108,12 @@ static const BYTE asciiTable4[37]= '{', '|', '}', '"' }; +VOID STDCALL +KdSystemDebugControl(ULONG Code); + +static LONG DoSystemDebug = -1; +static BOOLEAN InSysRq = FALSE; + /* FUNCTIONS *****************************************************************/ static void KbdWrite(int addr,BYTE data) @@ -409,6 +415,13 @@ static VOID KbdDpcRoutine(PKDPC Dpc, PIRP Irp = (PIRP)SystemArgument2; PDEVICE_OBJECT DeviceObject = (PDEVICE_OBJECT)SystemArgument1; + if (SystemArgument1 == NULL && DoSystemDebug != -1) + { + KdSystemDebugControl(DoSystemDebug); + DoSystemDebug = -1; + return; + } + CHECKPOINT; DPRINT("KbdDpcRoutine(DeviceObject %x, Irp %x)\n", DeviceObject,Irp); @@ -474,9 +487,20 @@ static BOOLEAN KeyboardHandler(PKINTERRUPT Interrupt, PVOID Context) // DbgPrint("Key: %c\n",VirtualToAscii(ScanToVirtual(thisKey),isDown)); // DbgPrint("Key: %x\n",ScanToVirtual(thisKey)); - if (ScanToVirtual(thisKey)==0x2a) + if (ScanToVirtual(thisKey) == VK_PRINT && isDown) { - KeBugCheck(0); + InSysRq = TRUE; + } + else if (ScanToVirtual(thisKey) == VK_PRINT && !isDown) + { + InSysRq = FALSE; + } + else if (InSysRq == TRUE && ScanToVirtual(thisKey) >= VK_A && + ScanToVirtual(thisKey) <= VK_Z && isDown) + { + DoSystemDebug = ScanToVirtual(thisKey) - VK_A; + KeInsertQueueDpc(&KbdDpc, NULL, NULL); + return(TRUE); } if (CurrentIrp!=NULL) diff --git a/reactos/ntoskrnl/Makefile b/reactos/ntoskrnl/Makefile index 80a6648ddb6..4c792e141b7 100644 --- a/reactos/ntoskrnl/Makefile +++ b/reactos/ntoskrnl/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.12 2001/03/06 17:28:25 dwelch Exp $ +# $Id: Makefile,v 1.13 2001/03/07 08:57:08 dwelch Exp $ # # ReactOS Operating System # @@ -289,6 +289,7 @@ C_OBJECTS = $(OBJECTS_NT) $(OBJECTS_HAL) $(OBJECTS_MM) $(OBJECTS_MM_I386) \ $(OBJECTS_PO) $(OBJECTS_KD) D_FILES := $(filter-out ex/napi.%, $(filter-out nt/zw.%, $(C_OBJECTS:.o=.d))) +D1_FILES := $(join $(dir $(D_FILES)), $(addprefix ., $(notdir $(D_FILES)))) # Resources OBJECTS_RESOURCE = \ @@ -453,13 +454,13 @@ CLEAN_FILES = $(OBJECTS_PATH)\*.o cc\*.o cm\*.o dbg\*.o ex\*.o hal\x86\*.o io\*. ke\*.o ldr\*.o mm\*.o nt\*.o ob\*.o ps\*.o rtl\*.o se\*.o \ ke\i386\*.o mm\i386\*.o fs\*.o po\*.o nls\*.o lpc\*.o \ kd\*.o $(TARGETNAME).o $(TARGETNAME).a junk.tmp base.tmp temp.exp \ - $(TARGETNAME).exe $(TARGETNAME).nostrip.exe $(TARGETNAME).sym $(TARGETNAME).coff $(join $(dir $(D_FILES)), $(addprefix ., $(notdir $(D_FILES)))) + $(TARGETNAME).exe $(TARGETNAME).nostrip.exe $(TARGETNAME).sym $(TARGETNAME).coff $(D1_FILES) else CLEAN_FILES = $(OBJECTS_PATH)/*.o cc/*.o cm/*.o dbg/*.o ex/*.o hal/x86/*.o io/*.o \ ke/*.o ldr/*.o mm/*.o nt/*.o ob/*.o ps/*.o rtl/*.o se/*.o \ ke/i386/*.o mm/i386/*.o fs/*.o po/*.o nls/*.o lpc/*.o \ kd/*.o $(TARGETNAME).o $(TARGETNAME).a junk.tmp base.tmp temp.exp \ - $(TARGETNAME).exe $(TARGETNAME).nostrip.exe $(TARGETNAME).sym $(TARGETNAME).coff $(join $(dir $(D_FILES)), $(addprefix ., $(notdir $(D_FILES)))) + $(TARGETNAME).exe $(TARGETNAME).nostrip.exe $(TARGETNAME).sym $(TARGETNAME).coff $(D1_FILES) endif @@ -572,7 +573,7 @@ ex/napi.o: ex/napi.c ../include/ntdll/napi.h ke/main.o: ke/main.c ../include/reactos/buildno.h -#include $(join $(dir $(D_FILES)), $(addprefix ., $(notdir $(D_FILES)))) +include $(D1_FILES) .%.d: %.c $(CC) $(CFLAGS) -M $< | sed -e 's#$(*F).o#$(@D)/&#g' | sed -e 's@ /[^ ]*@@g' -e 's@^\(.*\)\.o:@.\1.d \1.o:@' > $@ diff --git a/reactos/ntoskrnl/kd/kdebug.c b/reactos/ntoskrnl/kd/kdebug.c index 137a0cb5f38..32989b53cf3 100644 --- a/reactos/ntoskrnl/kd/kdebug.c +++ b/reactos/ntoskrnl/kd/kdebug.c @@ -1,4 +1,4 @@ -/* $Id: kdebug.c,v 1.19 2001/02/14 02:53:53 dwelch Exp $ +/* $Id: kdebug.c,v 1.20 2001/03/07 08:57:08 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -12,7 +12,7 @@ #include #include #include - +#include /* serial debug connection */ #define DEFAULT_DEBUG_PORT 2 /* COM2 */ @@ -337,4 +337,17 @@ KeEnterKernelDebugger (VOID) #endif } +VOID STDCALL +KdSystemDebugControl(ULONG Code) +{ + if (Code == 0) + { + MiDebugDumpNonPagedPool(); + } + if (Code == 1) + { + KeBugCheck(0); + } +} + /* EOF */ diff --git a/reactos/ntoskrnl/ke/bug.c b/reactos/ntoskrnl/ke/bug.c index 12c793dff23..34463b21d29 100644 --- a/reactos/ntoskrnl/ke/bug.c +++ b/reactos/ntoskrnl/ke/bug.c @@ -1,4 +1,4 @@ -/* $Id: bug.c,v 1.14 2000/08/12 19:33:21 dwelch Exp $ +/* $Id: bug.c,v 1.15 2001/03/07 08:57:08 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -14,6 +14,7 @@ #include #include +#include #include @@ -78,12 +79,26 @@ KeBugCheckEx ( DbgPrint("Bug detected (code %x param %x %x %x %x)\n",BugCheckCode, BugCheckParameter1,BugCheckParameter2,BugCheckParameter3, BugCheckParameter4); + if (PsGetCurrentProcess() != NULL) + { + DbgPrint("Pid: %x <", PsGetCurrentProcess()->UniqueProcessId); + DbgPrint("%.8s> ", PsGetCurrentProcess()->ImageFileName); + } + if (PsGetCurrentThread() != NULL) + { + DbgPrint("Thrd: %x Tid: %x\n", + PsGetCurrentThread(), + PsGetCurrentThread()->Cid.UniqueThread); + } // PsDumpThreads(); KeDumpStackFrames(&((&BugCheckCode)[-1]),64); #if 1 for(;;) - __asm__("hlt\n\t"); //PJS: use HLT instruction, rather than busy wait + { + /* PJS: use HLT instruction, rather than busy wait */ + __asm__("hlt\n\t"); + } #else for(;;); #endif @@ -107,6 +122,17 @@ KeBugCheck (ULONG BugCheckCode) for(;;); } InBugCheck = 1; + if (PsGetCurrentProcess() != NULL) + { + DbgPrint("Pid: %x <", PsGetCurrentProcess()->UniqueProcessId); + DbgPrint("%.8s> ", PsGetCurrentProcess()->ImageFileName); + } + if (PsGetCurrentThread() != NULL) + { + DbgPrint("Thrd: %x Tid: %x\n", + PsGetCurrentThread(), + PsGetCurrentThread()->Cid.UniqueThread); + } // PsDumpThreads(); KeDumpStackFrames(&((&BugCheckCode)[-1]), 80); #if 1 diff --git a/reactos/ntoskrnl/mm/marea.c b/reactos/ntoskrnl/mm/marea.c index fc54441f408..2b6b0518125 100644 --- a/reactos/ntoskrnl/mm/marea.c +++ b/reactos/ntoskrnl/mm/marea.c @@ -64,15 +64,15 @@ MEMORY_AREA* MmOpenMemoryAreaByAddress(PMADDRESS_SPACE AddressSpace, assert(current_entry->Blink->Flink == current_entry); if (current_entry->Flink->Blink != current_entry) { - DPRINT("BaseAddress %x\n", current->BaseAddress); - DPRINT("current_entry->Flink %x ", current_entry->Flink); - DPRINT("¤t_entry->Flink %x\n", + DPRINT1("BaseAddress %x\n", current->BaseAddress); + DPRINT1("current_entry->Flink %x ", current_entry->Flink); + DPRINT1("¤t_entry->Flink %x\n", ¤t_entry->Flink); - DPRINT("current_entry->Flink->Blink %x\n", + DPRINT1("current_entry->Flink->Blink %x\n", current_entry->Flink->Blink); - DPRINT("¤t_entry->Flink->Blink %x\n", + DPRINT1("¤t_entry->Flink->Blink %x\n", ¤t_entry->Flink->Blink); - DPRINT("¤t_entry->Flink %x\n", + DPRINT1("¤t_entry->Flink %x\n", ¤t_entry->Flink); } assert(current_entry->Flink->Blink == current_entry); diff --git a/reactos/ntoskrnl/mm/npool.c b/reactos/ntoskrnl/mm/npool.c index 6e5c1a4cde4..a7112a56ae6 100644 --- a/reactos/ntoskrnl/mm/npool.c +++ b/reactos/ntoskrnl/mm/npool.c @@ -1,4 +1,4 @@ -/* $Id: npool.c,v 1.34 2001/03/06 14:41:18 dwelch Exp $ +/* $Id: npool.c,v 1.35 2001/03/07 08:57:08 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -98,10 +98,13 @@ MiDebugDumpNonPagedPool(VOID) KeAcquireSpinLock(&MmNpoolLock, &oldIrql); DbgPrint("******* Dumping non paging pool contents ******\n"); - while (current!=NULL) + while (current != NULL) { - DPRINT("Size 0x%x Tag 0x%x Allocator 0x%x\n", - current->size, current->Tag, current->Caller); + DbgPrint("Size 0x%x Tag 0x%x (%c%c%c%c) Allocator 0x%x\n", + current->size, current->Tag, + current->Tag >> 24, (current->Tag >> 16) & 0xFF, + (current->Tag >> 8) & 0xFF, current->Tag & 0xFF, + current->Caller); current=current->next; } diff --git a/reactos/ntoskrnl/mm/pool.c b/reactos/ntoskrnl/mm/pool.c index 2b95074c3d0..9a19f9b37a8 100644 --- a/reactos/ntoskrnl/mm/pool.c +++ b/reactos/ntoskrnl/mm/pool.c @@ -1,4 +1,4 @@ -/* $Id: pool.c,v 1.11 2001/03/06 14:41:18 dwelch Exp $ +/* $Id: pool.c,v 1.12 2001/03/07 08:57:09 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -51,7 +51,9 @@ EiAllocatePool(POOL_TYPE PoolType, case PagedPool: case PagedPoolCacheAligned: - Block = ExAllocatePagedPoolWithTag(PoolType,NumberOfBytes,Tag); + // Block = ExAllocatePagedPoolWithTag(PoolType,NumberOfBytes,Tag); + Block = ExAllocateNonPagedPoolWithTag(PoolType, NumberOfBytes, + Tag, Caller); break; default: diff --git a/reactos/ntoskrnl/ntoskrnl.def b/reactos/ntoskrnl/ntoskrnl.def index 9baae1ebe92..d3b87001c49 100644 --- a/reactos/ntoskrnl/ntoskrnl.def +++ b/reactos/ntoskrnl/ntoskrnl.def @@ -1,4 +1,4 @@ -; $Id: ntoskrnl.def,v 1.99 2001/03/01 15:36:34 ekohl Exp $ +; $Id: ntoskrnl.def,v 1.100 2001/03/07 08:57:08 dwelch Exp $ ; ; reactos/ntoskrnl/ntoskrnl.def ; @@ -1105,4 +1105,4 @@ WRITE_PORT_BUFFER_USHORT@12 WRITE_PORT_UCHAR@8 WRITE_PORT_ULONG@8 WRITE_PORT_USHORT@8 - +KdSystemDebugControl@4 diff --git a/reactos/ntoskrnl/ntoskrnl.edf b/reactos/ntoskrnl/ntoskrnl.edf index f86d966f4c1..913f7c33118 100644 --- a/reactos/ntoskrnl/ntoskrnl.edf +++ b/reactos/ntoskrnl/ntoskrnl.edf @@ -1,4 +1,4 @@ -; $Id: ntoskrnl.edf,v 1.86 2001/03/01 15:36:34 ekohl Exp $ +; $Id: ntoskrnl.edf,v 1.87 2001/03/07 08:57:08 dwelch Exp $ ; ; reactos/ntoskrnl/ntoskrnl.def ; @@ -1104,3 +1104,4 @@ WRITE_PORT_BUFFER_USHORT=WRITE_PORT_BUFFER_USHORT@12 WRITE_PORT_UCHAR=WRITE_PORT_UCHAR@8 WRITE_PORT_ULONG=WRITE_PORT_ULONG@8 WRITE_PORT_USHORT=WRITE_PORT_USHORT@8 +KdSystemDebugControl = KdSystemDebugControl@4 \ No newline at end of file