[ros-diffs] [hpoussin] 29353: Support "i386" as an alternative name for cdrom directory

hpoussin at svn.reactos.org hpoussin at svn.reactos.org
Tue Oct 2 14:23:41 CEST 2007


Author: hpoussin
Date: Tue Oct  2 16:23:40 2007
New Revision: 29353

URL: http://svn.reactos.org/svn/reactos?rev=29353&view=rev
Log:
Support "i386" as an alternative name for cdrom directory

Modified:
    trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c

Modified: trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c?rev=29353&r1=29352&r2=29353&view=diff
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c Tue Oct  2 16:23:40 2007
@@ -167,9 +167,20 @@
 VOID RunLoader(VOID)
 {
   ULONG_PTR Base;
-  ULONG Size;
+  ULONG Size, i;
   const char *SourcePath;
   const char *LoadOptions = "", *DbgLoadOptions = "";
+  const char *sourcePaths[] = {
+      "", /* Only for floppy boot */
+#if defined(_M_IX86)
+      "\\I386",
+#elif defined(_M_MPPC)
+      "\\PPC",
+#elif defined(_M_MRX000)
+      "\\MIPS",
+#endif
+      "\\reactos",
+      NULL };
   char szKernelName[256];
 
   HINF InfHandle;
@@ -246,13 +257,21 @@
     }
 
   /* Open 'txtsetup.sif' */
-  if (!InfOpenFile (&InfHandle,
-		    MachDiskBootingFromFloppy() ? "\\txtsetup.sif" : "\\reactos\\txtsetup.sif",
-		    &ErrorLine))
+  for (i = MachDiskBootingFromFloppy() ? 0 : 1; ; i++)
+  {
+    SourcePath = sourcePaths[i];
+    if (!SourcePath)
     {
       printf("Failed to open 'txtsetup.sif'\n");
       return;
     }
+    strcpy(szKernelName, SourcePath);
+    strcat(szKernelName, "\\txtsetup.sif");
+    if (InfOpenFile (&InfHandle, szKernelName, &ErrorLine))
+      break;
+  }
+  if (!*SourcePath)
+    SourcePath = "\\";
 
 #ifdef DBG
   /* Get load options */  
@@ -284,17 +303,6 @@
 #if 0
   printf("LoadOptions: '%s'\n", LoadOptions);
 #endif
-
-  if (MachDiskBootingFromFloppy())
-    {
-      /* Boot from floppy disk */
-      SourcePath = "\\";
-    }
-  else
-    {
-      /* Boot from cdrom */
-      SourcePath = "\\reactos";
-    }
 
   /* Set kernel command line */
   MachDiskGetBootPath(reactos_kernel_cmdline, sizeof(reactos_kernel_cmdline));




More information about the Ros-diffs mailing list