Author: fireball
Date: Sat Mar 21 14:11:44 2009
New Revision: 40156
URL:
http://svn.reactos.org/svn/reactos?rev=40156&view=rev
Log:
- Allocate and initialize setup loader block.
- Add setup loader block pointer conversion to WinLdrInitializePhase1 (if it exists).
- Temporary: provide empty boot options string.
Modified:
trunk/reactos/boot/freeldr/freeldr/windows/setupldr2.c
trunk/reactos/boot/freeldr/freeldr/windows/winldr.c
Modified: trunk/reactos/boot/freeldr/freeldr/windows/setupldr2.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/windo…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/windows/setupldr2.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/windows/setupldr2.c [iso-8859-1] Sat Mar 21
14:11:44 2009
@@ -21,6 +21,8 @@
#include <freeldr.h>
#include <ndk/ldrtypes.h>
+#include <arc/setupblk.h>
+
#include <debug.h>
// TODO: Move to .h
@@ -155,6 +157,7 @@
CHAR SystemPath[512], SearchPath[512];
CHAR FileName[512];
CHAR BootPath[512];
+ CHAR LoadOptions[512];
LPCSTR BootOptions;
PVOID NtosBase = NULL, HalBase = NULL, KdComBase = NULL;
BOOLEAN Status;
@@ -163,6 +166,7 @@
HINF InfHandle;
INFCONTEXT InfContext;
PLOADER_PARAMETER_BLOCK LoaderBlock, LoaderBlockVA;
+ PSETUP_LOADER_BLOCK SetupBlock;
KERNEL_ENTRY_POINT KiSystemStartup;
PLDR_DATA_TABLE_ENTRY KernelDTE, HalDTE, KdComDTE = NULL;
// Mm-related things
@@ -249,6 +253,14 @@
/* Allocate and minimalistic-initialize LPB */
AllocateAndInitLPB(&LoaderBlock);
+ /* Allocate and initialize setup loader block */
+ SetupBlock = MmHeapAlloc(sizeof(SETUP_LOADER_BLOCK));
+ RtlZeroMemory(SetupBlock, sizeof(SETUP_LOADER_BLOCK));
+ LoaderBlock->SetupLdrBlock = SetupBlock;
+
+ /* Set textmode setup flag */
+ SetupBlock->Flags = SETUPLDR_TEXT_MODE;
+
/* Detect hardware */
UseRealHeap = TRUE;
LoaderBlock->ConfigurationRoot = MachHwDetect();
@@ -300,7 +312,8 @@
WinLdrSetupForNt(LoaderBlock, &GdtIdt, &PcrBasePage, &TssBasePage);
/* Initialize Phase 1 - no drivers loading anymore */
- WinLdrInitializePhase1(LoaderBlock, (PCHAR)BootOptions, SystemPath, BootPath,
_WIN32_WINNT_WS03);
+ LoadOptions[0] = 0;
+ WinLdrInitializePhase1(LoaderBlock, LoadOptions, SystemPath, BootPath,
_WIN32_WINNT_WS03);
/* Save entry-point pointer and Loader block VAs */
KiSystemStartup = (KERNEL_ENTRY_POINT)KernelDTE->EntryPoint;
@@ -325,6 +338,11 @@
//WinLdrpDumpBootDriver(LoaderBlockVA);
//WinLdrpDumpArcDisks(LoaderBlockVA);
+ /*asm(".intel_syntax noprefix\n");
+ asm("test1:\n");
+ asm("jmp test1\n");
+ asm(".att_syntax\n");*/
+
/* Pass control */
(*KiSystemStartup)(LoaderBlockVA);
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 [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/windows/winldr.c [iso-8859-1] Sat Mar 21 14:11:44
2009
@@ -201,7 +201,11 @@
Extension->DrvDBImage = PaToVa(WinLdrLoadModule(MiscFiles,
&Extension->DrvDBSize, LoaderRegistryData));
+ /* Convert extension and setup block pointers */
LoaderBlock->Extension = PaToVa(Extension);
+
+ if (LoaderBlock->SetupLdrBlock)
+ LoaderBlock->SetupLdrBlock = PaToVa(LoaderBlock->SetupLdrBlock);
}
// Last step before going virtual