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
)
29 ArmDiskGetDriveGeometry(IN ULONG DriveNumber
,
30 OUT PGEOMETRY Geometry
)
32 ASSERT(gRamDiskBase
== NULL
);
37 ArmDiskReadLogicalSectors(IN ULONG DriveNumber
,
38 IN ULONGLONG SectorNumber
,
42 ASSERT(gRamDiskBase
== NULL
);
47 ArmDiskGetCacheableBlockCount(IN ULONG DriveNumber
)
49 ASSERT(gRamDiskBase
== NULL
);
54 ArmDiskGetBootVolume(IN PULONG DriveNumber
,
55 IN PULONGLONG StartSector
,
56 IN PULONGLONG SectorCount
,
60 // We only support RAM disk for now -- add support for NAND later
66 // Use magic ramdisk drive number and count the number of 512-byte sectors
70 *SectorCount
= gRamDiskSize
* 512;
73 // Ramdisk support is FAT-only for now
78 // Now that ramdisk is enabled, use ramdisk routines
80 RamDiskSwitchFromBios();
85 ArmDiskGetSystemVolume(IN PCHAR SystemPath
,
86 OUT PCHAR RemainingPath
,
88 OUT PULONG DriveNumber
,
89 OUT PULONGLONG StartSector
,
90 OUT PULONGLONG SectorCount
,
98 ArmDiskNormalizeSystemPath(IN PCHAR SystemPath
,
106 ArmPrepareForReactOS(IN BOOLEAN Setup
)
111 PCONFIGURATION_COMPONENT_DATA
119 ArmMemGetMemoryMap(OUT PBIOS_MEMORY_MAP BiosMemoryMap
,
120 IN ULONG MaxMemoryMapSize
)
123 // Return whatever the board returned to us (CS0 Base + Size and FLASH0)
125 RtlCopyMemory(BiosMemoryMap
,
126 ArmBoardBlock
->MemoryMap
,
127 ArmBoardBlock
->MemoryMapEntryCount
* sizeof(BIOS_MEMORY_MAP
));
128 return ArmBoardBlock
->MemoryMapEntryCount
;
132 MachInit(IN PCCH CommandLine
)
135 // Setup board-specific ARM routines
137 switch (ArmBoardBlock
->BoardType
)
140 // Check for Feroceon-base boards
145 // These boards use a UART16550. Set us up for 115200 bps
147 ArmFeroSerialInit(115200);
148 MachVtbl
.ConsPutChar
= ArmFeroPutChar
;
149 MachVtbl
.ConsKbHit
= ArmFeroKbHit
;
150 MachVtbl
.ConsGetCh
= ArmFeroGetCh
;
158 // Setup generic ARM routines
160 MachVtbl
.PrepareForReactOS
= ArmPrepareForReactOS
;
161 MachVtbl
.GetMemoryMap
= ArmMemGetMemoryMap
;
162 MachVtbl
.DiskGetBootVolume
= ArmDiskGetBootVolume
;
163 MachVtbl
.DiskGetSystemVolume
= ArmDiskGetSystemVolume
;
164 MachVtbl
.DiskNormalizeSystemPath
= ArmDiskNormalizeSystemPath
;
165 MachVtbl
.DiskReadLogicalSectors
= ArmDiskReadLogicalSectors
;
166 MachVtbl
.DiskGetDriveGeometry
= ArmDiskGetDriveGeometry
;
167 MachVtbl
.DiskGetCacheableBlockCount
= ArmDiskGetCacheableBlockCount
;
168 MachVtbl
.HwDetect
= ArmHwDetect
;
171 // We can now print to the console
173 TuiPrintf("%s for ARM\n", GetFreeLoaderVersionString());
174 TuiPrintf("Bootargs: %s\n", CommandLine
);