Remove support for machine specific versions of DiskGetBootVolume and DiskGetSystemVolume
authorHervé Poussineau <hpoussin@reactos.org>
Sun, 6 Sep 2009 15:59:16 +0000 (15:59 +0000)
committerHervé Poussineau <hpoussin@reactos.org>
Sun, 6 Sep 2009 15:59:16 +0000 (15:59 +0000)
svn path=/trunk/; revision=43003

reactos/boot/freeldr/freeldr/arch/arm/macharm.c
reactos/boot/freeldr/freeldr/arch/i386/machpc.c
reactos/boot/freeldr/freeldr/arch/i386/machxbox.c
reactos/boot/freeldr/freeldr/arch/powerpc/mach.c
reactos/boot/freeldr/freeldr/include/machine.h
reactos/boot/freeldr/freeldr/linuxboot.c
reactos/boot/freeldr/freeldr/machine.c
reactos/boot/freeldr/freeldr/miscboot.c
reactos/boot/freeldr/freeldr/reactos/reactos.c

index 0aad13b..1bff123 100644 (file)
@@ -201,8 +201,6 @@ MachInit(IN PCCH CommandLine)
     //
     // Now set default disk handling routines -- we don't need to override
     //
-    MachVtbl.DiskGetBootVolume = DiskGetBootVolume;
-    MachVtbl.DiskGetSystemVolume = DiskGetSystemVolume;
     MachVtbl.DiskGetBootPath = DiskGetBootPath;
     MachVtbl.DiskGetBootDevice = DiskGetBootDevice;
     MachVtbl.DiskBootingFromFloppy = DiskBootingFromFloppy;
index c9b3467..628c281 100644 (file)
@@ -44,8 +44,6 @@ PcMachInit(const char *CmdLine)
     MachVtbl.Beep = PcBeep;
     MachVtbl.PrepareForReactOS = PcPrepareForReactOS;
     MachVtbl.GetMemoryMap = PcMemGetMemoryMap;
-    MachVtbl.DiskGetBootVolume = DiskGetBootVolume;
-    MachVtbl.DiskGetSystemVolume = DiskGetSystemVolume;
     MachVtbl.DiskGetBootPath = DiskGetBootPath;
     MachVtbl.DiskGetBootDevice = DiskGetBootDevice;
     MachVtbl.DiskBootingFromFloppy = DiskBootingFromFloppy;
index 612404a..c03dc42 100644 (file)
@@ -47,8 +47,6 @@ XboxMachInit(const char *CmdLine)
   MachVtbl.Beep = PcBeep;
   MachVtbl.PrepareForReactOS = XboxPrepareForReactOS;
   MachVtbl.GetMemoryMap = XboxMemGetMemoryMap;
-  MachVtbl.DiskGetBootVolume = DiskGetBootVolume;
-  MachVtbl.DiskGetSystemVolume = DiskGetSystemVolume;
   MachVtbl.DiskGetBootPath = DiskGetBootPath;
   MachVtbl.DiskGetBootDevice = DiskGetBootDevice;
   MachVtbl.DiskBootingFromFloppy = DiskBootingFromFloppy;
index e6840f0..7a3355e 100644 (file)
@@ -247,36 +247,6 @@ ULONG PpcGetMemoryMap( PBIOS_MEMORY_MAP BiosMemoryMap,
     return slots;
 }
 
-/* Strategy:
- *
- * For now, it'll be easy enough to use the boot command line as our boot path.
- * Treat it as the path of a disk partition.  We might even be able to get
- * away with grabbing a partition image by tftp in this scenario.
- */
-
-BOOLEAN PpcDiskGetBootVolume( PULONG DriveNumber, PULONGLONG StartSector, PULONGLONG SectorCount, int *FsType ) {
-    *DriveNumber = 0;
-    *StartSector = 0;
-    *SectorCount = 0;
-    *FsType = FS_FAT;
-    return TRUE;
-}
-
-BOOLEAN PpcDiskGetSystemVolume( char *SystemPath,
-                             char *RemainingPath,
-                             PULONG Device ) {
-    char *remain = strchr(SystemPath, '\\');
-    if( remain ) {
-       strcpy( RemainingPath, remain+1 );
-    } else {
-       RemainingPath[0] = 0;
-    }
-    *Device = 0;
-    // Hack to be a bit easier on ram
-    CacheSizeLimit = 64 * 1024;
-    return TRUE;
-}
-
 BOOLEAN PpcDiskGetBootPath( char *OutBootPath, unsigned Size ) {
     strncpy( OutBootPath, BootPath, Size );
     return TRUE;
@@ -523,8 +493,6 @@ void PpcDefaultMachVtbl()
     MachVtbl.GetMemoryMap = PpcGetMemoryMap;
 
     MachVtbl.DiskNormalizeSystemPath = PpcDiskNormalizeSystemPath;
-    MachVtbl.DiskGetBootVolume = PpcDiskGetBootVolume;
-    MachVtbl.DiskGetSystemVolume = PpcDiskGetSystemVolume;
     MachVtbl.DiskGetBootPath = PpcDiskGetBootPath;
     MachVtbl.DiskGetBootDevice = PpcDiskGetBootDevice;
     MachVtbl.DiskBootingFromFloppy = PpcDiskBootingFromFloppy;
@@ -566,6 +534,8 @@ void PpcOfwInit()
 }
 
 void PpcInit( of_proxy the_ofproxy ) {
+    // Hack to be a bit easier on ram
+    CacheSizeLimit = 64 * 1024;
     ofproxy = the_ofproxy;
     PpcDefaultMachVtbl();
     if(ofproxy) PpcOfwInit();
index f185aff..47979c5 100644 (file)
@@ -62,8 +62,6 @@ typedef struct tagMACHVTBL
   MEMORY_DESCRIPTOR* (*GetMemoryDescriptor)(MEMORY_DESCRIPTOR* Current);
   ULONG (*GetMemoryMap)(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MaxMemoryMapSize);
 
-  BOOLEAN (*DiskGetBootVolume)(PULONG DriveNumber, PULONGLONG StartSector, PULONGLONG SectorCount, int *FsType);
-  BOOLEAN (*DiskGetSystemVolume)(char *SystemPath, char *RemainingPath, PULONG Device);
   BOOLEAN (*DiskGetBootPath)(char *BootPath, unsigned Size);
   VOID (*DiskGetBootDevice)(PULONG BootDevice);
   BOOLEAN (*DiskBootingFromFloppy)(VOID);
@@ -100,11 +98,6 @@ VOID MachVideoGetPaletteColor(UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue
 VOID MachVideoSync(VOID);
 VOID MachBeep(VOID);
 MEMORY_DESCRIPTOR* ArcGetMemoryDescriptor(MEMORY_DESCRIPTOR* Current);
-BOOLEAN MachDiskGetBootVolume(PULONG DriveNumber, PULONGLONG StartSector, PULONGLONG SectorCount, int *FsType);
-BOOLEAN
-MachDiskGetSystemVolume(char *SystemPath,
-                        char *RemainingPath,
-                        PULONG Device);
 BOOLEAN MachDiskGetBootPath(char *BootPath, unsigned Size);
 VOID MachDiskGetBootDevice(PULONG BootDevice);
 BOOLEAN MachDiskBootingFromFloppy();
@@ -135,8 +128,6 @@ VOID MachPrepareForReactOS(IN BOOLEAN Setup);
 #define MachVideoSync()                                MachVtbl.VideoSync()
 #define MachBeep()                   MachVtbl.Beep()
 #define MachPrepareForReactOS(a)               MachVtbl.PrepareForReactOS(a)
-#define MachDiskGetBootVolume(Drv, Start, Cnt, FsType) MachVtbl.DiskGetBootVolume((Drv), (Start), (Cnt), (FsType))
-#define MachDiskGetSystemVolume(SysPath, RemPath, Dev) MachVtbl.DiskGetSystemVolume((SysPath), (RemPath), (Dev))
 #define MachDiskGetBootPath(Path, Size)                MachVtbl.DiskGetBootPath((Path), (Size))
 #define MachDiskGetBootDevice(BootDevice)      MachVtbl.DiskGetBootDevice(BootDevice)
 #define MachDiskBootingFromFloppy()            MachVtbl.DiskBootingFromFloppy()
index eef427e..904ea52 100644 (file)
@@ -73,11 +73,6 @@ VOID LoadAndBootLinux(PCSTR OperatingSystemName, PCSTR Description)
                UiMessageBox("Invalid boot path");
                goto LinuxBootFailed;
        }
-       if (!MachDiskGetSystemVolume(LinuxBootPath, NULL, NULL))
-       {
-               UiMessageBox("Failed to get system volume.");
-               goto LinuxBootFailed;
-       }
 
        // Open the kernel
        LinuxKernel = FsOpenFile(LinuxKernelName);
index 0c39721..79c8c74 100644 (file)
@@ -36,8 +36,6 @@
 #undef MachVideoSync
 #undef MachBeep
 #undef MachPrepareForReactOS
-#undef MachDiskGetBootVolume
-#undef MachDiskGetSystemVolume
 #undef MachDiskGetBootPath
 #undef MachDiskGetBootDevice
 #undef MachDiskBootingFromFloppy
@@ -324,20 +322,6 @@ ArcGetMemoryDescriptor(MEMORY_DESCRIPTOR* Current)
     }
 }
 
-BOOLEAN
-MachDiskGetBootVolume(PULONG DriveNumber, PULONGLONG StartSector, PULONGLONG SectorCount, int *FsType)
-{
-  return MachVtbl.DiskGetBootVolume(DriveNumber, StartSector, SectorCount, FsType);
-}
-
-BOOLEAN
-MachDiskGetSystemVolume(char *SystemPath,
-                        char *RemainingPath,
-                        PULONG Device)
-{
-  return MachVtbl.DiskGetSystemVolume(SystemPath, RemainingPath, Device);
-}
-
 BOOLEAN
 MachDiskGetBootPath(char *BootPath, unsigned Size)
 {
index ad52593..8452efd 100644 (file)
@@ -51,12 +51,6 @@ VOID LoadAndBootBootSector(PCSTR OperatingSystemName)
                return;
        }
 
-       if (!MachDiskGetSystemVolume(FileName, FileName, NULL))
-       {
-               UiMessageBox("Failed to get system volume.");
-               return;
-       }
-
        FilePointer = FsOpenFile(FileName);
        if (!FilePointer)
        {
index ec27cac..80b26c9 100644 (file)
@@ -758,7 +758,7 @@ LoadAndBootReactOS(PCSTR OperatingSystemName)
     /*
      * Try to get system volume
      */
-    if (!MachDiskGetSystemVolume(SystemPath, szBootPath, &LoaderBlock.BootDevice))
+    if (!DiskGetSystemVolume(SystemPath, szBootPath, &LoaderBlock.BootDevice))
     {
         UiMessageBox("Failed to get system volume.");
         return;