*UART0DR = ByteToSend;
}
+DECLSPEC_NORETURN
VOID
FrLdrBugCheckWithMessage(
ULONG BugCode,
static const CHAR *i386ExceptionDescriptionText[] =
{
- "Exception 00: DIVIDE BY ZERO",
- "Exception 01: DEBUG EXCEPTION",
- "Exception 02: NON-MASKABLE INTERRUPT EXCEPTION",
- "Exception 03: BREAKPOINT (INT 3)",
- "Exception 04: OVERFLOW",
- "Exception 05: BOUND EXCEPTION",
- "Exception 06: INVALID OPCODE",
- "Exception 07: FPU NOT AVAILABLE",
- "Exception 08: DOUBLE FAULT",
- "Exception 09: COPROCESSOR SEGMENT OVERRUN",
- "Exception 0A: INVALID TSS",
- "Exception 0B: SEGMENT NOT PRESENT",
- "Exception 0C: STACK EXCEPTION",
- "Exception 0D: GENERAL PROTECTION FAULT",
- "Exception 0E: PAGE FAULT",
- "Exception 0F: Reserved",
- "Exception 10: COPROCESSOR ERROR",
- "Exception 11: ALIGNMENT CHECK",
- "Exception 12: MACHINE CHECK"
+ "DIVIDE BY ZERO",
+ "DEBUG EXCEPTION",
+ "NON-MASKABLE INTERRUPT EXCEPTION",
+ "BREAKPOINT (INT 3)",
+ "OVERFLOW",
+ "BOUND EXCEPTION",
+ "INVALID OPCODE",
+ "FPU NOT AVAILABLE",
+ "DOUBLE FAULT",
+ "COPROCESSOR SEGMENT OVERRUN",
+ "INVALID TSS",
+ "SEGMENT NOT PRESENT",
+ "STACK EXCEPTION",
+ "GENERAL PROTECTION FAULT",
+ "PAGE FAULT",
+ "Reserved",
+ "COPROCESSOR ERROR",
+ "ALIGNMENT CHECK",
+ "MACHINE CHECK"
};
#define SCREEN_ATTR 0x1F // Bright white on blue background
PrintText("FreeLdr " KERNEL_VERSION_STR " " KERNEL_VERSION_BUILD_STR "\n"
"Report this error on the ReactOS Bug Tracker: https://jira.reactos.org\n\n"
- "0x%02lx: %s\n\n", TrapIndex, i386ExceptionDescriptionText[TrapIndex]);
+ "0x%02lx: Exception %02X: %s\n\n",
+ TrapIndex,
+ TrapIndex,
+ i386ExceptionDescriptionText[TrapIndex]);
#ifdef _M_IX86
PrintText("EAX: %.8lx ESP: %.8lx CR0: %.8lx DR0: %.8lx\n",
InstructionPointer[6], InstructionPointer[7]);
}
+DECLSPEC_NORETURN
VOID
FrLdrBugCheckWithMessage(
ULONG BugCode,
for (;;);
}
+static
+DECLSPEC_NORETURN
void
-NTAPI
FrLdrBugCheckEx(
ULONG BugCode,
PCHAR File,
for (;;);
}
+DECLSPEC_NORETURN
void
NTAPI
FrLdrBugCheck(ULONG BugCode)
TRAP_STUB _i386MachineCheck, 18
TRAP_STUB _i386SimdFloatError, 19
+#if DBG
/************************************************************************
* DEBUGGING SUPPORT FUNCTIONS
************************************************************************/
BREAKPOINT_TEMPLATE _INSTRUCTION_BREAKPOINT4, HEX(00fffffff), HEX(0000003c0)
BREAKPOINT_TEMPLATE _MEMORY_READWRITE_BREAKPOINT4, HEX(00fffffff), HEX(0300003c0)
BREAKPOINT_TEMPLATE _MEMORY_WRITE_BREAKPOINT4, HEX(00fffffff), HEX(0100003c0)
+#endif // DBG
END
}
#ifndef _M_ARM
+DECLSPEC_NORETURN
VOID __cdecl Reboot(VOID)
{
//TODO: Replace with a true firmware reboot eventually
#define DriveMapGetBiosDriveNumber(DeviceName) 0
+DECLSPEC_NORETURN
FORCEINLINE VOID Reboot(VOID)
{
DbgBreakPoint();
#define TAG_HW_RESOURCE_LIST 'lRwH'
#define TAG_HW_DISK_CONTEXT 'cDwH'
+/*
+ * These aren't defined in the ioaccess.h header.
+ * Because of that we manually define the symbols we need to make use of I/O ports.
+ */
+#define READ_PORT_BUFFER_UCHAR(port, buffer, count) __inbytestring(H2I(port), buffer, count)
+#define READ_PORT_BUFFER_USHORT(port, buffer, count) __inwordstring(H2I(port), buffer, count)
+#define READ_PORT_BUFFER_ULONG(port, buffer, count) __indwordstring(H2I(port), buffer, count)
+#define WRITE_PORT_BUFFER_UCHAR(port, buffer, count) __outbytestring(H2I(port), buffer, count)
+#define WRITE_PORT_BUFFER_USHORT(port, buffer, count) __outwordstring(H2I(port), buffer, count)
+#define WRITE_PORT_BUFFER_ULONG(port, buffer, count) __outdwordstring(H2I(port), buffer, count)
+
/* PROTOTYPES ***************************************************************/
/* hardware.c */
IN UCHAR BootDrive OPTIONAL,
IN ULONG BootPartition OPTIONAL);
+DECLSPEC_NORETURN
VOID __cdecl Relocator16Boot(
IN REGS* In,
IN USHORT StackSegment,
IN USHORT CodeSegment,
IN USHORT CodePointer);
+DECLSPEC_NORETURN
VOID __cdecl Reboot(VOID);
+
VOID DetectHardware(VOID);
#endif /* ! __ASM__ */
//
// You may have as many BREAKPOINT()'s as you like but you may only
// have up to four of any of the others.
-#define BREAKPOINT() __asm__ ("int $3");
+#define BREAKPOINT() __debugbreak()
void INSTRUCTION_BREAKPOINT1(unsigned long addr);
void MEMORY_READWRITE_BREAKPOINT1(unsigned long addr);
void MEMORY_WRITE_BREAKPOINT1(unsigned long addr);
#endif // DBG
+DECLSPEC_NORETURN
void
NTAPI
FrLdrBugCheck(ULONG BugCode);
+DECLSPEC_NORETURN
VOID
FrLdrBugCheckWithMessage(
ULONG BugCode,
#include <poppack.h>
// Implemented in linux.S
+DECLSPEC_NORETURN
VOID __cdecl
BootLinuxKernel(
_In_ ULONG KernelSize,
#define KiEnterInterruptTrap(TrapFrame) /* We do all neccessary in asm code */
#endif // _M_AMD64
+#ifdef _MINIHAL_
+#if defined(_M_IX86) || defined(_M_AMD64)
+/* Use intrinsics for IA-32 and amd64 */
+#include <ioaccess.h>
+
+#define READ_PORT_BUFFER_UCHAR(port, buffer, count) __inbytestring(H2I(port), buffer, count)
+#define READ_PORT_BUFFER_USHORT(port, buffer, count) __inwordstring(H2I(port), buffer, count)
+#define READ_PORT_BUFFER_ULONG(port, buffer, count) __indwordstring(H2I(port), buffer, count)
+#define WRITE_PORT_BUFFER_UCHAR(port, buffer, count) __outbytestring(H2I(port), buffer, count)
+#define WRITE_PORT_BUFFER_USHORT(port, buffer, count) __outwordstring(H2I(port), buffer, count)
+#define WRITE_PORT_BUFFER_ULONG(port, buffer, count) __outdwordstring(H2I(port), buffer, count)
+#endif
+#endif
+
extern BOOLEAN HalpNMIInProgress;
extern ADDRESS_USAGE HalpDefaultIoSpace;
add_definitions(-D_MINIHAL_)
list(APPEND MINI_HAL_SOURCE
- ../generic/portio.c
../legacy/bus/bushndlr.c
../legacy/bus/cmosbus.c
../legacy/bus/isabus.c