Author: hbelusca
Date: Fri Feb 5 23:47:35 2016
New Revision: 70695
URL:
http://svn.reactos.org/svn/reactos?rev=70695&view=rev
Log:
[FREELDR]
- Whitespace fixes only in the disk code.
- Fix the name of the EXT2 FS driver.
- Move I/O initialization after Mm init so that we can properly read disk data into the
correct buffers if needed (and I will need that).
Modified:
trunk/reactos/boot/freeldr/freeldr/arch/i386/pcdisk.c
trunk/reactos/boot/freeldr/freeldr/disk/partition.c
trunk/reactos/boot/freeldr/freeldr/freeldr.c
trunk/reactos/boot/freeldr/freeldr/lib/fs/ext2.c
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/pcdisk.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/pcdisk.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/pcdisk.c [iso-8859-1] Fri Feb 5 23:47:35
2016
@@ -69,16 +69,16 @@
{
REGS RegsIn;
REGS RegsOut;
- ULONG RetryCount;
+ ULONG RetryCount;
PI386_DISK_ADDRESS_PACKET Packet = (PI386_DISK_ADDRESS_PACKET)(BIOSCALLBUFFER);
TRACE("PcDiskReadLogicalSectorsLBA() DriveNumber: 0x%x SectorNumber: %I64d
SectorCount: %d Buffer: 0x%x\n", DriveNumber, SectorNumber, SectorCount, Buffer);
ASSERT(((ULONG_PTR)Buffer) <= 0xFFFFF);
// BIOS int 0x13, function 42h - IBM/MS INT 13 Extensions - EXTENDED READ
- RegsIn.b.ah = 0x42; // Subfunction 42h
- RegsIn.b.dl = DriveNumber; // Drive number in DL (0 - floppy, 0x80 -
harddisk)
- RegsIn.x.ds = BIOSCALLBUFSEGMENT; // DS:SI -> disk address packet
+ RegsIn.b.ah = 0x42; // Subfunction 42h
+ RegsIn.b.dl = DriveNumber; // Drive number in DL (0 - floppy, 0x80 -
harddisk)
+ RegsIn.x.ds = BIOSCALLBUFSEGMENT; // DS:SI -> disk address packet
RegsIn.w.si = BIOSCALLBUFOFFSET;
// Setup disk address packet
@@ -115,11 +115,10 @@
{
return TRUE;
}
- // If it failed the do the next retry
+ // If it failed then do the next retry
else
{
PcDiskResetController(DriveNumber);
-
continue;
}
}
Modified: trunk/reactos/boot/freeldr/freeldr/disk/partition.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/disk/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/disk/partition.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/disk/partition.c [iso-8859-1] Fri Feb 5 23:47:35
2016
@@ -27,10 +27,11 @@
PPARTITION_TABLE_ENTRY PartitionTableEntry,
ULONG *ActivePartition)
{
- ULONG BootablePartitionCount = 0;
- MASTER_BOOT_RECORD MasterBootRecord;
+ ULONG BootablePartitionCount = 0;
+ MASTER_BOOT_RECORD MasterBootRecord;
*ActivePartition = 0;
+
// Read master boot record
if (!DiskReadBootRecord(DriveNumber, 0, &MasterBootRecord))
{
@@ -134,7 +135,7 @@
ExtendedPartitionOffset =
ExtendedPartitionTableEntry.SectorCountBeforePartition;
}
// Read the partition boot record
- if (!DiskReadBootRecord(DriveNumber,
ExtendedPartitionTableEntry.SectorCountBeforePartition, &MasterBootRecord))
+ if (!DiskReadBootRecord(DriveNumber,
ExtendedPartitionTableEntry.SectorCountBeforePartition, &MasterBootRecord))
{
return FALSE;
}
@@ -199,7 +200,7 @@
BOOLEAN DiskReadBootRecord(UCHAR DriveNumber, ULONGLONG LogicalSectorNumber,
PMASTER_BOOT_RECORD BootRecord)
{
- ULONG Index;
+ ULONG Index;
// Read master boot record
if (!MachDiskReadLogicalSectors(DriveNumber, LogicalSectorNumber, 1,
DiskReadBuffer))
@@ -207,7 +208,6 @@
return FALSE;
}
RtlCopyMemory(BootRecord, DiskReadBuffer, sizeof(MASTER_BOOT_RECORD));
-
TRACE("Dumping partition table for drive 0x%x:\n", DriveNumber);
TRACE("Boot record logical start sector = %d\n", LogicalSectorNumber);
Modified: trunk/reactos/boot/freeldr/freeldr/freeldr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/freel…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/freeldr.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/freeldr.c [iso-8859-1] Fri Feb 5 23:47:35 2016
@@ -29,16 +29,16 @@
VOID __cdecl BootMain(IN PCCH CmdLine)
{
CmdLineParse(CmdLine);
- MachInit(CmdLine);
- FsInit();
/* Debugger pre-initialization */
DebugInit(FALSE);
TRACE("BootMain() called.\n");
+ MachInit(CmdLine);
+
/* Check if the CPU is new enough */
- FrLdrCheckCpuCompatiblity();
+ FrLdrCheckCpuCompatiblity(); // FIXME: Should be done inside MachInit!
/* UI pre-initialization */
if (!UiInitialize(FALSE))
@@ -47,11 +47,15 @@
goto Quit;
}
+ /* Initialize memory manager */
if (!MmInitializeMemoryManager())
{
UiMessageBoxCritical("Unable to initialize memory manager.");
goto Quit;
}
+
+ /* Initialize I/O subsystem */
+ FsInit();
RunLoader();
Modified: trunk/reactos/boot/freeldr/freeldr/lib/fs/ext2.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/lib/f…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/lib/fs/ext2.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/lib/fs/ext2.c [iso-8859-1] Fri Feb 5 23:47:35
2016
@@ -1294,7 +1294,7 @@
Ext2Open,
Ext2Read,
Ext2Seek,
- L"ext2",
+ L"ext2fs",
};
const DEVVTBL* Ext2Mount(ULONG DeviceId)