From 17983ae6be25e32d7701f35dc6e2f20ee4b5d728 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Fri, 21 May 2004 20:29:56 +0000 Subject: [PATCH] - Added support for special value "LiveCD" of SystemPath option for loading ReactOS. It uses the known boot drive information as the boot path. svn path=/trunk/; revision=9457 --- freeldr/freeldr/CHANGELOG | 6 +++ freeldr/freeldr/include/version.h | 4 +- freeldr/freeldr/reactos/reactos.c | 87 ++++++++++++++++++------------- 3 files changed, 59 insertions(+), 38 deletions(-) diff --git a/freeldr/freeldr/CHANGELOG b/freeldr/freeldr/CHANGELOG index 0f3e57384c4..36b13baed63 100644 --- a/freeldr/freeldr/CHANGELOG +++ b/freeldr/freeldr/CHANGELOG @@ -1,3 +1,9 @@ +Changes in v1.8.20 (21/05/2004) (navaraf) + +- Added support for special value "LiveCD" of SystemPath option + for loading ReactOS. It uses the known boot drive information + as the boot path. + Changes in v1.8.19 (12/20/2003) (ekohl) - Detect PS/2 Port and Pointer Device (Mouse). diff --git a/freeldr/freeldr/include/version.h b/freeldr/freeldr/include/version.h index fbcc02ce68b..db7358ad37f 100644 --- a/freeldr/freeldr/include/version.h +++ b/freeldr/freeldr/include/version.h @@ -22,7 +22,7 @@ /* just some stuff */ -#define VERSION "FreeLoader v1.8.19" +#define VERSION "FreeLoader v1.8.20" #define COPYRIGHT "Copyright (C) 1998-2003 Brian Palmer " #define AUTHOR_EMAIL "" #define BY_AUTHOR "by Brian Palmer" @@ -36,7 +36,7 @@ // #define FREELOADER_MAJOR_VERSION 1 #define FREELOADER_MINOR_VERSION 8 -#define FREELOADER_PATCH_VERSION 19 +#define FREELOADER_PATCH_VERSION 20 #ifndef ASM diff --git a/freeldr/freeldr/reactos/reactos.c b/freeldr/freeldr/reactos/reactos.c index 1afe15d4176..5d71163923a 100644 --- a/freeldr/freeldr/reactos/reactos.c +++ b/freeldr/freeldr/reactos/reactos.c @@ -515,48 +515,63 @@ LoadAndBootReactOS(PUCHAR OperatingSystemName) } /* - * Verify system path + * Special case for Live CD. */ - if (!DissectArcPath(value, szBootPath, &BootDrive, &BootPartition)) + if (!stricmp(value, "LiveCD")) { - sprintf(MsgBuffer,"Invalid system path: '%s'", value); - UiMessageBox(MsgBuffer); - return; - } + strcpy(szBootPath, "\\reactos"); - /* set boot drive and partition */ + /* Set kernel command line */ + sprintf(multiboot_kernel_cmdline, + "multi(0)disk(0)cdrom(%u)\\reactos", + (unsigned int)BootDrive); + } + else + { + /* + * Verify system path + */ + if (!DissectArcPath(value, szBootPath, &BootDrive, &BootPartition)) + { + sprintf(MsgBuffer,"Invalid system path: '%s'", value); + UiMessageBox(MsgBuffer); + return; + } + + /* recalculate the boot partition for freeldr */ + i = 0; + rosPartition = 0; + while (1) + { + if (!DiskGetPartitionEntry(BootDrive, ++i, &PartitionTableEntry)) + { + BootPartition = 0; + break; + } + if (IsRecognizedPartition(PartitionTableEntry.SystemIndicator)) + { + if (++rosPartition == BootPartition) + { + BootPartition = i; + break; + } + } + } + if (BootPartition == 0) + { + sprintf(MsgBuffer,"Invalid system path: '%s'", value); + UiMessageBox(MsgBuffer); + return; + } + + /* copy ARC path into kernel command line */ + strcpy(multiboot_kernel_cmdline, value); + } + + /* Set boot drive and partition */ ((char *)(&mb_info.boot_device))[0] = (char)BootDrive; ((char *)(&mb_info.boot_device))[1] = (char)BootPartition; - /* recalculate the boot partition for freeldr */ - i = 0; - rosPartition = 0; - while (1) - { - if (!DiskGetPartitionEntry(BootDrive, ++i, &PartitionTableEntry)) - { - BootPartition = 0; - break; - } - if (IsRecognizedPartition(PartitionTableEntry.SystemIndicator)) - { - if (++rosPartition == BootPartition) - { - BootPartition = i; - break; - } - } - } - if (BootPartition == 0) - { - sprintf(MsgBuffer,"Invalid system path: '%s'", value); - UiMessageBox(MsgBuffer); - return; - } - - /* copy ARC path into kernel command line */ - strcpy(multiboot_kernel_cmdline, value); - /* * Read the optional kernel parameters (if any) */