miscboot.c
options.c
oslist.c
- version.c
ui/directui.c
ui/gui.c
ui/minitui.c
return FALSE;
/* On ARM platforms, the loader is always in RAM */
- strcpy(FrldrBootPath, "ramdisk(0)");
+ strcpy(FrLdrBootPath, "ramdisk(0)");
return TRUE;
}
static BOOLEAN
DiskGetBootPath(BOOLEAN IsPxe)
{
- if (*FrldrBootPath)
+ if (*FrLdrBootPath)
return TRUE;
// FIXME! FIXME! Do this in some drive recognition procedure!!!!
if (IsPxe)
{
- RtlStringCbCopyA(FrldrBootPath, sizeof(FrldrBootPath), "net(0)");
+ RtlStringCbCopyA(FrLdrBootPath, sizeof(FrLdrBootPath), "net(0)");
}
else
/* 0x49 is our magic ramdisk drive, so try to detect it first */
if (FrldrBootDrive == 0x49)
{
/* This is the ramdisk. See ArmInitializeBootDevices() too... */
- // RtlStringCbPrintfA(FrldrBootPath, sizeof(FrldrBootPath), "ramdisk(%u)", 0);
- RtlStringCbCopyA(FrldrBootPath, sizeof(FrldrBootPath), "ramdisk(0)");
+ // RtlStringCbPrintfA(FrLdrBootPath, sizeof(FrLdrBootPath), "ramdisk(%u)", 0);
+ RtlStringCbCopyA(FrLdrBootPath, sizeof(FrLdrBootPath), "ramdisk(0)");
}
else if (FrldrBootDrive < 0x80)
{
/* This is a floppy */
- RtlStringCbPrintfA(FrldrBootPath, sizeof(FrldrBootPath),
+ RtlStringCbPrintfA(FrLdrBootPath, sizeof(FrLdrBootPath),
"multi(0)disk(0)fdisk(%u)", FrldrBootDrive);
}
else if (FrldrBootPartition == 0xFF)
{
/* Boot Partition 0xFF is the magic value that indicates booting from CD-ROM (see isoboot.S) */
- RtlStringCbPrintfA(FrldrBootPath, sizeof(FrldrBootPath),
+ RtlStringCbPrintfA(FrLdrBootPath, sizeof(FrLdrBootPath),
"multi(0)disk(0)cdrom(%u)", FrldrBootDrive - 0x80);
}
else
FrldrBootPartition = BootPartition;
- RtlStringCbPrintfA(FrldrBootPath, sizeof(FrldrBootPath),
+ RtlStringCbPrintfA(FrLdrBootPath, sizeof(FrLdrBootPath),
"multi(0)disk(0)rdisk(%u)partition(%lu)",
FrldrBootDrive - 0x80, FrldrBootPartition);
}
DiskCount = EnumerateHarddisks(&BootDriveReported);
- /* Initialize FrldrBootPath, the boot path we're booting from (the "SystemPartition") */
+ /* Initialize FrLdrBootPath, the boot path we're booting from (the "SystemPartition") */
DiskGetBootPath(PxeInit());
/* Add it, if it's a floppy or cdrom */
TRACE("Checksum: %x\n", Checksum);
/* Fill out the ARC disk block */
- AddReactOSArcDiskInfo(FrldrBootPath, Signature, Checksum, TRUE);
+ AddReactOSArcDiskInfo(FrLdrBootPath, Signature, Checksum, TRUE);
- FsRegisterDevice(FrldrBootPath, &DiskVtbl);
+ FsRegisterDevice(FrLdrBootPath, &DiskVtbl);
DiskCount++; // This is not accounted for in the number of pre-enumerated BIOS drives!
TRACE("Additional boot drive detected: 0x%02X\n", (int)FrldrBootDrive);
}
#include "compat.h"
extern void BootMain( PSTR CmdLine );
-extern const PCSTR GetFreeLoaderVersionString(VOID);
extern ULONG CacheSizeLimit;
of_proxy ofproxy;
void *PageDirectoryStart, *PageDirectoryEnd;
int mmu_handle = 0;
int claimed[4];
BOOLEAN AcpiPresent = FALSE;
-CHAR FrldrBootPath[MAX_PATH] = "", BootPart[MAX_PATH] = "", CmdLine[MAX_PATH] = "bootprep";
+CHAR FrLdrBootPath[MAX_PATH] = "", BootPart[MAX_PATH] = "", CmdLine[MAX_PATH] = "bootprep";
jmp_buf jmp;
volatile char *video_mem = 0;
return;
}
- printf( "FreeLDR version [%s]\n", GetFreeLoaderVersionString() );
+ printf( "FreeLDR version [%s]\n", FrLdrVersionString );
BootMain( CmdLine );
}
char *sep;
BootPart[0] = 0;
- FrldrBootPath[0] = 0;
+ FrLdrBootPath[0] = 0;
printf( "Determining boot device: [%s]\n", CmdLine );
if( strlen(BootPart) == 0 ) {
if (ofproxy)
len = ofw_getprop(chosen_package, "bootpath",
- FrldrBootPath, sizeof(FrldrBootPath));
+ FrLdrBootPath, sizeof(FrLdrBootPath));
else
len = 0;
if( len < 0 ) len = 0;
- FrldrBootPath[len] = 0;
- printf( "Boot Path: %s\n", FrldrBootPath );
+ FrLdrBootPath[len] = 0;
+ printf( "Boot Path: %s\n", FrLdrBootPath );
- sep = strrchr(FrldrBootPath, ',');
+ sep = strrchr(FrLdrBootPath, ',');
- strcpy(BootPart, FrldrBootPath);
+ strcpy(BootPart, FrLdrBootPath);
if( sep ) {
- BootPart[sep - FrldrBootPath] = 0;
+ BootPart[sep - FrLdrBootPath] = 0;
}
}
MachVtbl.HwDetect = PpcPrepHwDetect;
MachVtbl.HwIdle = PcPrepHwIdle;
- printf( "FreeLDR version [%s]\n", GetFreeLoaderVersionString() );
+ printf( "FreeLDR version [%s]\n", FrLdrVersionString );
BootMain( "" );
}
/* Get the path (optional) */
if (Path)
- {
- p = ArcPath + 11;
- *Path = p;
- }
+ *Path = ArcPath + 10;
+
return TRUE;
}
Size = 0;
/* i == 0: Program name */
/* i == 1: SystemPartition : from where FreeLdr has been started */
- Size += (strlen("SystemPartition=") + strlen(FrldrBootPath) + 1) * sizeof(CHAR);
+ Size += (strlen("SystemPartition=") + strlen(FrLdrBootPath) + 1) * sizeof(CHAR);
/* i == 2: LoadIdentifier : ASCII string that may be used to associate an identifier with a set of load parameters */
if (LoadIdentifier)
{
/* i == 1: SystemPartition */
{
strcpy(SettingName, "SystemPartition=");
- strcat(SettingName, FrldrBootPath);
+ strcat(SettingName, FrLdrBootPath);
*Args++ = SettingName;
SettingName += (strlen(SettingName) + 1);
DriveMapMapDrivesInSection(SectionId);
#endif
- /* Loop through the OS loading method table and find a suitable OS to boot */
- for (i = 0; i < sizeof(OSLoadingMethods) / sizeof(OSLoadingMethods[0]); ++i)
+ /* Find the suitable OS loader to start */
+ for (i = 0; ; ++i)
{
- if (_stricmp(BootType, OSLoadingMethods[i].BootType) == 0)
- {
- Argv = BuildArgvForOsLoader(OperatingSystem->LoadIdentifier, SectionId, &Argc);
- if (Argv)
- {
- OSLoadingMethods[i].OsLoader(Argc, Argv, NULL);
- FrLdrHeapFree(Argv, TAG_STRING);
- }
+ if (i >= RTL_NUMBER_OF(OSLoadingMethods))
return;
- }
+ if (_stricmp(BootType, OSLoadingMethods[i].BootType) == 0)
+ break;
}
+
+ /* Build the ARC-compatible argument vector */
+ Argv = BuildArgvForOsLoader(OperatingSystem->LoadIdentifier, SectionId, &Argc);
+ if (!Argv)
+ return; // Unexpected failure.
+
+ /* Start the OS loader */
+ OSLoadingMethods[i].OsLoader(Argc, Argv, NULL);
+ FrLdrHeapFree(Argv, TAG_STRING);
}
#ifdef HAS_OPTION_MENU_EDIT_CMDLINE
/* We must have the "BootType" value (it has been possibly added by InitOperatingSystemList()) */
ASSERT(*BootType);
- /* Loop through the OS loading method table and find a suitable OS entry editor */
- for (i = 0; i < sizeof(OSLoadingMethods) / sizeof(OSLoadingMethods[0]); ++i)
+ /* Find the suitable OS entry editor */
+ for (i = 0; ; ++i)
{
- if (_stricmp(BootType, OSLoadingMethods[i].BootType) == 0)
- {
- OSLoadingMethods[i].EditOsEntry(OperatingSystem);
+ if (i >= RTL_NUMBER_OF(OSLoadingMethods))
return;
- }
+ if (_stricmp(BootType, OSLoadingMethods[i].BootType) == 0)
+ break;
}
+
+ /* Run it */
+ OSLoadingMethods[i].EditOsEntry(OperatingSystem);
}
#endif // HAS_OPTION_MENU_EDIT_CMDLINE
if (!UiDisplayMenu("Please choose a boot method:", NULL,
FALSE,
CustomBootMenuList,
- sizeof(CustomBootMenuList) / sizeof(CustomBootMenuList[0]),
+ RTL_NUMBER_OF(CustomBootMenuList),
0, -1,
&SelectedMenuItem,
TRUE,
TIMEINFO* TimeInfo;
ULONG_PTR SectionId = OperatingSystem->SectionId;
CHAR SectionName[100];
- /* The following is a trick for saving some stack space */
+ /* This construct is a trick for saving some stack space */
union
{
struct
TIMEINFO* TimeInfo;
ULONG_PTR SectionId = OperatingSystem->SectionId;
CHAR SectionName[100];
- /* The following is a trick for saving some stack space */
+ /* This construct is a trick for saving some stack space */
union
{
struct
TIMEINFO* TimeInfo;
ULONG_PTR SectionId = OperatingSystem->SectionId;
CHAR SectionName[100];
- /* The following is a trick for saving some stack space */
+ /* This construct is a trick for saving some stack space */
union
{
struct
TIMEINFO* TimeInfo;
ULONG_PTR SectionId = OperatingSystem->SectionId;
CHAR SectionName[100];
- /* The following is a trick for saving some stack space */
+ /* This construct is a trick for saving some stack space */
union
{
struct
InitializeListHead(&ModuleListHead);
/* Create full ntbootdd.sys path */
- strcpy(NtBootDdPath, FrldrBootPath);
+ strcpy(NtBootDdPath, FrLdrBootPath);
strcat(NtBootDdPath, "\\NTBOOTDD.SYS");
/* Load file */
/* GLOBALS ********************************************************************/
-CCHAR FrldrBootPath[MAX_PATH] = "";
+#define TOSTRING_(X) #X
+#define TOSTRING(X) TOSTRING_(X)
+
+const PCSTR FrLdrVersionString =
+#if (FREELOADER_PATCH_VERSION == 0)
+ "FreeLoader v" TOSTRING(FREELOADER_MAJOR_VERSION) "." TOSTRING(FREELOADER_MINOR_VERSION);
+#else
+ "FreeLoader v" TOSTRING(FREELOADER_MAJOR_VERSION) "." TOSTRING(FREELOADER_MINOR_VERSION) "." TOSTRING(FREELOADER_PATCH_VERSION);
+#endif
+
+CCHAR FrLdrBootPath[MAX_PATH] = "";
/* FUNCTIONS ******************************************************************/
/* ARC path of the boot drive and partition */
-extern CCHAR FrldrBootPath[MAX_PATH];
+extern CCHAR FrLdrBootPath[MAX_PATH];
///////////////////////////////////////////////////////////////////////////////////////
#define FREELOADER_MINOR_VERSION 0
#define FREELOADER_PATCH_VERSION 0
-const PCSTR GetFreeLoaderVersionString(VOID);
+extern const PCSTR FrLdrVersionString;
TRACE("IniFileInitialize()\n");
/* Try to open freeldr.ini */
- Status = FsOpenFile("freeldr.ini", FrldrBootPath, OpenReadOnly, &FileId);
+ Status = FsOpenFile("freeldr.ini", FrLdrBootPath, OpenReadOnly, &FileId);
if (Status != ESUCCESS)
{
ERR("Error while opening freeldr.ini, Status: %d\n", Status);
//
TuiDrawText(2,
1,
- GetFreeLoaderVersionString(),
+ FrLdrVersionString,
ATTR(UiTitleBoxFgColor, UiTitleBoxBgColor));
//
+++ /dev/null
-/*
- * FreeLoader
- * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <freeldr.h>
-
-#define TOSTRING_(X) #X
-#define TOSTRING(X) TOSTRING_(X)
-
-static const PCSTR FreeLoaderVersionString =
-#if (FREELOADER_PATCH_VERSION == 0)
- "FreeLoader v" TOSTRING(FREELOADER_MAJOR_VERSION) "." TOSTRING(FREELOADER_MINOR_VERSION);
-#else
- "FreeLoader v" TOSTRING(FREELOADER_MAJOR_VERSION) "." TOSTRING(FREELOADER_MINOR_VERSION) "." TOSTRING(FREELOADER_PATCH_VERSION);
-#endif
-
-const PCSTR GetFreeLoaderVersionString(VOID)
-{
- return FreeLoaderVersionString;
-}