Author: fireball
Date: Thu Oct 5 01:11:16 2006
New Revision: 24401
URL:
http://svn.reactos.org/svn/reactos?rev=24401&view=rev
Log:
- Remove some crap from the LoadAndBootWindows()
- Change debugging checkpoint to online-asm (all this is temporary), since any code after
while(1){}; seems to be just optimized away by gcc
- Uncomment NDEBUG for now
Modified:
trunk/reactos/boot/freeldr/freeldr/windows/winldr.c
Modified: trunk/reactos/boot/freeldr/freeldr/windows/winldr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/windo…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/windows/winldr.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/windows/winldr.c Thu Oct 5 01:11:16 2006
@@ -21,7 +21,9 @@
#include <freeldr.h>
-#define NDEBUG
+#include <ndk/ldrtypes.h>
+
+//#define NDEBUG
#include <debug.h>
VOID DumpMemoryAllocMap(VOID);
@@ -442,7 +444,6 @@
RtlZeroMemory(*GdtIdt, NumPages << MM_PAGE_SHIFT);
}
-
VOID
LoadAndBootWindows(PCSTR OperatingSystemName, WORD OperatingSystemVersion)
{
@@ -454,13 +455,16 @@
BOOLEAN Status;
ULONG SectionId;
ULONG BootDevice;
- PLOADER_PARAMETER_BLOCK LoaderBlock=NULL, LoaderBlockVA;
+ PLOADER_PARAMETER_BLOCK LoaderBlock, LoaderBlockVA;
+ KERNEL_ENTRY_POINT KiSystemStartup;
PLDR_DATA_TABLE_ENTRY KernelDTE, HalDTE;
- KERNEL_ENTRY_POINT KiSystemStartup;
+ PIMAGE_NT_HEADERS NtosHeader;
// Mm-related things
- PVOID GdtIdt=NULL;
+ PVOID GdtIdt;
ULONG PcrBasePage=0;
ULONG TssBasePage=0;
+
+
//sprintf(MsgBuffer,"Booting Microsoft(R) Windows(R) OS version '%04x' is
not implemented yet", OperatingSystemVersion);
//UiMessageBox(MsgBuffer);
@@ -562,6 +566,7 @@
/* Save entry-point pointer (VA) */
KiSystemStartup = (KERNEL_ENTRY_POINT)KernelDTE->EntryPoint;
+
LoaderBlockVA = PaToVa(LoaderBlock);
/* Debugging... */
@@ -575,23 +580,17 @@
WinLdrpDumpMemoryDescriptors(LoaderBlockVA);
- /*__asm
- {
- or esp, KSEG0_BASE;
- or ebp, KSEG0_BASE;
- }*/
-
- /*
- {
- ULONG *trrr = (ULONG *)(512*1024*1024);
-
- *trrr = 0x13131414;
- }
-
- //FIXME!
- while (1) {};*/
-
- (KiSystemStartup)(LoaderBlockVA);
+ // temp: offset C9000
+
+ //FIXME: If I substitute this debugging checkpoint, GCC will "optimize away"
the code below
+ //while (1) {};
+ asm(".intel_syntax noprefix\n");
+ asm("test1:\n");
+ asm("jmp test1\n");
+ asm(".att_syntax\n");
+
+
+ (*KiSystemStartup)(LoaderBlockVA);
return;
}