diff --git a/reactos/boot/freeldr/freeldr/arch/i386/arch.S b/reactos/boot/freeldr/freeldr/arch/i386/arch.S index 225dc4be3f9..722b63c9352 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/arch.S +++ b/reactos/boot/freeldr/freeldr/arch/i386/arch.S @@ -50,14 +50,14 @@ EXTERN(RealEntryPoint) /* Zero BootDrive and BootPartition */ xor eax, eax - mov dword ptr [_BootDrive], eax - mov dword ptr [_BootPartition], eax + mov dword ptr [_FrldrBootDrive], eax + mov dword ptr [_FrldrBootPartition], eax /* Store the boot drive */ - mov byte ptr [_BootDrive], dl + mov byte ptr [_FrldrBootDrive], dl /* Store the boot partition */ - mov byte ptr [_BootPartition], dh + mov byte ptr [_FrldrBootPartition], dh /* GO! */ push eax @@ -302,7 +302,7 @@ EXTERN(_DisableA20) /* Align 32 bits boundary */ .align 4 - + /* Multiboot header */ MultibootHeader: /* magic */ @@ -400,12 +400,12 @@ mb4: mov eax, [ebx + MB_INFO_BOOT_DEVICE_OFFSET] shr eax, 16 inc al - mov byte ptr _BootPartition, al - mov byte ptr _BootDrive, ah + mov byte ptr _FrldrBootPartition, al + mov byte ptr _FrldrBootDrive, ah jmp mb6 mb5: /* No boot device known, assume first partition of first harddisk */ - mov byte ptr _BootDrive, HEX(80) - mov byte ptr _BootPartition, 1 + mov byte ptr _FrldrBootDrive, HEX(80) + mov byte ptr _FrldrBootPartition, 1 mb6: /* Check for command line */ mov eax, offset cmdline @@ -415,7 +415,7 @@ mb6: mb7: /* GO! */ - push eax + push eax call _BootMain mbfail: @@ -496,8 +496,8 @@ mb_info: cmdline: .fill CMDLINE_SIZE, 1, 0 -EXTERN(_BootDrive) +EXTERN(_FrldrBootDrive) .long 0 - -EXTERN(_BootPartition) + +EXTERN(_FrldrBootPartition) .long 0 diff --git a/reactos/boot/freeldr/freeldr/arch/i386/boot.S b/reactos/boot/freeldr/freeldr/arch/i386/boot.S index ec07351fe58..cc1f469d444 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/boot.S +++ b/reactos/boot/freeldr/freeldr/arch/i386/boot.S @@ -31,7 +31,7 @@ EXTERN(_ChainLoadBiosBootSectorCode) .code16 /* Set the boot drive */ - movb (_BootDrive),%dl + movb (_FrldrBootDrive),%dl /* Load segment registers */ cli diff --git a/reactos/boot/freeldr/freeldr/arch/i386/hardware.c b/reactos/boot/freeldr/freeldr/arch/i386/hardware.c index 641bd8d4c94..f89204fc8a3 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/hardware.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/hardware.c @@ -736,7 +736,7 @@ DetectBiosFloppyController(PCONFIGURATION_COMPONENT_DATA BusKey) DPRINTM(DPRINT_HWDETECT, "Floppy count: %u\n", FloppyCount); - + Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + 2 * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR); PartialResourceList = MmHeapAlloc(Size); @@ -808,11 +808,11 @@ DetectSystem(VOID) ULONG Size; ULONG i; BOOLEAN Changed; - + /* Count the number of visible drives */ DiskReportError(FALSE); DiskCount = 0; - + /* There are some really broken BIOSes out there. There are even BIOSes * that happily report success when you ask them to read from non-existent * harddisks. So, we set the buffer to known contents first, then try to @@ -838,7 +838,7 @@ DetectSystem(VOID) DiskReportError(TRUE); DPRINTM(DPRINT_HWDETECT, "BIOS reports %d harddisk%s\n", (int)DiskCount, (DiskCount == 1) ? "": "s"); - + /* Allocate resource descriptor */ Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + sizeof(CM_INT13_DRIVE_PARAMETER) * DiskCount; @@ -849,7 +849,7 @@ DetectSystem(VOID) "Failed to allocate resource descriptor\n"); return NULL; } - + /* Initialize resource descriptor */ memset(PartialResourceList, 0, Size); PartialResourceList->Version = 1; @@ -860,7 +860,7 @@ DetectSystem(VOID) PartialResourceList->PartialDescriptors[0].Flags = 0; PartialResourceList->PartialDescriptors[0].u.DeviceSpecificData.DataSize = sizeof(CM_INT13_DRIVE_PARAMETER) * DiskCount; - + /* Get harddisk Int13 geometry data */ Int13Drives = (PVOID)(((ULONG_PTR)PartialResourceList) + sizeof(CM_PARTIAL_RESOURCE_LIST)); for (i = 0; i < DiskCount; i++) @@ -872,7 +872,7 @@ DetectSystem(VOID) Int13Drives[i].SectorsPerTrack = Geometry.Sectors; Int13Drives[i].MaxHeads = Geometry.Heads - 1; Int13Drives[i].NumberDrives = DiskCount; - + DPRINTM(DPRINT_HWDETECT, "Disk %x: %u Cylinders %u Heads %u Sectors %u Bytes\n", 0x80 + i, @@ -954,7 +954,7 @@ DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA BusKey) 0, &ControllerKey); DPRINTM(DPRINT_HWDETECT, "Created key: DiskController\\0\n"); - + /* Create and fill subkey for each harddisk */ for (i = 0; i < DiskCount; i++) { @@ -962,7 +962,7 @@ DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA BusKey) ULONG Size; CHAR Identifier[20]; - if (BootDrive == 0x80 + i) + if (FrldrBootDrive == 0x80 + i) BootDriveReported = TRUE; /* Get disk values */ @@ -986,15 +986,15 @@ DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA BusKey) MachDiskGetBootPath(BootPath, sizeof(BootPath)); /* Add it, if it's a floppy or cdrom */ - if ((BootDrive >= 0x80 && !BootDriveReported) || - DiskIsDriveRemovable(BootDrive)) + if ((FrldrBootDrive >= 0x80 && !BootDriveReported) || + DiskIsDriveRemovable(FrldrBootDrive)) { /* TODO: Check if it's really a cdrom drive */ ULONG* Buffer; ULONG Checksum = 0; /* Read the MBR */ - if (!MachDiskReadLogicalSectors(BootDrive, 16ULL, 1, (PVOID)DISKREADBUFFER)) + if (!MachDiskReadLogicalSectors(FrldrBootDrive, 16ULL, 1, (PVOID)DISKREADBUFFER)) { DPRINTM(DPRINT_HWDETECT, "Reading MBR failed\n"); return; @@ -1746,9 +1746,9 @@ DetectKeyboardController(PCONFIGURATION_COMPONENT_DATA BusKey) Size, &ControllerKey); DPRINTM(DPRINT_HWDETECT, "Created key: KeyboardController\\0\n"); - + MmHeapFree(PartialResourceList); - + DetectKeyboardPeripheral(ControllerKey); } @@ -2049,14 +2049,14 @@ PcHwDetect(VOID) /* Create the 'System' key */ SystemKey = DetectSystem(); - + /* Detect buses */ DetectPciBios(SystemKey, &BusNumber); DetectApmBios(SystemKey, &BusNumber); DetectPnpBios(SystemKey, &BusNumber); DetectIsaBios(SystemKey, &BusNumber); DetectAcpiBios(SystemKey, &BusNumber); - + DPRINTM(DPRINT_HWDETECT, "DetectHardware() Done\n"); return SystemKey; diff --git a/reactos/boot/freeldr/freeldr/arch/i386/linux.S b/reactos/boot/freeldr/freeldr/arch/i386/linux.S index 2d288268324..da2f42600a8 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/linux.S +++ b/reactos/boot/freeldr/freeldr/arch/i386/linux.S @@ -30,7 +30,7 @@ EXTERN(_BootNewLinuxKernel) .code16 /* Set the boot drive */ - movb (_BootDrive),%dl + movb (_FrldrBootDrive),%dl /* Load segment registers */ cli @@ -66,7 +66,7 @@ EXTERN(_BootOldLinuxKernel) .code16 /* Set the boot drive */ - movb (_BootDrive),%dl + movb (_FrldrBootDrive),%dl /* Load segment registers */ cli diff --git a/reactos/boot/freeldr/freeldr/disk/disk.c b/reactos/boot/freeldr/freeldr/disk/disk.c index b7ce3295497..77800d0609f 100644 --- a/reactos/boot/freeldr/freeldr/disk/disk.c +++ b/reactos/boot/freeldr/freeldr/disk/disk.c @@ -111,7 +111,7 @@ DiskGetBootPath(char *BootPath, unsigned Size) PARTITION_TABLE_ENTRY PartitionEntry; MASTER_BOOT_RECORD MasterBootRecord; - if (BootDrive < 0x80) + if (FrldrBootDrive < 0x80) { /* This is a floppy */ @@ -124,17 +124,17 @@ DiskGetBootPath(char *BootPath, unsigned Size) strcat(BootPath, "fdisk"); - _itoa(BootDrive, Device, 10); + _itoa(FrldrBootDrive, Device, 10); strcat(BootPath, "("); strcat(BootPath, Device); strcat(BootPath, ")"); } /* FIXME */ - else if (DiskReadBootRecord(BootDrive, 0, &MasterBootRecord)) + else if (DiskReadBootRecord(FrldrBootDrive, 0, &MasterBootRecord)) { /* This is a hard disk */ - if (!DiskGetActivePartitionEntry(BootDrive, &PartitionEntry, &BootPartition)) + if (!DiskGetActivePartitionEntry(FrldrBootDrive, &PartitionEntry, &FrldrBootPartition)) { DbgPrint("Invalid active partition information\n"); return FALSE; @@ -149,12 +149,12 @@ DiskGetBootPath(char *BootPath, unsigned Size) strcat(BootPath, "rdisk"); - _itoa(BootDrive - 0x80, Device, 10); + _itoa(FrldrBootDrive - 0x80, Device, 10); strcat(BootPath, "("); strcat(BootPath, Device); strcat(BootPath, ")"); - _itoa(BootPartition, Partition, 10); + _itoa(FrldrBootPartition, Partition, 10); strcat(BootPath, "partition("); strcat(BootPath, Partition); strcat(BootPath, ")"); @@ -172,7 +172,7 @@ DiskGetBootPath(char *BootPath, unsigned Size) strcat(BootPath, "cdrom"); - _itoa(BootDrive - 0x80, Device, 10); + _itoa(FrldrBootDrive - 0x80, Device, 10); strcat(BootPath, "("); strcat(BootPath, Device); strcat(BootPath, ")"); diff --git a/reactos/boot/freeldr/freeldr/include/disk.h b/reactos/boot/freeldr/freeldr/include/disk.h index 191ee1215d6..2261930cf4f 100644 --- a/reactos/boot/freeldr/freeldr/include/disk.h +++ b/reactos/boot/freeldr/freeldr/include/disk.h @@ -123,8 +123,8 @@ PCSTR DiskGetErrorCodeString(ULONG ErrorCode); BOOLEAN DiskReadLogicalSectors(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer); // Implemented in i386disk.c BOOLEAN DiskIsDriveRemovable(ULONG DriveNumber); VOID DiskStopFloppyMotor(VOID); // Implemented in i386disk.c -extern ULONG BootDrive; -extern ULONG BootPartition; +extern ULONG FrldrBootDrive; +extern ULONG FrldrBootPartition; BOOLEAN DiskGetBootPath(char *BootPath, unsigned Size);