[NTOSKRNL]

- Comment out some instructions in KiRestoreProcessorControlState for now
- move the FreeLdr debugprint hack
- Don't increment RIP on an int3
- improve debugprint for KiInvalidOpcodeFault

svn path=/branches/ros-amd64-bringup/; revision=43677
This commit is contained in:
Timo Kreuzer
2009-10-21 23:22:46 +00:00
parent 9bdbbfde2f
commit dc3965426c
3 changed files with 18 additions and 9 deletions
+2 -2
View File
@@ -468,8 +468,8 @@ KiRestoreProcessorControlState(PKPROCESSOR_STATE ProcessorState)
/* Restore GDT, IDT, LDT and TSS */
__lgdt(&ProcessorState->SpecialRegisters.Gdtr.Limit);
__lldt(&ProcessorState->SpecialRegisters.Ldtr);
__ltr(&ProcessorState->SpecialRegisters.Tr);
// __lldt(&ProcessorState->SpecialRegisters.Ldtr);
// __ltr(&ProcessorState->SpecialRegisters.Tr);
__lidt(&ProcessorState->SpecialRegisters.Idtr.Limit);
__ldmxcsr(&ProcessorState->SpecialRegisters.MxCsr);
+3 -3
View File
@@ -701,15 +701,15 @@ KiSystemStartupReal(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
/* Setup the IDT */
KeInitExceptions();
/* HACK: misuse this function to pass a function pointer to kdcom */
KdDebuggerInitialize1((PVOID)FrLdrDbgPrint);
/* Initialize debugging system */
KdInitSystem(0, KeLoaderBlock);
/* Check for break-in */
// if (KdPollBreakIn()) DbgBreakPointWithStatus(1);
/* HACK: misuse this function to pass a function pointer to kdcom */
KdDebuggerInitialize1((PVOID)FrLdrDbgPrint);
/* Hack! Wait for the debugger! */
while (!KdPollBreakIn());
+13 -4
View File
@@ -30,6 +30,9 @@ _MsgBreakpointTrap:
_MsgUnexpectedInterrupt:
.ascii "UnexpectedInterrupt\n\0"
_MsgInvalidOpcodeFault:
.ascii "General protection fault at %p!\n\0"
/* Helper Macros *************************************************************/
#define TRAPFLAG_SYSTEMSERVICE 1
@@ -267,9 +270,6 @@ _MsgUnexpectedInterrupt:
mov rdx, rbp
call _FrLdrDbgPrint[rip]
/* Increase Rip to skip the int3 */
inc qword ptr [rbp + KTRAP_FRAME_Rip]
DISPATCH_EXCEPTION STATUS_BREAKPOINT, 3, 0, 0, 0
/* Return */
@@ -310,9 +310,18 @@ _MsgUnexpectedInterrupt:
push 0
.allocstack 0x8
UNIMPLEMENTED KiInvalidOpcodeFault
ENTER_TRAP_FRAME (SIZE_EXCEPTION_RECORD + 0x28), 0
// DISPATCH_EXCEPTION STATUS_BREAKPOINT, 3, 0, 0, 0
mov rdx, [rbp + KTRAP_FRAME_Rip]
lea rcx, _MsgInvalidOpcodeFault[rip]
call _FrLdrDbgPrint[rip]
jmp $
/* Return */
LEAVE_TRAP_FRAME
iretq
.endproc
.proc KiNpxNotAvailableFault