From 3dbef7449109c3deba5e28fd29b16832c83239f3 Mon Sep 17 00:00:00 2001 From: Art Yerkes Date: Mon, 13 Aug 2007 03:10:40 +0000 Subject: [PATCH] Make boot options for the bootcd dependent on DBG. Suggested by Caemyr. svn path=/trunk/; revision=28311 --- reactos/boot/bootdata/txtsetup.sif | 4 ++-- .../boot/freeldr/freeldr/reactos/setupldr.c | 20 ++++++++++++++----- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/reactos/boot/bootdata/txtsetup.sif b/reactos/boot/bootdata/txtsetup.sif index 32f78034614..9c4b6166b3d 100644 --- a/reactos/boot/bootdata/txtsetup.sif +++ b/reactos/boot/bootdata/txtsetup.sif @@ -39,8 +39,8 @@ Cabinet=reactos.cab [SetupData] DefaultPath = \ReactOS -;OsLoadOptions = "/NOGUIBOOT /NODEBUG" -OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM1" +OsLoadOptions = "/NOGUIBOOT /NODEBUG" +DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM1" ;OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=SCREEN" ;OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=BOCHS" diff --git a/reactos/boot/freeldr/freeldr/reactos/setupldr.c b/reactos/boot/freeldr/freeldr/reactos/setupldr.c index c5af7d3c308..21fbef8eac9 100644 --- a/reactos/boot/freeldr/freeldr/reactos/setupldr.c +++ b/reactos/boot/freeldr/freeldr/reactos/setupldr.c @@ -166,7 +166,7 @@ VOID RunLoader(VOID) ULONG_PTR Base; ULONG Size; const char *SourcePath; - const char *LoadOptions; + const char *LoadOptions = "", *DbgLoadOptions = ""; char szKernelName[256]; HINF InfHandle; @@ -249,8 +249,18 @@ VOID RunLoader(VOID) return; } - /* Get load options */ - if (!InfFindFirstLine (InfHandle, +#ifdef DBG + /* Get load options */ + if (InfFindFirstLine (InfHandle, + "SetupData", + "DbgOsLoadOptions", + &InfContext)) + { + if (!InfGetDataField (&InfContext, 1, &DbgLoadOptions)) + DbgLoadOptions = ""; + } +#endif + if (!strlen(DbgLoadOptions) && !InfFindFirstLine (InfHandle, "SetupData", "OsLoadOptions", &InfContext)) @@ -283,8 +293,8 @@ VOID RunLoader(VOID) /* Set kernel command line */ MachDiskGetBootPath(reactos_kernel_cmdline, sizeof(reactos_kernel_cmdline)); - strcat(strcat(strcat(reactos_kernel_cmdline, SourcePath), " "), - LoadOptions); + strcat(strcat(strcat(strcat(reactos_kernel_cmdline, SourcePath), " "), + LoadOptions), DbgLoadOptions); strcpy(SystemRoot, SourcePath); strcat(SystemRoot, "\\");