Author: fireball
Date: Wed Feb 7 23:56:12 2007
New Revision: 25748
URL:
http://svn.reactos.org/svn/reactos?rev=25748&view=rev
Log:
Merge fixes for LiveCD (25746, 25747 plus corresponding changes in ex/init.c).
LiveCD now works.
Modified:
branches/ros-branch-0_3_1/reactos/ntoskrnl/ex/init.c
branches/ros-branch-0_3_1/reactos/ntoskrnl/ex/power.c
branches/ros-branch-0_3_1/reactos/ntoskrnl/io/iomgr/arcname.c
branches/ros-branch-0_3_1/reactos/ntoskrnl/mm/mminit.c
Modified: branches/ros-branch-0_3_1/reactos/ntoskrnl/ex/init.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_1/reactos/ntoskr…
==============================================================================
--- branches/ros-branch-0_3_1/reactos/ntoskrnl/ex/init.c (original)
+++ branches/ros-branch-0_3_1/reactos/ntoskrnl/ex/init.c Wed Feb 7 23:56:12 2007
@@ -33,6 +33,7 @@
BOOLEAN ExpInTextModeSetup;
BOOLEAN IoRemoteBootClient;
ULONG InitSafeBootMode;
+BOOLEAN InitIsWinPEMode, InitWinPEModeType;
BOOLEAN NoGuiBoot = FALSE;
@@ -820,6 +821,7 @@
ExPhase2Init(PVOID Context)
{
LARGE_INTEGER Timeout;
+ PCHAR CommandLine;
HANDLE ProcessHandle;
HANDLE ThreadHandle;
NTSTATUS Status;
@@ -835,8 +837,11 @@
/* Do Phase 1 HAL Initialization */
HalInitSystem(1, KeLoaderBlock);
+ /* Get the command line and upcase it */
+ CommandLine = _strupr(KeLoaderBlock->LoadOptions);
+
/* Check if GUI Boot is enabled */
- if (strstr(KeLoaderBlock->LoadOptions, "NOGUIBOOT")) NoGuiBoot = TRUE;
+ if (strstr(CommandLine, "NOGUIBOOT")) NoGuiBoot = TRUE;
/* Display the boot screen image if not disabled */
if (!ExpInTextModeSetup) InbvDisplayInitialize2(NoGuiBoot);
@@ -845,6 +850,14 @@
/* Clear the screen to blue and display the boot notice and debug status */
if (NoGuiBoot) ExpDisplayNotice();
KdInitSystem(2, KeLoaderBlock);
+
+ /* Check if this is LiveCD (WinPE) mode */
+ if (strstr(CommandLine, "MININT"))
+ {
+ /* Setup WinPE Settings */
+ InitIsWinPEMode = TRUE;
+ InitWinPEModeType |= (strstr(CommandLine, "INRAM")) ? 0x80000000 : 1;
+ }
/* Initialize Power Subsystem in Phase 0 */
PoInit(0, AcpiTableDetected);
Modified: branches/ros-branch-0_3_1/reactos/ntoskrnl/ex/power.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_1/reactos/ntoskr…
==============================================================================
--- branches/ros-branch-0_3_1/reactos/ntoskrnl/ex/power.c (original)
+++ branches/ros-branch-0_3_1/reactos/ntoskrnl/ex/power.c Wed Feb 7 23:56:12 2007
@@ -150,7 +150,7 @@
InbvSetTextColor(15);
InbvInstallDisplayStringFilter(NULL);
InbvEnableDisplayString(TRUE);
- InbvSetScrollRegion(0, 0, 639, 479);
+ //InbvSetScrollRegion(0, 0, 639, 479);
}
if (Action == ShutdownNoReboot)
Modified: branches/ros-branch-0_3_1/reactos/ntoskrnl/io/iomgr/arcname.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_1/reactos/ntoskr…
==============================================================================
--- branches/ros-branch-0_3_1/reactos/ntoskrnl/io/iomgr/arcname.c (original)
+++ branches/ros-branch-0_3_1/reactos/ntoskrnl/io/iomgr/arcname.c Wed Feb 7 23:56:12
2007
@@ -33,6 +33,8 @@
FILE_BASIC_INFORMATION FileInfo;
NTSTATUS Status;
PCHAR p, q;
+ PCONFIGURATION_INFORMATION ConfigInfo = IoGetConfigurationInformation();
+ extern BOOLEAN InitIsWinPEMode, ExpInTextModeSetup;
/* Only ARC Name left - Build full ARC Name */
p = strstr(KeLoaderBlock->ArcBootDeviceName, "cdrom");
@@ -86,26 +88,32 @@
RtlFreeUnicodeString(&DeviceName);
}
- /* Build the name */
- sprintf(p, "cdrom(%lu)", DeviceNumber);
-
- /* Adjust original command line */
- q = strchr(p, ')');
- if (q)
+ if (!InitIsWinPEMode)
{
- q++;
- strcpy(Buffer, q);
+ /* Build the name */
sprintf(p, "cdrom(%lu)", DeviceNumber);
- strcat(p, Buffer);
+
+ /* Adjust original command line */
+ q = strchr(p, ')');
+ if (q)
+ {
+ q++;
+ strcpy(Buffer, q);
+ sprintf(p, "cdrom(%lu)", DeviceNumber);
+ strcat(p, Buffer);
+ }
}
}
+
+ /* OK, how many disks are there? */
+ DeviceNumber += ConfigInfo->DiskCount;
/* Return whether this is the CD or not */
- if (DeviceNumber != 1)
+ if ((InitIsWinPEMode) || (ExpInTextModeSetup))
{
/* Hack until IoAssignDriveLetters is fixed */
- swprintf(SharedUserData->NtSystemRoot, L"D:\\reactos");
- return TRUE;
+ swprintf(SharedUserData->NtSystemRoot, L"%c:\\reactos", 'C'
+ DeviceNumber);
+ return TRUE;
}
/* Failed */
Modified: branches/ros-branch-0_3_1/reactos/ntoskrnl/mm/mminit.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_1/reactos/ntoskr…
==============================================================================
--- branches/ros-branch-0_3_1/reactos/ntoskrnl/mm/mminit.c (original)
+++ branches/ros-branch-0_3_1/reactos/ntoskrnl/mm/mminit.c Wed Feb 7 23:56:12 2007
@@ -482,7 +482,7 @@
/*
* Initialise the modified page writer.
*/
- MmInitMpwThread();
+ if (!strstr(KeLoaderBlock->LoadOptions, "MININT")) MmInitMpwThread();
/* FIXME: Read parameters from memory */
}