Author: hbelusca
Date: Sun Jan 4 16:43:42 2015
New Revision: 65973
URL: http://svn.reactos.org/svn/reactos?rev=65973&view=rev
Log:
[FREELDR]: Small code style fixes; add a comment about the extra PXE check case in PcDiskGetBootPath. Fix also its return value.
Modified:
trunk/reactos/boot/freeldr/freeldr/arch/i386/pcdisk.c
trunk/reactos/boot/freeldr/freeldr/fs/fs.c
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/pcdisk.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/pcdisk.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/pcdisk.c [iso-8859-1] Sun Jan 4 16:43:42 2015
@@ -389,12 +389,19 @@
BOOLEAN
PcDiskGetBootPath(char *BootPath, unsigned Size)
{
- if (PxeInit())
- {
- strcpy(BootPath, "net(0)");
- return 0;
- }
- return DiskGetBootPath(BootPath, Size);
+ // FIXME: Keep it there, or put it in DiskGetBootPath?
+ // Or, abstract the notion of network booting to make
+ // sense for other platforms than the PC (and this idea
+ // already exists), then we would need to check whether
+ // we were booting from network (and: PC --> PXE, etc...)
+ // and if so, set the correct ARC path. But then this new
+ // logic could be moved back to DiskGetBootPath...
+ if (PxeInit())
+ {
+ strcpy(BootPath, "net(0)");
+ return TRUE;
+ }
+ return DiskGetBootPath(BootPath, Size);
}
/* EOF */
Modified: trunk/reactos/boot/freeldr/freeldr/fs/fs.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/fs/fs…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/fs/fs.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/fs/fs.c [iso-8859-1] Sun Jan 4 16:43:42 2015
@@ -102,10 +102,7 @@
//
// Check for success
//
- if (ret == ESUCCESS)
- return TRUE;
- else
- return FALSE;
+ return (ret == ESUCCESS);
}
ULONG FsGetFileSize(PFILE FileHandle)
@@ -156,10 +153,10 @@
*/
ULONG FsGetNumPathParts(PCSTR Path)
{
- size_t i;
- ULONG num;
-
- for (i=0,num=0; i<strlen(Path); i++)
+ size_t i;
+ ULONG num;
+
+ for (i = 0, num = 0; i < strlen(Path); i++)
{
if ((Path[i] == '\\') || (Path[i] == '/'))
{
@@ -181,12 +178,12 @@
*/
VOID FsGetFirstNameFromPath(PCHAR Buffer, PCSTR Path)
{
- size_t i;
+ size_t i;
// Copy all the characters up to the end of the
// string or until we hit a '\' character
// and put them in Buffer
- for (i=0; i<strlen(Path); i++)
+ for (i = 0; i < strlen(Path); i++)
{
if ((Path[i] == '\\') || (Path[i] == '/'))
{
@@ -276,8 +273,10 @@
/* Count number of "()", which needs to be replaced by "(0)" */
Count = 0;
for (p = Path; p != FileName; p++)
+ {
if (*p == '(' && *(p + 1) == ')')
Count++;
+ }
/* Duplicate device name, and replace "()" by "(0)" (if required) */
Length = FileName - Path + Count;
@@ -294,14 +293,17 @@
}
}
else
+ {
DeviceName = Path;
+ }
/* Search for the device */
- pEntry = DeviceListHead.Flink;
if (OpenMode == OpenReadOnly || OpenMode == OpenWriteOnly)
DeviceOpenMode = OpenMode;
else
DeviceOpenMode = OpenReadWrite;
+
+ pEntry = DeviceListHead.Flink;
while (pEntry != &DeviceListHead)
{
pDevice = CONTAINING_RECORD(pEntry, DEVICE, ListEntry);
@@ -312,10 +314,13 @@
{
/* Search some room for the device */
for (DeviceId = 0; DeviceId < MAX_FDS; DeviceId++)
+ {
if (!FileData[DeviceId].FuncTable)
break;
+ }
if (DeviceId == MAX_FDS)
return EMFILE;
+
/* Try to open the device */
FileData[DeviceId].FuncTable = pDevice->FuncTable;
ret = pDevice->FuncTable->Open(pDevice->Prefix, DeviceOpenMode, &DeviceId);
@@ -376,8 +381,10 @@
/* Search some room for the device */
for (i = 0; i < MAX_FDS; i++)
+ {
if (!FileData[i].FuncTable)
break;
+ }
if (i == MAX_FDS)
return EMFILE;
@@ -468,4 +475,8 @@
FileData[i].DeviceId = (ULONG)-1;
InitializeListHead(&DeviceListHead);
-}
+
+ // FIXME: Retrieve the current boot device with MachDiskGetBootPath
+ // and store it somewhere in order to not call again and again this
+ // function.
+}
Author: hbelusca
Date: Sat Jan 3 22:18:36 2015
New Revision: 65965
URL: http://svn.reactos.org/svn/reactos?rev=65965&view=rev
Log:
Tab2Space changes.
Modified:
trunk/reactos/boot/freeldr/FREELDR.INI
Modified: trunk/reactos/boot/freeldr/FREELDR.INI
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/FREELDR.INI?r…
==============================================================================
--- trunk/reactos/boot/freeldr/FREELDR.INI [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/FREELDR.INI [iso-8859-1] Sat Jan 3 22:18:36 2015
@@ -29,43 +29,43 @@
; [FREELOADER] Section Commands:
;
-; MessageBox - displays the specified text in a message box upon bootup
-; MessageLine - adds a new line of text to a message box (must come before MessageBox command)
-; TitleText - text that is displayed in the title box
-; StatusBarColor - color of status bar's background
-; StatusBarTextColor - color of status bar's text
-; BackdropTextColor - color of the backdrop's fill
-; BackdropColor - color of the backdrop's background
-; BackdropFillStyle - backdrop fill style - can be Light, Medium, or Dark
-; TitleBoxTextColor - title box text color
-; TitleBoxColor - title box background color
-; MessageBoxTextColor - message box text color
-; MessageBoxColor - message box background color
-; MenuTextColor - menu text color
-; MenuColor - menu color
-; TextColor - normal text color
-; SelectedTextColor - selected text color
-; SelectedColor - selected text background color
-; TimeOut - sets the timeout (in seconds) before the first OS listed gets booted automagically
+; MessageBox - displays the specified text in a message box upon bootup
+; MessageLine - adds a new line of text to a message box (must come before MessageBox command)
+; TitleText - text that is displayed in the title box
+; StatusBarColor - color of status bar's background
+; StatusBarTextColor - color of status bar's text
+; BackdropTextColor - color of the backdrop's fill
+; BackdropColor - color of the backdrop's background
+; BackdropFillStyle - backdrop fill style - can be Light, Medium, or Dark
+; TitleBoxTextColor - title box text color
+; TitleBoxColor - title box background color
+; MessageBoxTextColor - message box text color
+; MessageBoxColor - message box background color
+; MenuTextColor - menu text color
+; MenuColor - menu color
+; TextColor - normal text color
+; SelectedTextColor - selected text color
+; SelectedColor - selected text background color
+; TimeOut - sets the timeout (in seconds) before the first OS listed gets booted automagically
; [OS-General] Section Commands:
;
-; BootType - sets the boot type: ReactOS, Linux, BootSector, Partition, Drive
-; BootPath - ARC path e.g. multi(0)disk(0)rdisk(x)partition(y)
-; DriveMap - maps a BIOS drive number to another (i.e. DriveMap=hd1,hd0 maps harddisk1 to harddisk0 or DriveMap=fd1,fd0)
+; BootType - sets the boot type: ReactOS, Linux, BootSector, Partition, Drive
+; BootPath - ARC path e.g. multi(0)disk(0)rdisk(x)partition(y)
+; DriveMap - maps a BIOS drive number to another (i.e. DriveMap=hd1,hd0 maps harddisk1 to harddisk0 or DriveMap=fd1,fd0)
; [BootSector OSType] Section Commands:
;
-; BootSector - sets the filename of the bootsector to be loaded
+; BootSector - sets the filename of the bootsector to be loaded
; [ReactOS OSType] Section Commands:
;
-; SystemPath - sets the system root path (must be a valid ARC - Path):
-; multi(0)disk(0)rdisk(0)partition(1)\reactos
-; multi(0)disk(0)fdisk(0)
-; Options - sets the command line options for the kernel being booted
-; Kernel - sets the kernel filename (default: ntoskrnl.exe)
-; Hal - sets the HAL filename (default: hal.dll)
+; SystemPath - sets the system root path (must be a valid ARC - Path):
+; multi(0)disk(0)rdisk(0)partition(1)\reactos
+; multi(0)disk(0)fdisk(0)
+; Options - sets the command line options for the kernel being booted
+; Kernel - sets the kernel filename (default: ntoskrnl.exe)
+; Hal - sets the HAL filename (default: hal.dll)
[FREELOADER]