Author: sir_richard
Date: Wed Sep 15 07:40:50 2010
New Revision: 48772
URL:
http://svn.reactos.org/svn/reactos?rev=48772&view=rev
Log:
Patch by Anton Yarotsky:
[FREELDR]: Fix Headless support.
Modified:
trunk/reactos/boot/freeldr/freeldr/windows/headless.c
trunk/reactos/boot/freeldr/freeldr/windows/winldr.c
Modified: trunk/reactos/boot/freeldr/freeldr/windows/headless.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/windo…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/windows/headless.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/windows/headless.c [iso-8859-1] Wed Sep 15 07:40:50
2010
@@ -237,11 +237,6 @@
StallExecutionProcessor(WinLdrTerminalDelay);
}
}
- else
- {
- /* The port was bogus, so don't give any information to the kernel */
- RtlZeroMemory(&LoaderRedirectionInformation, sizeof(HEADLESS_LOADER_BLOCK));
- }
}
VOID
@@ -249,6 +244,9 @@
{
PCHAR RedirectPort;
+ /* Start fresh */
+ RtlZeroMemory(&LoaderRedirectionInformation, sizeof(HEADLESS_LOADER_BLOCK));
+
/* Use a direction port if one was given, or use ACPI to detect one instead */
RedirectPort = strstr(BootOptions, "/redirect=");
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] Wed Sep 15 07:40:50
2010
@@ -203,6 +203,25 @@
/* See KiRosFrldrLpbToNtLpb for details */
Extension->AcpiTable = (PVOID)1;
}
+
+ /* Set headless block pointer */
+ extern HEADLESS_LOADER_BLOCK LoaderRedirectionInformation;
+ extern BOOLEAN WinLdrTerminalConnected;
+ if (WinLdrTerminalConnected)
+ {
+ Extension->HeadlessLoaderBlock = MmHeapAlloc(sizeof(HEADLESS_LOADER_BLOCK));
+ if (Extension->HeadlessLoaderBlock == NULL)
+ {
+ UiMessageBox("Failed to allocate HLB Extension!");
+ while (TRUE);
+ return;
+ }
+ RtlCopyMemory(
+ Extension->HeadlessLoaderBlock,
+ &LoaderRedirectionInformation,
+ sizeof(HEADLESS_LOADER_BLOCK));
+ Extension->HeadlessLoaderBlock = PaToVa(Extension->HeadlessLoaderBlock);
+ }
/* Load drivers database */
strcpy(MiscFiles, BootPath);
@@ -215,6 +234,7 @@
if (LoaderBlock->SetupLdrBlock)
LoaderBlock->SetupLdrBlock = PaToVa(LoaderBlock->SetupLdrBlock);
+
}
BOOLEAN
@@ -601,10 +621,6 @@
/* Save final value of LoaderPagesSpanned */
LoaderBlockVA->Extension->LoaderPagesSpanned = LoaderPagesSpanned;
-
- /* Set headless block pointer */
- extern HEADLESS_LOADER_BLOCK LoaderRedirectionInformation;
- LoaderBlockVA->Extension->HeadlessLoaderBlock =
PaToVa(&LoaderRedirectionInformation);
DPRINTM(DPRINT_WINDOWS, "Hello from paged mode, KiSystemStartup %p, LoaderBlockVA
%p!\n",
KiSystemStartup, LoaderBlockVA);