Better organize FreeLDR ARM files -- there are no more stubs now. We have the ReactOS kernel loader in loader.c, just like on x86, and the ARM FreeLDR HAL/Mach routines in macharm.c

svn path=/trunk/; revision=32311
This commit is contained in:
ReactOS Portable Systems Group 2008-02-12 04:22:39 +00:00
parent 41af47163d
commit 52fa6c202f
3 changed files with 146 additions and 146 deletions

View file

@ -1,8 +1,8 @@
/* /*
* PROJECT: ReactOS Boot Loader * PROJECT: ReactOS Boot Loader
* LICENSE: GPL - See COPYING in the top level directory * LICENSE: GPL - See COPYING in the top level directory
* FILE: boot/freeldr/arch/arm/stubs.c * FILE: boot/freeldr/arch/arm/loader.c
* PURPOSE: Non-completed ARM hardware-specific routines * PURPOSE: ARM Kernel Loader
* PROGRAMMERS: ReactOS Portable Systems Group * PROGRAMMERS: ReactOS Portable Systems Group
*/ */
@ -23,31 +23,6 @@ extern ROS_KERNEL_ENTRY_POINT KernelEntryPoint;
/* FUNCTIONS ******************************************************************/ /* FUNCTIONS ******************************************************************/
BOOLEAN
ArmDiskGetDriveGeometry(IN ULONG DriveNumber,
OUT PGEOMETRY Geometry)
{
ASSERT(gRamDiskBase == NULL);
return FALSE;
}
BOOLEAN
ArmDiskReadLogicalSectors(IN ULONG DriveNumber,
IN ULONGLONG SectorNumber,
IN ULONG SectorCount,
IN PVOID Buffer)
{
ASSERT(gRamDiskBase == NULL);
return FALSE;
}
ULONG
ArmDiskGetCacheableBlockCount(IN ULONG DriveNumber)
{
ASSERT(gRamDiskBase == NULL);
return FALSE;
}
VOID VOID
ArmSetupPageDirectory(VOID) ArmSetupPageDirectory(VOID)
{ {
@ -182,123 +157,6 @@ ArmPrepareForReactOS(IN BOOLEAN Setup)
// //
} }
PCONFIGURATION_COMPONENT_DATA
ArmHwDetect(VOID)
{
PCONFIGURATION_COMPONENT_DATA RootNode;
//
// Create the root node
//
FldrCreateSystemKey(&RootNode);
//
// Write null component information
//
FldrSetComponentInformation(RootNode,
0x0,
0x0,
0xFFFFFFFF);
//
// TODO:
// There's no such thing as "PnP" on embedded hardware.
// The boot loader will send us a device tree, similar to ACPI
// or OpenFirmware device trees, and we will convert it to ARC.
//
//
// Return the root node
//
return RootNode;
}
ULONG
ArmMemGetMemoryMap(OUT PBIOS_MEMORY_MAP BiosMemoryMap,
IN ULONG MaxMemoryMapSize)
{
//
// Return whatever the board returned to us (CS0 Base + Size and FLASH0)
//
RtlCopyMemory(BiosMemoryMap,
ArmBoardBlock->MemoryMap,
ArmBoardBlock->MemoryMapEntryCount * sizeof(BIOS_MEMORY_MAP));
return ArmBoardBlock->MemoryMapEntryCount;
}
VOID
MachInit(IN PCCH CommandLine)
{
//
// Setup board-specific ARM routines
//
switch (ArmBoardBlock->BoardType)
{
//
// Check for Feroceon-base boards
//
case MACH_TYPE_FEROCEON:
//
// These boards use a UART16550. Set us up for 115200 bps
//
ArmFeroSerialInit(115200);
MachVtbl.ConsPutChar = ArmFeroPutChar;
MachVtbl.ConsKbHit = ArmFeroKbHit;
MachVtbl.ConsGetCh = ArmFeroGetCh;
break;
//
// Check for ARM Versatile PB boards
//
case MACH_TYPE_VERSATILE_PB:
//
// These boards use a PrimeCell UART (PL011)
//
ArmVersaSerialInit(115200);
MachVtbl.ConsPutChar = ArmVersaPutChar;
MachVtbl.ConsKbHit = ArmVersaKbHit;
MachVtbl.ConsGetCh = ArmVersaGetCh;
break;
default:
ASSERT(FALSE);
}
//
// Setup generic ARM routines for all boards
//
MachVtbl.PrepareForReactOS = ArmPrepareForReactOS;
MachVtbl.GetMemoryMap = ArmMemGetMemoryMap;
MachVtbl.HwDetect = ArmHwDetect;
//
// Setup disk I/O routines, switch to ramdisk ones for non-NAND boot
//
MachVtbl.DiskReadLogicalSectors = ArmDiskReadLogicalSectors;
MachVtbl.DiskGetDriveGeometry = ArmDiskGetDriveGeometry;
MachVtbl.DiskGetCacheableBlockCount = ArmDiskGetCacheableBlockCount;
RamDiskSwitchFromBios();
//
// 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;
MachVtbl.DiskNormalizeSystemPath = DiskNormalizeSystemPath;
MachVtbl.DiskGetPartitionEntry = DiskGetPartitionEntry;
//
// We can now print to the console
//
TuiPrintf("%s for ARM\n", GetFreeLoaderVersionString());
TuiPrintf("Bootargs: %s\n", CommandLine);
}
VOID VOID
FrLdrStartup(IN ULONG Magic) FrLdrStartup(IN ULONG Magic)
{ {

View file

@ -14,6 +14,7 @@
PARM_BOARD_CONFIGURATION_BLOCK ArmBoardBlock; PARM_BOARD_CONFIGURATION_BLOCK ArmBoardBlock;
ULONG BootDrive, BootPartition; ULONG BootDrive, BootPartition;
VOID ArmPrepareForReactOS(IN BOOLEAN Setup);
/* FUNCTIONS ******************************************************************/ /* FUNCTIONS ******************************************************************/
@ -43,3 +44,144 @@ ArmInit(IN PARM_BOARD_CONFIGURATION_BLOCK BootContext)
BootMain(ArmBoardBlock->CommandLine); BootMain(ArmBoardBlock->CommandLine);
} }
BOOLEAN
ArmDiskGetDriveGeometry(IN ULONG DriveNumber,
OUT PGEOMETRY Geometry)
{
ASSERT(gRamDiskBase == NULL);
return FALSE;
}
BOOLEAN
ArmDiskReadLogicalSectors(IN ULONG DriveNumber,
IN ULONGLONG SectorNumber,
IN ULONG SectorCount,
IN PVOID Buffer)
{
ASSERT(gRamDiskBase == NULL);
return FALSE;
}
ULONG
ArmDiskGetCacheableBlockCount(IN ULONG DriveNumber)
{
ASSERT(gRamDiskBase == NULL);
return FALSE;
}
PCONFIGURATION_COMPONENT_DATA
ArmHwDetect(VOID)
{
PCONFIGURATION_COMPONENT_DATA RootNode;
//
// Create the root node
//
FldrCreateSystemKey(&RootNode);
//
// Write null component information
//
FldrSetComponentInformation(RootNode,
0x0,
0x0,
0xFFFFFFFF);
//
// TODO:
// There's no such thing as "PnP" on embedded hardware.
// The boot loader will send us a device tree, similar to ACPI
// or OpenFirmware device trees, and we will convert it to ARC.
//
//
// Return the root node
//
return RootNode;
}
ULONG
ArmMemGetMemoryMap(OUT PBIOS_MEMORY_MAP BiosMemoryMap,
IN ULONG MaxMemoryMapSize)
{
//
// Return whatever the board returned to us (CS0 Base + Size and FLASH0)
//
RtlCopyMemory(BiosMemoryMap,
ArmBoardBlock->MemoryMap,
ArmBoardBlock->MemoryMapEntryCount * sizeof(BIOS_MEMORY_MAP));
return ArmBoardBlock->MemoryMapEntryCount;
}
VOID
MachInit(IN PCCH CommandLine)
{
//
// Setup board-specific ARM routines
//
switch (ArmBoardBlock->BoardType)
{
//
// Check for Feroceon-base boards
//
case MACH_TYPE_FEROCEON:
//
// These boards use a UART16550. Set us up for 115200 bps
//
ArmFeroSerialInit(115200);
MachVtbl.ConsPutChar = ArmFeroPutChar;
MachVtbl.ConsKbHit = ArmFeroKbHit;
MachVtbl.ConsGetCh = ArmFeroGetCh;
break;
//
// Check for ARM Versatile PB boards
//
case MACH_TYPE_VERSATILE_PB:
//
// These boards use a PrimeCell UART (PL011)
//
ArmVersaSerialInit(115200);
MachVtbl.ConsPutChar = ArmVersaPutChar;
MachVtbl.ConsKbHit = ArmVersaKbHit;
MachVtbl.ConsGetCh = ArmVersaGetCh;
break;
default:
ASSERT(FALSE);
}
//
// Setup generic ARM routines for all boards
//
MachVtbl.PrepareForReactOS = ArmPrepareForReactOS;
MachVtbl.GetMemoryMap = ArmMemGetMemoryMap;
MachVtbl.HwDetect = ArmHwDetect;
//
// Setup disk I/O routines, switch to ramdisk ones for non-NAND boot
//
MachVtbl.DiskReadLogicalSectors = ArmDiskReadLogicalSectors;
MachVtbl.DiskGetDriveGeometry = ArmDiskGetDriveGeometry;
MachVtbl.DiskGetCacheableBlockCount = ArmDiskGetCacheableBlockCount;
RamDiskSwitchFromBios();
//
// 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;
MachVtbl.DiskNormalizeSystemPath = DiskNormalizeSystemPath;
MachVtbl.DiskGetPartitionEntry = DiskGetPartitionEntry;
//
// We can now print to the console
//
TuiPrintf("%s for ARM\n", GetFreeLoaderVersionString());
TuiPrintf("Bootargs: %s\n", CommandLine);
}

View file

@ -102,9 +102,9 @@
<define name="_NTHAL_" /> <define name="_NTHAL_" />
<file>boot.s</file> <file>boot.s</file>
<file>ferouart.c</file> <file>ferouart.c</file>
<file>versuart.c</file> <file>loader.c</file>
<file>macharm.c</file> <file>macharm.c</file>
<file>stubs.c</file> <file>versuart.c</file>
</module> </module>
</if> </if>
</directory> </directory>