Author: tkreuzer
Date: Sun Jul 8 18:45:34 2012
New Revision: 56857
URL:
http://svn.reactos.org/svn/reactos?rev=56857&view=rev
Log:
[FREELDR]
- Make sure freeldr is not compiled with SSE instructions (default for VS 11+)
- Print trap number and instruction stream on bugcheck
- Fix assembly code for ML
Modified:
trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt
trunk/reactos/boot/freeldr/freeldr/arch/i386/i386bug.c
trunk/reactos/boot/freeldr/freeldr/arch/i386/i386trap.S
Modified: trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/CMake…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] Sun Jul 8 18:45:34
2012
@@ -31,6 +31,11 @@
add_definitions(-D_ZOOM2_)
endif()
endif()
+
+# for VS 2012 we need to explicitly disable SSE
+if (MSVC_VERSION GREATER 1699 AND ARCH MATCHES i386)
+ add_definitions(/arch:IA32)
+endif ()
list(APPEND FREELDR_COMMON_SOURCE
cmdline.c
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/i386bug.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/i386bug.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/i386bug.c [iso-8859-1] Sun Jul 8
18:45:34 2012
@@ -102,6 +102,8 @@
NTAPI
i386PrintExceptionText(ULONG TrapIndex, PKTRAP_FRAME TrapFrame, PKSPECIAL_REGISTERS
Special)
{
+ PUCHAR InstructionPointer;
+
MachVideoClearScreen(SCREEN_ATTR);
i386_ScreenPosX = 0;
i386_ScreenPosY = 0;
@@ -109,7 +111,7 @@
PrintText("An error occured in FreeLoader\n"
VERSION"\n"
"Report this error to the ReactOS Development mailing list
<ros-dev(a)reactos.org>\n\n"
- "%s\n", i386ExceptionDescriptionText[TrapIndex]);
+ "0x%02lx: %s\n", TrapIndex,
i386ExceptionDescriptionText[TrapIndex]);
#ifdef _M_IX86
PrintText("EAX: %.8lx ESP: %.8lx CR0: %.8lx DR0:
%.8lx\n",
TrapFrame->Eax, TrapFrame->HardwareEsp, Special->Cr0,
TrapFrame->Dr0);
@@ -137,6 +139,7 @@
TrapFrame->HardwareSegSs, Special->Ldtr, Special->Idtr.Limit);
i386PrintFrames(TrapFrame); // Display
frames
+ InstructionPointer = (PUCHAR)TrapFrame->Eip;
#else
PrintText("RAX: %.8lx R8: %.8lx R12: %.8lx RSI:
%.8lx\n",
TrapFrame->Rax, TrapFrame->R8, 0, TrapFrame->Rsi);
@@ -159,7 +162,13 @@
TrapFrame->SegGs, Special->Idtr.Base, Special->Idtr.Limit);
PrintText("SS: %.4lx LDTR: %.4lx TR: %.4lx\n\n",
TrapFrame->SegSs, Special->Ldtr, Special->Idtr.Limit);
+ InstructionPointer = (PUCHAR)TrapFrame->Rip;
#endif
+ PrintText("\nInstructionstream: %.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x
\n",
+ InstructionPointer[0], InstructionPointer[1],
+ InstructionPointer[2], InstructionPointer[3],
+ InstructionPointer[4], InstructionPointer[5],
+ InstructionPointer[6], InstructionPointer[7]);
}
char *BugCodeStrings[] =
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/i386trap.S
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/i386trap.S [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/i386trap.S [iso-8859-1] Sun Jul 8
18:45:34 2012
@@ -97,7 +97,7 @@
lea eax, [esp + (21 * 4)] // KTRAP_FRAME
push esp // KSPECIAL_REGISTERS
push eax
- push i386ExceptionIndex
+ push dword ptr ds:[i386ExceptionIndex]
call _i386PrintExceptionText@12
cli
@@ -109,24 +109,16 @@
MACRO(TRAP_STUB, function, index)
PUBLIC VAL(function)
-#ifdef _USE_ML
- function:
-#else
- \function:
-#endif
+ &function:
push 0 // Fake error code
- mov dword ptr i386ExceptionIndex, VAL(index)
+ mov dword ptr ds:[i386ExceptionIndex], VAL(index)
jmp i386CommonExceptionHandler
ENDM
MACRO(TRAP_STUB2, function, index)
PUBLIC VAL(function)
-#ifdef _USE_ML
- function:
-#else
- \function:
-#endif
- mov dword ptr i386ExceptionIndex, VAL(index)
+ &function:
+ mov dword ptr ds:[i386ExceptionIndex], VAL(index)
jmp i386CommonExceptionHandler
ENDM