Author: ion
Date: Sun Oct 8 23:34:16 2006
New Revision: 24452
URL:
http://svn.reactos.org/svn/reactos?rev=24452&view=rev
Log:
- Have FreeLDR fill out ARC_DISK_SIGNATURE information for each detected disk, as it's
filling the registry.
- Add code to KiRosFrldrLpbToLpb to convert this array to the official
ARC_DISK_INFORMATION structure that contains LIST_ENTRYies for each ARC_DISK_SIGNATURE,
and initialize the ArcDiskSignatureListHead.
- The end result will be that in the next patch we can remove a bunch of registry-reading
code in IoCreateArcNames.
Modified:
trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c
trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c
trunk/reactos/ntoskrnl/ke/freeldr.c
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c Sun Oct 8 23:34:16 2006
@@ -120,6 +120,9 @@
static WCHAR Hex[] = L"0123456789ABCDEF";
static unsigned int delay_count = 1;
+extern ULONG reactos_disk_count;
+extern ARC_DISK_SIGNATURE reactos_arc_disk_info[];
+extern char reactos_arc_strings[32][256];
/* FUNCTIONS ****************************************************************/
@@ -512,6 +515,7 @@
ULONG Checksum;
ULONG Signature;
WCHAR Identifier[20];
+ CHAR ArcName[256];
LONG Error;
/* Read the MBR */
@@ -535,6 +539,15 @@
}
Checksum = ~Checksum + 1;
DbgPrint((DPRINT_HWDETECT, "Checksum: %x\n", Checksum));
+
+ /* Fill out the ARC disk block */
+ reactos_arc_disk_info[reactos_disk_count].Signature = Signature;
+ reactos_arc_disk_info[reactos_disk_count].CheckSum = Checksum;
+ sprintf(ArcName, "multi(0)disk(0)rdisk(%lu)", reactos_disk_count);
+ strcpy(reactos_arc_strings[reactos_disk_count], ArcName);
+ reactos_arc_disk_info[reactos_disk_count].ArcName =
+ reactos_arc_strings[reactos_disk_count];
+ reactos_disk_count++;
/* Convert checksum and signature to identifier string */
Identifier[0] = Hex[(Checksum >> 28) & 0x0F];
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c Sun Oct 8 23:34:16 2006
@@ -30,6 +30,9 @@
char reactos_module_strings[64][256]; // Array to hold module names
unsigned long reactos_memory_map_descriptor_size;
memory_map_t reactos_memory_map[32]; // Memory map
+ARC_DISK_SIGNATURE reactos_arc_disk_info[32]; // ARC Disk Information
+char reactos_arc_strings[32][256];
+unsigned long reactos_disk_count = 0;
static CHAR szLoadingMsg[] = "Loading ReactOS...";
@@ -605,6 +608,7 @@
LoaderBlock.CommandLine = (unsigned long)reactos_kernel_cmdline;
LoaderBlock.ModsCount = 0;
LoaderBlock.ModsAddr = (unsigned long)reactos_modules;
+ LoaderBlock.DrivesAddr = (unsigned long)reactos_arc_disk_info;
LoaderBlock.MmapLength = (unsigned
long)MachGetMemoryMap((PBIOS_MEMORY_MAP)(PVOID)&reactos_memory_map, 32) *
sizeof(memory_map_t);
if (LoaderBlock.MmapLength)
{
@@ -692,6 +696,7 @@
UiDrawProgressBarCenter(5, 100, szLoadingMsg);
if (AcpiPresent) LoaderBlock.Flags |= MB_FLAGS_ACPI_TABLE;
+ LoaderBlock.DrivesCount = reactos_disk_count;
UiDrawStatusText("Loading...");
Modified: trunk/reactos/ntoskrnl/ke/freeldr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/freeldr.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/freeldr.c (original)
+++ trunk/reactos/ntoskrnl/ke/freeldr.c Sun Oct 8 23:34:16 2006
@@ -18,6 +18,7 @@
LOADER_MODULE KeLoaderModules[64];
ULONG KeLoaderModuleCount;
static CHAR KeLoaderModuleStrings[64][256];
+static ARC_DISK_SIGNATURE KeArcDiskInfo[32];
/* FreeLDR Memory Data */
ADDRESS_RANGE KeMemoryMap[64];
@@ -48,6 +49,9 @@
WCHAR BldrModuleStrings[64][260];
NLS_DATA_BLOCK BldrNlsDataBlock;
SETUP_LOADER_BLOCK BldrSetupBlock;
+ARC_DISK_INFORMATION BldrArcDiskInfo;
+CHAR BldrArcNames[32][256];
+ARC_DISK_SIGNATURE BldrDiskInfo[32];
/* FUNCTIONS *****************************************************************/
@@ -65,6 +69,7 @@
PCHAR DriverName;
PCHAR BootPath, HalPath;
CHAR CommandLine[256];
+ PARC_DISK_SIGNATURE RosDiskInfo, ArcDiskInfo;
/* First get some kernel-loader globals */
AcpiTableDetected = (RosLoaderBlock->Flags & MB_FLAGS_ACPI_TABLE) ? TRUE :
FALSE;
@@ -79,6 +84,9 @@
/* Set the NLS Data block */
LoaderBlock->NlsData = &BldrNlsDataBlock;
+ /* Set the ARC Data block */
+ LoaderBlock->ArcDiskInformation = &BldrArcDiskInfo;
+
/* Assume this is from FreeLDR's SetupLdr */
LoaderBlock->SetupLdrBlock = &BldrSetupBlock;
@@ -86,6 +94,7 @@
InitializeListHead(&LoaderBlock->LoadOrderListHead);
InitializeListHead(&LoaderBlock->MemoryDescriptorListHead);
InitializeListHead(&LoaderBlock->BootDriverListHead);
+
InitializeListHead(&LoaderBlock->ArcDiskInformation->DiskSignatureListHead);
/* Loop boot driver list */
for (i = 0; i < KeLoaderModuleCount; i++)
@@ -285,6 +294,28 @@
/* Parse it and change every slash to a space */
BootPath = LoaderBlock->LoadOptions;
do {if (*BootPath == '/') *BootPath = ' ';} while (*BootPath++);
+
+ /* Now let's loop ARC disk information */
+ for (i = 0; i < RosLoaderBlock->DrivesCount; i++)
+ {
+ /* Get the ROS loader entry */
+ RosDiskInfo = &KeArcDiskInfo[i];
+
+ /* Get the ARC structure */
+ ArcDiskInfo = &BldrDiskInfo[i];
+
+ /* Copy the data over */
+ ArcDiskInfo->Signature = RosDiskInfo->Signature;
+ ArcDiskInfo->CheckSum = RosDiskInfo->CheckSum;
+
+ /* Copy the ARC Name */
+ strcpy(BldrArcNames[i], RosDiskInfo->ArcName);
+ ArcDiskInfo->ArcName = BldrArcNames[i];
+
+ /* Insert into the list */
+
InsertTailList(&LoaderBlock->ArcDiskInformation->DiskSignatureListHead,
+ &ArcDiskInfo->ListEntry);
+ }
}
VOID
@@ -322,6 +353,10 @@
(PVOID)KeRosLoaderBlock.ModsAddr,
sizeof(LOADER_MODULE) * KeRosLoaderBlock.ModsCount);
KeRosLoaderBlock.ModsAddr = (ULONG)&KeLoaderModules;
+ memcpy(&KeArcDiskInfo[0],
+ (PVOID)KeRosLoaderBlock.DrivesAddr,
+ sizeof(ARC_DISK_SIGNATURE) * KeRosLoaderBlock.DrivesCount);
+ KeRosLoaderBlock.DrivesAddr = (ULONG)&KeArcDiskInfo;
/* Check for BIOS memory map */
KeMemoryMapRangeCount = 0;