{FREELDR]

Rename global variables BootDrive to FrldrBootDrive and BootPartition to FrldrBootPartition

svn path=/trunk/; revision=52171
This commit is contained in:
Timo Kreuzer 2011-06-10 12:12:16 +00:00
parent 4f74cccd2d
commit 74fcd7f506
6 changed files with 41 additions and 41 deletions

View file

@ -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

View file

@ -31,7 +31,7 @@ EXTERN(_ChainLoadBiosBootSectorCode)
.code16
/* Set the boot drive */
movb (_BootDrive),%dl
movb (_FrldrBootDrive),%dl
/* Load segment registers */
cli

View file

@ -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;

View file

@ -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

View file

@ -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, ")");

View file

@ -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);