7e9f95109cb1323cf4dafca883fad5e2064128f0 boot/bootdata/bootcd.ini | 14 +++++++-- boot/freeldr/freeldr/ntldr/setupldr.c | 53 +++++++++++++++++++---------------- 2 files changed, 41 insertions(+), 26 deletions(-) diff --git a/boot/bootdata/bootcd.ini b/boot/bootdata/bootcd.ini index 4f2017c..3b82eee 100644 --- a/boot/bootdata/bootcd.ini +++ b/boot/bootdata/bootcd.ini @@ -1,6 +1,6 @@ [FREELOADER] DefaultOS=Setup -TimeOut=0 +TimeOut=10 [Display] TitleText=ReactOS Setup @@ -25,7 +25,17 @@ MinimalUI=Yes TimeText=Seconds until highlighted choice will be started automatically: [Operating Systems] -Setup="Setup" +Setup="Setup (Get Options from txtsetup.sif)" +Setup_Debug_KDSERIAL="Setup (Debug /KDSERIAL)" +Setup_Debug="Setup (Debug)" [Setup] BootType=ReactOSSetup + +[Setup_Debug_KDSERIAL] +BootType=ReactOSSetup +Options=/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE + +[Setup_Debug] +BootType=ReactOSSetup +Options=/NOGUIBOOT /DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /FIRSTCHANCE diff --git a/boot/freeldr/freeldr/ntldr/setupldr.c b/boot/freeldr/freeldr/ntldr/setupldr.c index 2010a27..df38dbe 100644 --- a/boot/freeldr/freeldr/ntldr/setupldr.c +++ b/boot/freeldr/freeldr/ntldr/setupldr.c @@ -188,7 +188,7 @@ LoadReactOSSetup( CHAR BootPath[MAX_PATH]; CHAR BootOptions2[256]; PCSTR LoadOptions; - PSTR BootOptions; + PSTR BootOptions = NULL; BOOLEAN BootFromFloppy; BOOLEAN Success; ULONG i, ErrorLine; @@ -276,7 +276,10 @@ LoadReactOSSetup( *BootOptions2 = ANSI_NULL; ArgValue = GetArgumentValue(Argc, Argv, "Options"); if (ArgValue && *ArgValue) + { RtlStringCbCopyA(BootOptions2, sizeof(BootOptions2), ArgValue); + BootOptions = BootOptions2; + } TRACE("BootOptions: '%s'\n", BootOptions2); @@ -319,36 +322,38 @@ LoadReactOSSetup( TRACE("BootPath: '%s', SystemPath: '%s'\n", BootPath, SystemPath); - /* Get load options - debug and non-debug */ - if (!InfFindFirstLine(InfHandle, "SetupData", "OsLoadOptions", &InfContext)) + if (!BootOptions) { - ERR("Failed to find 'SetupData/OsLoadOptions'\n"); - return EINVAL; - } - - if (!InfGetDataField(&InfContext, 1, &LoadOptions)) - { - ERR("Failed to get load options\n"); - return EINVAL; - } + /* Get load options - debug and non-debug */ + if (!InfFindFirstLine(InfHandle, "SetupData", "OsLoadOptions", &InfContext)) + { + ERR("Failed to find 'SetupData/OsLoadOptions'\n"); + return EINVAL; + } + if (!InfGetDataField(&InfContext, 1, &LoadOptions)) + { + ERR("Failed to get load options\n"); + return EINVAL; + } #if DBG - /* Get debug load options and use them */ - if (InfFindFirstLine(InfHandle, "SetupData", "DbgOsLoadOptions", &InfContext)) - { - PCSTR DbgLoadOptions; + /* Get debug load options and use them */ + if (InfFindFirstLine(InfHandle, "SetupData", "DbgOsLoadOptions", &InfContext)) + { + PCSTR DbgLoadOptions; - if (InfGetDataField(&InfContext, 1, &DbgLoadOptions)) - LoadOptions = DbgLoadOptions; - } + if (InfGetDataField(&InfContext, 1, &DbgLoadOptions)) + LoadOptions = DbgLoadOptions; + } #endif - /* Copy LoadOptions (original string will be freed) */ - BootOptions = FrLdrTempAlloc(strlen(LoadOptions) + 1, TAG_BOOT_OPTIONS); - ASSERT(BootOptions); - strcpy(BootOptions, LoadOptions); + /* Copy LoadOptions (original string will be freed) */ + BootOptions = FrLdrTempAlloc(strlen(LoadOptions) + 1, TAG_BOOT_OPTIONS); + ASSERT(BootOptions); + strcpy(BootOptions, LoadOptions); - TRACE("BootOptions: '%s'\n", BootOptions); + TRACE("BootOptions: '%s'\n", BootOptions); + } /* Allocate and minimally-initialize the Loader Parameter Block */ AllocateAndInitLPB(_WIN32_WINNT_WS03, &LoaderBlock);