2 * PROJECT: ReactOS Boot Loader
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: boot/freeldr/arch/arm/stubs.c
5 * PURPOSE: Non-completed ARM hardware-specific routines
6 * PROGRAMMERS: ReactOS Portable Systems Group
9 /* INCLUDES *******************************************************************/
13 /* GLOBALS ********************************************************************/
15 ULONG PageDirectoryStart
, PageDirectoryEnd
;
17 /* FUNCTIONS ******************************************************************/
20 FrLdrStartup(IN ULONG Magic
)
28 ArmDiskGetDriveGeometry(IN ULONG DriveNumber
,
29 OUT PGEOMETRY Geometry
)
31 ASSERT(gRamDiskBase
== NULL
);
36 ArmDiskReadLogicalSectors(IN ULONG DriveNumber
,
37 IN ULONGLONG SectorNumber
,
41 ASSERT(gRamDiskBase
== NULL
);
46 ArmDiskGetCacheableBlockCount(IN ULONG DriveNumber
)
48 ASSERT(gRamDiskBase
== NULL
);
53 ArmPrepareForReactOS(IN BOOLEAN Setup
)
58 PCONFIGURATION_COMPONENT_DATA
61 PCONFIGURATION_COMPONENT_DATA RootNode
;
64 // Create the root node
66 FldrCreateSystemKey(&RootNode
);
69 // Write null component information
71 FldrSetComponentInformation(RootNode
,
78 // There's no such thing as "PnP" on embedded hardware.
79 // The boot loader will send us a device tree, similar to ACPI
80 // or OpenFirmware device trees, and we will convert it to ARC.
84 // Return the root node
90 ArmMemGetMemoryMap(OUT PBIOS_MEMORY_MAP BiosMemoryMap
,
91 IN ULONG MaxMemoryMapSize
)
94 // Return whatever the board returned to us (CS0 Base + Size and FLASH0)
96 RtlCopyMemory(BiosMemoryMap
,
97 ArmBoardBlock
->MemoryMap
,
98 ArmBoardBlock
->MemoryMapEntryCount
* sizeof(BIOS_MEMORY_MAP
));
99 return ArmBoardBlock
->MemoryMapEntryCount
;
103 MachInit(IN PCCH CommandLine
)
106 // Setup board-specific ARM routines
108 switch (ArmBoardBlock
->BoardType
)
111 // Check for Feroceon-base boards
116 // These boards use a UART16550. Set us up for 115200 bps
118 ArmFeroSerialInit(115200);
119 MachVtbl
.ConsPutChar
= ArmFeroPutChar
;
120 MachVtbl
.ConsKbHit
= ArmFeroKbHit
;
121 MachVtbl
.ConsGetCh
= ArmFeroGetCh
;
129 // Setup generic ARM routines for all boards
131 MachVtbl
.PrepareForReactOS
= ArmPrepareForReactOS
;
132 MachVtbl
.GetMemoryMap
= ArmMemGetMemoryMap
;
133 MachVtbl
.HwDetect
= ArmHwDetect
;
136 // Setup disk I/O routines, switch to ramdisk ones for non-NAND boot
138 MachVtbl
.DiskReadLogicalSectors
= ArmDiskReadLogicalSectors
;
139 MachVtbl
.DiskGetDriveGeometry
= ArmDiskGetDriveGeometry
;
140 MachVtbl
.DiskGetCacheableBlockCount
= ArmDiskGetCacheableBlockCount
;
141 RamDiskSwitchFromBios();
144 // Now set default disk handling routines -- we don't need to override
146 MachVtbl
.DiskGetBootVolume
= DiskGetBootVolume
;
147 MachVtbl
.DiskGetSystemVolume
= DiskGetSystemVolume
;
148 MachVtbl
.DiskGetBootPath
= DiskGetBootPath
;
149 MachVtbl
.DiskGetBootDevice
= DiskGetBootDevice
;
150 MachVtbl
.DiskBootingFromFloppy
= DiskBootingFromFloppy
;
151 MachVtbl
.DiskNormalizeSystemPath
= DiskNormalizeSystemPath
;
152 MachVtbl
.DiskGetPartitionEntry
= DiskGetPartitionEntry
;
155 // We can now print to the console
157 TuiPrintf("%s for ARM\n", GetFreeLoaderVersionString());
158 TuiPrintf("Bootargs: %s\n", CommandLine
);