*/
#include <freeldr.h>
-
-#define NDEBUG
#include <debug.h>
BOOLEAN AcpiPresent = FALSE;
static BOOLEAN
FindAcpiBios(VOID)
{
- PUCHAR Ptr;
+ PUCHAR Ptr;
- /* Find the 'Root System Descriptor Table Pointer' */
- Ptr = (PUCHAR)0xE0000;
- while ((ULONG)Ptr < 0x100000)
+ /* Find the 'Root System Descriptor Table Pointer' */
+ Ptr = (PUCHAR)0xE0000;
+ while ((ULONG)Ptr < 0x100000)
{
- if (!memcmp(Ptr, "RSD PTR ", 8))
- {
- DbgPrint((DPRINT_HWDETECT, "ACPI supported\n"));
+ if (!memcmp(Ptr, "RSD PTR ", 8))
+ {
+ DbgPrint((DPRINT_HWDETECT, "ACPI supported\n"));
- return TRUE;
- }
+ return TRUE;
+ }
- Ptr = (PUCHAR)((ULONG)Ptr + 0x10);
+ Ptr = (PUCHAR)((ULONG)Ptr + 0x10);
}
- DbgPrint((DPRINT_HWDETECT, "ACPI not supported\n"));
+ DbgPrint((DPRINT_HWDETECT, "ACPI not supported\n"));
- return FALSE;
+ return FALSE;
}
VOID
DetectAcpiBios(FRLDRHKEY SystemKey, ULONG *BusNumber)
{
- WCHAR Buffer[80];
- FRLDRHKEY BiosKey;
- LONG Error;
+ WCHAR Buffer[80];
+ FRLDRHKEY BiosKey;
+ LONG Error;
- if (FindAcpiBios())
+ if (FindAcpiBios())
{
- AcpiPresent = TRUE;
- /* Create new bus key */
- swprintf(Buffer,
- L"MultifunctionAdapter\\%u", *BusNumber);
- Error = RegCreateKey(SystemKey,
- Buffer,
- &BiosKey);
- if (Error != ERROR_SUCCESS)
- {
- DbgPrint((DPRINT_HWDETECT, "RegCreateKey() failed (Error %u)\n", (int)Error));
- return;
- }
+ AcpiPresent = TRUE;
+ /* Create new bus key */
+ swprintf(Buffer,
+ L"MultifunctionAdapter\\%u", *BusNumber);
+ Error = RegCreateKey(SystemKey,
+ Buffer,
+ &BiosKey);
+ if (Error != ERROR_SUCCESS)
+ {
+ DbgPrint((DPRINT_HWDETECT, "RegCreateKey() failed (Error %u)\n", (int)Error));
+ return;
+ }
#if 0
/* Set 'Component Information' */
0xFFFFFFFF);
#endif
- /* Increment bus number */
- (*BusNumber)++;
-
- /* Set 'Identifier' value */
- Error = RegSetValue(BiosKey,
- L"Identifier",
- REG_SZ,
- (PCHAR)L"ACPI BIOS",
- 10 * sizeof(WCHAR));
- if (Error != ERROR_SUCCESS)
- {
- DbgPrint((DPRINT_HWDETECT, "RegSetValue() failed (Error %u)\n", (int)Error));
- return;
- }
+ /* Increment bus number */
+ (*BusNumber)++;
+
+ /* Set 'Identifier' value */
+ Error = RegSetValue(BiosKey,
+ L"Identifier",
+ REG_SZ,
+ (PCHAR)L"ACPI BIOS",
+ 10 * sizeof(WCHAR));
+ if (Error != ERROR_SUCCESS)
+ {
+ DbgPrint((DPRINT_HWDETECT, "RegSetValue() failed (Error %u)\n", (int)Error));
+ return;
+ }
}
}
return TRUE;
}
- printf("No APM BIOS found\n");
+ DbgPrint((DPRINT_HWDETECT, "No APM BIOS found\n"));
return FALSE;
}
}
// If we get here then the read failed
- DiskError("Disk Read Failed", RegsOut.b.ah);
+ DiskError("Disk Read Failed in LBA mode", RegsOut.b.ah);
return FALSE;
}
// If we retried 3 times then fail
if (RetryCount >= 3)
{
- DiskError("Disk Read Failed", RegsOut.b.ah);
+ DiskError("Disk Read Failed in CHS mode, after retrying 3 times", RegsOut.b.ah);
return FALSE;
}
*/
#include <freeldr.h>
-
-#define NDEBUG
#include <debug.h>
// Returns a pointer to a CACHE_BLOCK structure
*/
#include <freeldr.h>
-
-#define NDEBUG
#include <debug.h>
///////////////////////////////////////////////////////////////////////////////////////
}
}
+#else
+
+VOID DebugPrint(ULONG Mask, char *format, ...)
+{
+}
+
#endif // defined DBG
*/
#include <freeldr.h>
-
-#define NDEBUG
#include <debug.h>
#undef UNIMPLEMENTED
*/
#include <freeldr.h>
-
-#define NDEBUG
#include <debug.h>
BOOLEAN DiskGetActivePartitionEntry(ULONG DriveNumber,
*/
#include <freeldr.h>
-
-#define NDEBUG
#include <debug.h>
#ifdef __i386__
*/
#include <freeldr.h>
-
-#define NDEBUG
#include <debug.h>
VOID BootMain(LPSTR CmdLine)
*/
#include <freeldr.h>
-
-#define NDEBUG
#include <debug.h>
GEOMETRY Ext2DiskGeometry; // Ext2 file system disk geometry
*/
#include <freeldr.h>
-
-#define NDEBUG
#include <debug.h>
ULONG BytesPerSector; /* Number of bytes per sector */
*/
#include <freeldr.h>
-
-#define NDEBUG
#include <debug.h>
/////////////////////////////////////////////////////////////////////////////////////////////
*/
#include <freeldr.h>
-
-#define NDEBUG
#include <debug.h>
/////////////////////////////////////////////////////////////////////////////////////////////
*/
#include <freeldr.h>
-
-#define NDEBUG
#include <debug.h>
#define SECTORSIZE 2048
*/
#include <freeldr.h>
-
-#define NDEBUG
#include <debug.h>
PNTFS_BOOTSECTOR NtfsBootSector;
#ifndef __DEBUG_H
#define __DEBUG_H
-#ifdef DBG
+#define DPRINT_NONE 0x00000000 // No debug print
+#define DPRINT_WARNING 0x00000001 // OR this with DebugPrintMask to enable debugger messages and other misc stuff
+#define DPRINT_MEMORY 0x00000002 // OR this with DebugPrintMask to enable memory management messages
+#define DPRINT_FILESYSTEM 0x00000004 // OR this with DebugPrintMask to enable file system messages
+#define DPRINT_INIFILE 0x00000008 // OR this with DebugPrintMask to enable .ini file messages
+#define DPRINT_UI 0x00000010 // OR this with DebugPrintMask to enable user interface messages
+#define DPRINT_DISK 0x00000020 // OR this with DebugPrintMask to enable disk messages
+#define DPRINT_CACHE 0x00000040 // OR this with DebugPrintMask to enable cache messages
+#define DPRINT_REGISTRY 0x00000080 // OR this with DebugPrintMask to enable registry messages
+#define DPRINT_REACTOS 0x00000100 // OR this with DebugPrintMask to enable ReactOS messages
+#define DPRINT_LINUX 0x00000200 // OR this with DebugPrintMask to enable Linux messages
+#define DPRINT_HWDETECT 0x00000400 // OR this with DebugPrintMask to enable hardware detection messages
+#define DPRINT_WINDOWS 0x00000800 // OR this with DebugPrintMask to enable messages from Windows loader
+
+VOID DebugPrint(ULONG Mask, char *format, ...);
- #define DPRINT_NONE 0x00000000 // No debug print
- #define DPRINT_WARNING 0x00000001 // OR this with DebugPrintMask to enable debugger messages and other misc stuff
- #define DPRINT_MEMORY 0x00000002 // OR this with DebugPrintMask to enable memory management messages
- #define DPRINT_FILESYSTEM 0x00000004 // OR this with DebugPrintMask to enable file system messages
- #define DPRINT_INIFILE 0x00000008 // OR this with DebugPrintMask to enable .ini file messages
- #define DPRINT_UI 0x00000010 // OR this with DebugPrintMask to enable user interface messages
- #define DPRINT_DISK 0x00000020 // OR this with DebugPrintMask to enable disk messages
- #define DPRINT_CACHE 0x00000040 // OR this with DebugPrintMask to enable cache messages
- #define DPRINT_REGISTRY 0x00000080 // OR this with DebugPrintMask to enable registry messages
- #define DPRINT_REACTOS 0x00000100 // OR this with DebugPrintMask to enable ReactOS messages
- #define DPRINT_LINUX 0x00000200 // OR this with DebugPrintMask to enable Linux messages
- #define DPRINT_HWDETECT 0x00000400 // OR this with DebugPrintMask to enable hardware detection messages
- #define DPRINT_WINDOWS 0x00000800 // OR this with DebugPrintMask to enable messages from Windows loader
+#ifdef DBG
VOID DebugInit(VOID);
- VOID DebugPrint(ULONG Mask, char *format, ...);
VOID DebugPrint1(char *format, ...);
VOID DebugDumpBuffer(ULONG Mask, PVOID Buffer, ULONG Length);
#define DbgPrint(_x_) DebugPrint _x_ ;
- #define DPRINT1 DebugPrint1
+ #define DPRINT1 DebugPrint1
#define BugCheck(_x_) { DebugPrint(DPRINT_WARNING, "Fatal Error: %s:%d(%s)\n", __FILE__, __LINE__, __FUNCTION__); DebugPrint _x_ ; for (;;); }
#define DbgDumpBuffer(_x_, _y_, _z_) DebugDumpBuffer(_x_, _y_, _z_)
#else
#define DebugInit()
- #define DbgPrint(_x_)
- #define DPRINT1(_x_)
+ #define DbgPrint(_x_) { if (0) DebugPrint _x_; }
+ #define DPRINT1(_x_) { if (0) printf _x_; }
#define BugCheck(_x_)
#define DbgDumpBuffer(_x_, _y_, _z_)
*/
#include <freeldr.h>
-
-#define NDEBUG
#include <debug.h>
BOOLEAN IniOpenSection(PCSTR SectionName, ULONG* SectionId)
*/
#include <freeldr.h>
-
-#define NDEBUG
#include <debug.h>
PINI_SECTION IniFileSectionListHead = NULL;
#include <freeldr.h>
-
-#define NDEBUG
#include <debug.h>
#ifdef __i386__
*/
#include <freeldr.h>
-
-#define NDEBUG
#include <debug.h>
#ifdef DBG
*/
#include <freeldr.h>
-
-#define NDEBUG
#include <debug.h>
-#ifdef DBG
ULONG AllocationCount = 0;
+#ifdef DBG
VOID VerifyHeap(VOID);
VOID DumpMemoryAllocMap(VOID);
VOID IncrementAllocationCount(VOID);
#include <freeldr.h>
#include <cmlib.h>
-
-#define NDEBUG
#include <debug.h>
/* FUNCTIONS ****************************************************************/
*/
#include <freeldr.h>
-
-#define NDEBUG
#include <debug.h>
ROS_LOADER_PARAMETER_BLOCK LoaderBlock;
*/
#include <freeldr.h>
-
-#define NDEBUG
#include <debug.h>
static FRLDRHKEY RootKey;
*/
#include <freeldr.h>
+#include <debug.h>
ROS_LOADER_PARAMETER_BLOCK LoaderBlock;
char reactos_kernel_cmdline[255]; // Command line passed to kernel
*/
#include <freeldr.h>
-
-#define NDEBUG
#include <debug.h>
#include <freeldr.h>
//#include <ndk/ldrtypes.h>
-
-#define NDEBUG
#include <debug.h>
/* FUNCTIONS **************************************************************/
/* INCLUDES ***************************************************************/
#include <freeldr.h>
-
-//#define NDEBUG
#include <debug.h>
#include <freeldr.h>
#include <ndk/ldrtypes.h>
-
-//#define NDEBUG
#include <debug.h>
//FIXME: Do a better way to retrieve Arc disk information
#include <freeldr.h>
#include <ndk/asm.h>
-
-#define NDEBUG
#include <debug.h>
extern ULONG TotalNLSSize;
/* INCLUDES ***************************************************************/
#include <freeldr.h>
-
-#define NDEBUG
#include <debug.h>
// The only global var here, used to mark mem pages as NLS in WinLdrTurnOnPaging()