Merge fixes for LiveCD (25746, 25747 plus corresponding changes in ex/init.c).

LiveCD now works.

svn path=/branches/ros-branch-0_3_1/; revision=25748
This commit is contained in:
Aleksey Bragin 2007-02-07 20:56:12 +00:00
parent aaba4e8b8c
commit f56e85deb7
4 changed files with 36 additions and 15 deletions

View file

@ -33,6 +33,7 @@ ULONG ExpInitializationPhase;
BOOLEAN ExpInTextModeSetup; BOOLEAN ExpInTextModeSetup;
BOOLEAN IoRemoteBootClient; BOOLEAN IoRemoteBootClient;
ULONG InitSafeBootMode; ULONG InitSafeBootMode;
BOOLEAN InitIsWinPEMode, InitWinPEModeType;
BOOLEAN NoGuiBoot = FALSE; BOOLEAN NoGuiBoot = FALSE;
@ -820,6 +821,7 @@ NTAPI
ExPhase2Init(PVOID Context) ExPhase2Init(PVOID Context)
{ {
LARGE_INTEGER Timeout; LARGE_INTEGER Timeout;
PCHAR CommandLine;
HANDLE ProcessHandle; HANDLE ProcessHandle;
HANDLE ThreadHandle; HANDLE ThreadHandle;
NTSTATUS Status; NTSTATUS Status;
@ -835,8 +837,11 @@ ExPhase2Init(PVOID Context)
/* Do Phase 1 HAL Initialization */ /* Do Phase 1 HAL Initialization */
HalInitSystem(1, KeLoaderBlock); HalInitSystem(1, KeLoaderBlock);
/* Get the command line and upcase it */
CommandLine = _strupr(KeLoaderBlock->LoadOptions);
/* Check if GUI Boot is enabled */ /* 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 */ /* Display the boot screen image if not disabled */
if (!ExpInTextModeSetup) InbvDisplayInitialize2(NoGuiBoot); if (!ExpInTextModeSetup) InbvDisplayInitialize2(NoGuiBoot);
@ -846,6 +851,14 @@ ExPhase2Init(PVOID Context)
if (NoGuiBoot) ExpDisplayNotice(); if (NoGuiBoot) ExpDisplayNotice();
KdInitSystem(2, KeLoaderBlock); 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 */ /* Initialize Power Subsystem in Phase 0 */
PoInit(0, AcpiTableDetected); PoInit(0, AcpiTableDetected);

View file

@ -150,7 +150,7 @@ ShutdownThreadMain(PVOID Context)
InbvSetTextColor(15); InbvSetTextColor(15);
InbvInstallDisplayStringFilter(NULL); InbvInstallDisplayStringFilter(NULL);
InbvEnableDisplayString(TRUE); InbvEnableDisplayString(TRUE);
InbvSetScrollRegion(0, 0, 639, 479); //InbvSetScrollRegion(0, 0, 639, 479);
} }
if (Action == ShutdownNoReboot) if (Action == ShutdownNoReboot)

View file

@ -33,6 +33,8 @@ IopApplyRosCdromArcHack(IN ULONG i)
FILE_BASIC_INFORMATION FileInfo; FILE_BASIC_INFORMATION FileInfo;
NTSTATUS Status; NTSTATUS Status;
PCHAR p, q; PCHAR p, q;
PCONFIGURATION_INFORMATION ConfigInfo = IoGetConfigurationInformation();
extern BOOLEAN InitIsWinPEMode, ExpInTextModeSetup;
/* Only ARC Name left - Build full ARC Name */ /* Only ARC Name left - Build full ARC Name */
p = strstr(KeLoaderBlock->ArcBootDeviceName, "cdrom"); p = strstr(KeLoaderBlock->ArcBootDeviceName, "cdrom");
@ -86,26 +88,32 @@ IopApplyRosCdromArcHack(IN ULONG i)
RtlFreeUnicodeString(&DeviceName); RtlFreeUnicodeString(&DeviceName);
} }
/* Build the name */ if (!InitIsWinPEMode)
sprintf(p, "cdrom(%lu)", DeviceNumber);
/* Adjust original command line */
q = strchr(p, ')');
if (q)
{ {
q++; /* Build the name */
strcpy(Buffer, q);
sprintf(p, "cdrom(%lu)", DeviceNumber); 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 */ /* Return whether this is the CD or not */
if (DeviceNumber != 1) if ((InitIsWinPEMode) || (ExpInTextModeSetup))
{ {
/* Hack until IoAssignDriveLetters is fixed */ /* Hack until IoAssignDriveLetters is fixed */
swprintf(SharedUserData->NtSystemRoot, L"D:\\reactos"); swprintf(SharedUserData->NtSystemRoot, L"%c:\\reactos", 'C' + DeviceNumber);
return TRUE; return TRUE;
} }
/* Failed */ /* Failed */

View file

@ -482,7 +482,7 @@ MmInit3(VOID)
/* /*
* Initialise the modified page writer. * Initialise the modified page writer.
*/ */
MmInitMpwThread(); if (!strstr(KeLoaderBlock->LoadOptions, "MININT")) MmInitMpwThread();
/* FIXME: Read parameters from memory */ /* FIXME: Read parameters from memory */
} }