From f501c2bcb59e9d1dbf378aeafa949ec86532dab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Sat, 3 Oct 2009 17:00:29 +0000 Subject: [PATCH] [freeldr] Remove (Mach)DiskGetBootDevice, DiskGetBootVolume, DiskGetSystemVolume, FsRecognizeVolume This commit breaks ext2 driver in freeldr, which needs to use ArcSeek/ArcRead/Arc* instead of DiskGetBootVolume/MachDiskReadLogicalSectors svn path=/trunk/; revision=43268 --- .../boot/freeldr/freeldr/arch/arm/macharm.c | 1 - .../boot/freeldr/freeldr/arch/i386/machpc.c | 1 - .../boot/freeldr/freeldr/arch/i386/machxbox.c | 1 - .../boot/freeldr/freeldr/arch/powerpc/mach.c | 5 - reactos/boot/freeldr/freeldr/disk/disk.c | 225 ------------------ .../boot/freeldr/freeldr/freeldr_base.rbuild | 1 - reactos/boot/freeldr/freeldr/fs/ext2.c | 9 + reactos/boot/freeldr/freeldr/fs/fsrec.c | 131 ---------- reactos/boot/freeldr/freeldr/include/disk.h | 5 - .../boot/freeldr/freeldr/include/freeldr.h | 1 - reactos/boot/freeldr/freeldr/include/fsrec.h | 29 --- .../boot/freeldr/freeldr/include/machine.h | 3 - reactos/boot/freeldr/freeldr/machine.c | 7 - .../boot/freeldr/freeldr/reactos/reactos.c | 13 +- 14 files changed, 14 insertions(+), 418 deletions(-) delete mode 100644 reactos/boot/freeldr/freeldr/fs/fsrec.c delete mode 100644 reactos/boot/freeldr/freeldr/include/fsrec.h diff --git a/reactos/boot/freeldr/freeldr/arch/arm/macharm.c b/reactos/boot/freeldr/freeldr/arch/arm/macharm.c index 0cb489fa713..52eaadfcc73 100644 --- a/reactos/boot/freeldr/freeldr/arch/arm/macharm.c +++ b/reactos/boot/freeldr/freeldr/arch/arm/macharm.c @@ -202,7 +202,6 @@ MachInit(IN PCCH CommandLine) // Now set default disk handling routines -- we don't need to override // MachVtbl.DiskGetBootPath = DiskGetBootPath; - MachVtbl.DiskGetBootDevice = DiskGetBootDevice; MachVtbl.DiskNormalizeSystemPath = DiskNormalizeSystemPath; MachVtbl.DiskGetPartitionEntry = DiskGetPartitionEntry; diff --git a/reactos/boot/freeldr/freeldr/arch/i386/machpc.c b/reactos/boot/freeldr/freeldr/arch/i386/machpc.c index 816dad483bd..ee1a9a67be9 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/machpc.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/machpc.c @@ -45,7 +45,6 @@ PcMachInit(const char *CmdLine) MachVtbl.PrepareForReactOS = PcPrepareForReactOS; MachVtbl.GetMemoryMap = PcMemGetMemoryMap; MachVtbl.DiskGetBootPath = DiskGetBootPath; - MachVtbl.DiskGetBootDevice = DiskGetBootDevice; MachVtbl.DiskNormalizeSystemPath = DiskNormalizeSystemPath; MachVtbl.DiskReadLogicalSectors = PcDiskReadLogicalSectors; MachVtbl.DiskGetPartitionEntry = DiskGetPartitionEntry; diff --git a/reactos/boot/freeldr/freeldr/arch/i386/machxbox.c b/reactos/boot/freeldr/freeldr/arch/i386/machxbox.c index 389ff069441..4502eed5609 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/machxbox.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/machxbox.c @@ -48,7 +48,6 @@ XboxMachInit(const char *CmdLine) MachVtbl.PrepareForReactOS = XboxPrepareForReactOS; MachVtbl.GetMemoryMap = XboxMemGetMemoryMap; MachVtbl.DiskGetBootPath = DiskGetBootPath; - MachVtbl.DiskGetBootDevice = DiskGetBootDevice; MachVtbl.DiskNormalizeSystemPath = DiskNormalizeSystemPath; MachVtbl.DiskReadLogicalSectors = XboxDiskReadLogicalSectors; MachVtbl.DiskGetPartitionEntry = XboxDiskGetPartitionEntry; diff --git a/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c b/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c index 11d3050f006..f80d209f21c 100644 --- a/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c +++ b/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c @@ -252,10 +252,6 @@ BOOLEAN PpcDiskGetBootPath( char *OutBootPath, unsigned Size ) { return TRUE; } -VOID PpcDiskGetBootDevice( PULONG BootDevice ) { - BootDevice[0] = BootDevice[1] = 0; -} - BOOLEAN PpcDiskReadLogicalSectors( ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer ) { int rlen = 0; @@ -490,7 +486,6 @@ void PpcDefaultMachVtbl() MachVtbl.DiskNormalizeSystemPath = PpcDiskNormalizeSystemPath; MachVtbl.DiskGetBootPath = PpcDiskGetBootPath; - MachVtbl.DiskGetBootDevice = PpcDiskGetBootDevice; MachVtbl.DiskReadLogicalSectors = PpcDiskReadLogicalSectors; MachVtbl.DiskGetPartitionEntry = PpcDiskGetPartitionEntry; MachVtbl.DiskGetDriveGeometry = PpcDiskGetDriveGeometry; diff --git a/reactos/boot/freeldr/freeldr/disk/disk.c b/reactos/boot/freeldr/freeldr/disk/disk.c index b98b2110be1..4e8ca07ea9c 100644 --- a/reactos/boot/freeldr/freeldr/disk/disk.c +++ b/reactos/boot/freeldr/freeldr/disk/disk.c @@ -101,231 +101,6 @@ BOOLEAN DiskIsDriveRemovable(ULONG DriveNumber) return TRUE; } -BOOLEAN DiskGetBootVolume(PULONG DriveNumber, PULONGLONG StartSector, PULONGLONG SectorCount, int *FsType) -{ - PARTITION_TABLE_ENTRY PartitionTableEntry; - UCHAR VolumeType; - ULONG ActivePartition; - - DPRINTM(DPRINT_FILESYSTEM, "FsOpenVolume() DriveNumber: 0x%x PartitionNumber: 0x%x\n", BootDrive, BootPartition); - - // Check and see if it is a floppy drive - // If so then just assume FAT12 file system type - if (DiskIsDriveRemovable(BootDrive)) - { - DPRINTM(DPRINT_FILESYSTEM, "Drive is a floppy diskette drive. Assuming FAT12 file system.\n"); - - *DriveNumber = BootDrive; - *StartSector = 0; - *SectorCount = 2 * 80 * 18; /* FIXME hardcoded for 1.44 Mb */ - *FsType = FS_FAT; - return TRUE; - } - - // Check for ISO9660 file system type - if (BootDrive >= 0x80 && FsRecIsIso9660(BootDrive)) - { - DPRINTM(DPRINT_FILESYSTEM, "Drive is a cdrom drive. Assuming ISO-9660 file system.\n"); - - *DriveNumber = BootDrive; - *StartSector = 0; - *SectorCount = 0; - *FsType = FS_ISO9660; - return TRUE; - } - - // Get the requested partition entry - if (BootPartition == 0) - { - // Partition requested was zero which means the boot partition - if (! DiskGetActivePartitionEntry(BootDrive, &PartitionTableEntry, &ActivePartition)) - { - /* Try partition-less disk */ - *StartSector = 0; - *SectorCount = 0; - } - /* Check for valid partition */ - else if (PartitionTableEntry.SystemIndicator == PARTITION_ENTRY_UNUSED) - { - return FALSE; - } - else - { - *StartSector = PartitionTableEntry.SectorCountBeforePartition; - *SectorCount = PartitionTableEntry.PartitionSectorCount; - } - } - else if (0xff == BootPartition) - { - /* Partition-less disk */ - *StartSector = 0; - *SectorCount = 0; - } - else - { - // Get requested partition - if (! MachDiskGetPartitionEntry(BootDrive, BootPartition, &PartitionTableEntry)) - { - return FALSE; - } - /* Check for valid partition */ - else if (PartitionTableEntry.SystemIndicator == PARTITION_ENTRY_UNUSED) - { - return FALSE; - } - else - { - *StartSector = PartitionTableEntry.SectorCountBeforePartition; - *SectorCount = PartitionTableEntry.PartitionSectorCount; - } - } - - // Try to recognize the file system - if (!FsRecognizeVolume(BootDrive, *StartSector, &VolumeType)) - { - return FALSE; - } - - *DriveNumber = BootDrive; - - switch (VolumeType) - { - case PARTITION_FAT_12: - case PARTITION_FAT_16: - case PARTITION_HUGE: - case PARTITION_XINT13: - case PARTITION_FAT32: - case PARTITION_FAT32_XINT13: - *FsType = FS_FAT; - return TRUE; - case PARTITION_EXT2: - *FsType = FS_EXT2; - return TRUE; - case PARTITION_NTFS: - *FsType = FS_NTFS; - return TRUE; - default: - *FsType = 0; - return FALSE; - } - - return TRUE; -} - -VOID -DiskGetBootDevice(PULONG BootDevice) -{ - ((char *)BootDevice)[0] = (char)BootDrive; - ((char *)BootDevice)[1] = (char)BootPartition; -} - -#define IsRecognizedPartition(P) \ - ((P) == PARTITION_FAT_12 || \ - (P) == PARTITION_FAT_16 || \ - (P) == PARTITION_HUGE || \ - (P) == PARTITION_IFS || \ - (P) == PARTITION_EXT2 || \ - (P) == PARTITION_FAT32 || \ - (P) == PARTITION_FAT32_XINT13 || \ - (P) == PARTITION_XINT13) - -#define IsContainerPartition(P) \ - ((P) == PARTITION_EXTENDED || \ - (P) == PARTITION_XINT13_EXTENDED) - -BOOLEAN DiskGetSystemVolume(char *SystemPath, - char *RemainingPath, - PULONG Device) -{ - ULONG PartitionNumber; - PARTITION_TABLE_ENTRY PartitionTableEntry; - UCHAR VolumeType; - CHAR BootPath[256]; - unsigned i, RosPartition; - ULONG DriveNumber; - - /* - * Verify system path - */ - if (!DissectArcPath(SystemPath, BootPath, &DriveNumber, &PartitionNumber)) - { - return FALSE; - } - if (NULL != RemainingPath) - { - strcpy(RemainingPath, BootPath); - } - - /* 0xff -> no partition table present, use whole device */ - if (0xff == PartitionNumber) - { - PartitionTableEntry.SectorCountBeforePartition = 0; - i = 0xff; - } - else - { - /* recalculate the boot partition for freeldr */ - i = 0; - RosPartition = 0; - while (1) - { - if (!MachDiskGetPartitionEntry(DriveNumber, ++i, &PartitionTableEntry)) - { - return FALSE; - } - if (!IsContainerPartition(PartitionTableEntry.SystemIndicator) && - PartitionTableEntry.SystemIndicator != PARTITION_ENTRY_UNUSED) - { - if (++RosPartition == PartitionNumber) - { - break; - } - } - } - } - - /* Check for ISO9660 file system type */ - if (DriveNumber >= 0x80 && FsRecIsIso9660(DriveNumber)) - { - DPRINTM(DPRINT_FILESYSTEM, "Drive is a cdrom drive. Assuming ISO-9660 file system.\n"); - - if (NULL != Device) - { - ((char *)Device)[0] = (char)DriveNumber; - ((char *)Device)[1] = (char)i; - } - return TRUE; - } - - if (!FsRecognizeVolume(DriveNumber, PartitionTableEntry.SectorCountBeforePartition, &VolumeType)) - { - return FALSE; - } - - if (NULL != Device) - { - ((char *)Device)[0] = (char)DriveNumber; - ((char *)Device)[1] = (char)i; - } - - switch (VolumeType) - { - case PARTITION_FAT_12: - case PARTITION_FAT_16: - case PARTITION_HUGE: - case PARTITION_XINT13: - case PARTITION_FAT32: - case PARTITION_FAT32_XINT13: - case PARTITION_EXT2: - case PARTITION_NTFS: - return TRUE; - default: - return FALSE; - } - - return FALSE; -} - BOOLEAN DiskGetBootPath(char *BootPath, unsigned Size) { diff --git a/reactos/boot/freeldr/freeldr/freeldr_base.rbuild b/reactos/boot/freeldr/freeldr/freeldr_base.rbuild index 81b35b93bf9..c13ad4436ad 100644 --- a/reactos/boot/freeldr/freeldr/freeldr_base.rbuild +++ b/reactos/boot/freeldr/freeldr/freeldr_base.rbuild @@ -31,7 +31,6 @@ ext2.c fat.c fs.c - fsrec.c iso.c ntfs.c diff --git a/reactos/boot/freeldr/freeldr/fs/ext2.c b/reactos/boot/freeldr/freeldr/fs/ext2.c index 77e56c007f9..03791eaeabb 100644 --- a/reactos/boot/freeldr/freeldr/fs/ext2.c +++ b/reactos/boot/freeldr/freeldr/fs/ext2.c @@ -60,6 +60,15 @@ ULONG Ext2GroupCount = 0; // Number of groups in this file system ULONG Ext2InodesPerBlock = 0; // Number of inodes in one block ULONG Ext2GroupDescPerBlock = 0; // Number of group descriptors in one block +BOOLEAN DiskGetBootVolume(PULONG DriveNumber, PULONGLONG StartSector, PULONGLONG SectorCount, int *FsType) +{ + *DriveNumber = 0; + *StartSector = 0; + *SectorCount = 0; + *FsType = 0; + return FALSE; +} + BOOLEAN Ext2OpenVolume(UCHAR DriveNumber, ULONGLONG VolumeStartSector, ULONGLONG PartitionSectorCount) { diff --git a/reactos/boot/freeldr/freeldr/fs/fsrec.c b/reactos/boot/freeldr/freeldr/fs/fsrec.c deleted file mode 100644 index 6ba1899a8eb..00000000000 --- a/reactos/boot/freeldr/freeldr/fs/fsrec.c +++ /dev/null @@ -1,131 +0,0 @@ -/* - * FreeLoader - * Copyright (C) 1998-2003 Brian Palmer - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include - -#define NDEBUG -#include - -///////////////////////////////////////////////////////////////////////////////////////////// -// FUNCTIONS -///////////////////////////////////////////////////////////////////////////////////////////// - -/* - * - * BOOLEAN FsRecognizeVolume(ULONG DriveNumber, ULONG VolumeStartSector, UCHAR* VolumeType); - * - */ -BOOLEAN FsRecognizeVolume(ULONG DriveNumber, ULONG VolumeStartSector, UCHAR* VolumeType) -{ - - DPRINTM(DPRINT_FILESYSTEM, "FsRecognizeVolume() DriveNumber: 0x%x VolumeStartSector: %d\n", DriveNumber, VolumeStartSector); - - if (FsRecIsFat(DriveNumber, VolumeStartSector)) - { - *VolumeType = PARTITION_FAT32; - return TRUE; - } - else if (FsRecIsNtfs(DriveNumber, VolumeStartSector)) - { - *VolumeType = PARTITION_NTFS; - return TRUE; - } - else if (FsRecIsExt2(DriveNumber, VolumeStartSector)) - { - *VolumeType = PARTITION_EXT2; - return TRUE; - } - - return FALSE; -} - -BOOLEAN FsRecIsIso9660(ULONG DriveNumber) -{ - PUCHAR Sector = (PUCHAR)DISKREADBUFFER; - - if (!MachDiskReadLogicalSectors(DriveNumber, 16, 1, Sector)) - { - FileSystemError("Failed to read the PVD."); - return FALSE; - } - - return (Sector[0] == 1 && - Sector[1] == 'C' && - Sector[2] == 'D' && - Sector[3] == '0' && - Sector[4] == '0' && - Sector[5] == '1'); -} - -BOOLEAN FsRecIsExt2(ULONG DriveNumber, ULONG VolumeStartSector) -{ - PEXT2_SUPER_BLOCK SuperBlock = (PEXT2_SUPER_BLOCK)DISKREADBUFFER; - - if (!MachDiskReadLogicalSectors(DriveNumber, VolumeStartSector + 2, 2, SuperBlock)) - { - FileSystemError("Failed to read the super block."); - return FALSE; - } - - if (SuperBlock->magic == EXT2_MAGIC) - { - return TRUE; - } - - return FALSE; -} - -BOOLEAN FsRecIsFat(ULONG DriveNumber, ULONG VolumeStartSector) -{ - PFAT_BOOTSECTOR BootSector = (PFAT_BOOTSECTOR)DISKREADBUFFER; - PFAT32_BOOTSECTOR BootSector32 = (PFAT32_BOOTSECTOR)DISKREADBUFFER; - PFATX_BOOTSECTOR BootSectorX = (PFATX_BOOTSECTOR)DISKREADBUFFER; - if (!MachDiskReadLogicalSectors(DriveNumber, VolumeStartSector, 1, BootSector)) - { - FileSystemError("Failed to read the boot sector."); - return FALSE; - } - - if (strncmp(BootSector->FileSystemType, "FAT12 ", 8) == 0 || - strncmp(BootSector->FileSystemType, "FAT16 ", 8) == 0 || - strncmp(BootSector32->FileSystemType, "FAT32 ", 8) == 0 || - strncmp(BootSectorX->FileSystemType, "FATX", 4) == 0) - { - return TRUE; - } - - return FALSE; -} - -BOOLEAN FsRecIsNtfs(ULONG DriveNumber, ULONG VolumeStartSector) -{ - PNTFS_BOOTSECTOR BootSector = (PNTFS_BOOTSECTOR)DISKREADBUFFER; - if (!MachDiskReadLogicalSectors(DriveNumber, VolumeStartSector, 1, BootSector)) - { - FileSystemError("Failed to read the boot sector."); - return FALSE; - } - - if (RtlEqualMemory(BootSector->SystemId, "NTFS", 4)) - { - return TRUE; - } - - return FALSE; -} diff --git a/reactos/boot/freeldr/freeldr/include/disk.h b/reactos/boot/freeldr/freeldr/include/disk.h index a516aadd928..caaff09940d 100644 --- a/reactos/boot/freeldr/freeldr/include/disk.h +++ b/reactos/boot/freeldr/freeldr/include/disk.h @@ -127,12 +127,7 @@ VOID DiskStopFloppyMotor(VOID); // Implemented in i386disk.c extern ULONG BootDrive; extern ULONG BootPartition; -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 DiskNormalizeSystemPath(char *SystemPath, unsigned Size); diff --git a/reactos/boot/freeldr/freeldr/include/freeldr.h b/reactos/boot/freeldr/freeldr/include/freeldr.h index d9fd05d5836..d04872d623b 100644 --- a/reactos/boot/freeldr/freeldr/include/freeldr.h +++ b/reactos/boot/freeldr/freeldr/include/freeldr.h @@ -59,7 +59,6 @@ #include #include #include -#include /* file system headers */ #include #include diff --git a/reactos/boot/freeldr/freeldr/include/fsrec.h b/reactos/boot/freeldr/freeldr/include/fsrec.h deleted file mode 100644 index 11e055ecd8c..00000000000 --- a/reactos/boot/freeldr/freeldr/include/fsrec.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * FreeLoader - * Copyright (C) 1998-2003 Brian Palmer - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef __FSREC_H -#define __FSREC_H - -BOOLEAN FsRecognizeVolume(ULONG DriveNumber, ULONG VolumeStartSector, UCHAR* VolumeType); -BOOLEAN FsRecIsIso9660(ULONG DriveNumber); -BOOLEAN FsRecIsExt2(ULONG DriveNumber, ULONG VolumeStartSector); -BOOLEAN FsRecIsFat(ULONG DriveNumber, ULONG VolumeStartSector); -BOOLEAN FsRecIsNtfs(ULONG DriveNumber, ULONG VolumeStartSector); - -#endif // #defined __FSREC_H diff --git a/reactos/boot/freeldr/freeldr/include/machine.h b/reactos/boot/freeldr/freeldr/include/machine.h index b9fff720eca..9ed71df28c7 100644 --- a/reactos/boot/freeldr/freeldr/include/machine.h +++ b/reactos/boot/freeldr/freeldr/include/machine.h @@ -63,7 +63,6 @@ typedef struct tagMACHVTBL ULONG (*GetMemoryMap)(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MaxMemoryMapSize); BOOLEAN (*DiskGetBootPath)(char *BootPath, unsigned Size); - VOID (*DiskGetBootDevice)(PULONG BootDevice); BOOLEAN (*DiskNormalizeSystemPath)(char *SystemPath, unsigned Size); BOOLEAN (*DiskReadLogicalSectors)(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer); BOOLEAN (*DiskGetPartitionEntry)(ULONG DriveNumber, ULONG PartitionNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry); @@ -98,7 +97,6 @@ VOID MachVideoSync(VOID); VOID MachBeep(VOID); MEMORY_DESCRIPTOR* ArcGetMemoryDescriptor(MEMORY_DESCRIPTOR* Current); BOOLEAN MachDiskGetBootPath(char *BootPath, unsigned Size); -VOID MachDiskGetBootDevice(PULONG BootDevice); BOOLEAN MachDiskNormalizeSystemPath(char *SystemPath, unsigned Size); BOOLEAN MachDiskReadLogicalSectors(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer); BOOLEAN MachDiskGetPartitionEntry(ULONG DriveNumber, ULONG PartitionNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry); @@ -127,7 +125,6 @@ VOID MachPrepareForReactOS(IN BOOLEAN Setup); #define MachBeep() MachVtbl.Beep() #define MachPrepareForReactOS(a) MachVtbl.PrepareForReactOS(a) #define MachDiskGetBootPath(Path, Size) MachVtbl.DiskGetBootPath((Path), (Size)) -#define MachDiskGetBootDevice(BootDevice) MachVtbl.DiskGetBootDevice(BootDevice) #define MachDiskNormalizeSystemPath(Path, Size) MachVtbl.DiskNormalizeSystemPath((Path), (Size)) #define MachDiskReadLogicalSectors(Drive, Start, Count, Buf) MachVtbl.DiskReadLogicalSectors((Drive), (Start), (Count), (Buf)) #define MachDiskGetPartitionEntry(Drive, Part, Entry) MachVtbl.DiskGetPartitionEntry((Drive), (Part), (Entry)) diff --git a/reactos/boot/freeldr/freeldr/machine.c b/reactos/boot/freeldr/freeldr/machine.c index ede3c82a245..5f07d0bb630 100644 --- a/reactos/boot/freeldr/freeldr/machine.c +++ b/reactos/boot/freeldr/freeldr/machine.c @@ -37,7 +37,6 @@ #undef MachBeep #undef MachPrepareForReactOS #undef MachDiskGetBootPath -#undef MachDiskGetBootDevice #undef MachDiskNormalizeSystemPath #undef MachDiskReadLogicalSectors #undef MachDiskGetPartitionEntry @@ -155,12 +154,6 @@ MachDiskGetBootPath(char *BootPath, unsigned Size) return MachVtbl.DiskGetBootPath(BootPath, Size); } -VOID -MachDiskGetBootDevice(PULONG BootDevice) -{ - MachVtbl.DiskGetBootDevice(BootDevice); -} - BOOLEAN MachDiskNormalizeSystemPath(char *SystemPath, unsigned Size) { diff --git a/reactos/boot/freeldr/freeldr/reactos/reactos.c b/reactos/boot/freeldr/freeldr/reactos/reactos.c index 80b26c93d19..6e52a6855e2 100644 --- a/reactos/boot/freeldr/freeldr/reactos/reactos.c +++ b/reactos/boot/freeldr/freeldr/reactos/reactos.c @@ -755,14 +755,11 @@ LoadAndBootReactOS(PCSTR OperatingSystemName) // RamDiskSwitchFromBios(); - /* - * Try to get system volume - */ - if (!DiskGetSystemVolume(SystemPath, szBootPath, &LoaderBlock.BootDevice)) - { - UiMessageBox("Failed to get system volume."); - return; - } + /* Get boot path */ + if (strchr(SystemPath, '\\') != NULL) + strcpy(szBootPath, strchr(SystemPath, '\\')); + else + szBootPath[0] = '\0'; /* append a backslash */ if ((strlen(szBootPath)==0) ||