/* INCLUDES *******************************************************************/
#include <freeldr.h>
+#define RGB565(r, g, b) (((r >> 3) << 11)| ((g >> 2) << 5)| ((b >> 3) << 0))
/* GLOBALS ********************************************************************/
VOID ArmPrepareForReactOS(IN BOOLEAN Setup);
ADDRESS_RANGE ArmBoardMemoryMap[16];
ULONG ArmBoardMemoryMapRangeCount;
+ULONG gDiskReadBuffer, gFileSysBuffer;
/* FUNCTIONS ******************************************************************/
ArmBoardBlock = BootContext;
//
- // Let's make sure we understand the boot-loader
+ // Let's make sure we understand the LLB
//
ASSERT(ArmBoardBlock->MajorVersion == ARM_BOARD_CONFIGURATION_MAJOR_VERSION);
ASSERT(ArmBoardBlock->MinorVersion == ARM_BOARD_CONFIGURATION_MINOR_VERSION);
}
BOOLEAN
-ArmDiskGetDriveGeometry(IN ULONG DriveNumber,
- OUT PGEOMETRY Geometry)
+ArmDiskNormalizeSystemPath(IN OUT PCHAR SystemPath,
+ IN unsigned Size)
{
- ASSERT(gRamDiskBase == NULL);
- return FALSE;
+ TuiPrintf("Called: %s\n", SystemPath);
+ while (TRUE);
+ return TRUE;
}
BOOLEAN
-ArmDiskReadLogicalSectors(IN ULONG DriveNumber,
- IN ULONGLONG SectorNumber,
- IN ULONG SectorCount,
- IN PVOID Buffer)
+ArmDiskGetBootPath(OUT PCHAR BootPath,
+ IN unsigned Size)
{
- ASSERT(gRamDiskBase == NULL);
- return FALSE;
-}
-
-ULONG
-ArmDiskGetCacheableBlockCount(IN ULONG DriveNumber)
-{
- ASSERT(gRamDiskBase == NULL);
- return FALSE;
+ PCCH Path = "ramdisk(0)";
+
+ /* Make sure enough space exists */
+ if (Size < sizeof(Path)) return FALSE;
+
+ /* On ARM platforms, the loader is always in RAM */
+ strcpy(BootPath, Path);
+ return TRUE;
}
PCONFIGURATION_COMPONENT_DATA
//
FldrCreateSystemKey(&RootNode);
- //
- // Write null component information
- //
- FldrSetComponentInformation(RootNode,
- 0x0,
- 0x0,
- 0xFFFFFFFF);
-
//
// TODO:
// There's no such thing as "PnP" on embedded hardware.
// or OpenFirmware device trees, and we will convert it to ARC.
//
+ //
+ // Register RAMDISK Device
+ //
+ RamDiskInitialize();
+
//
// Return the root node
//
//
switch (ArmBoardBlock->BoardType)
{
- //
- // Check for Feroceon-base boards
- //
+ //
+ // 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;
+ TuiPrintf("Not implemented\n");
+ while (TRUE);
break;
- //
- // Check for ARM Versatile PB boards
- //
+ //
+ // 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;
+ /* Copy Machine Routines from Firmware Table */
+ MachVtbl.ConsPutChar = ArmBoardBlock->ConsPutChar;
+ MachVtbl.ConsKbHit = ArmBoardBlock->ConsKbHit;
+ MachVtbl.ConsGetCh = ArmBoardBlock->ConsGetCh;
+ MachVtbl.VideoClearScreen = ArmBoardBlock->VideoClearScreen;
+ MachVtbl.VideoSetDisplayMode = ArmBoardBlock->VideoSetDisplayMode;
+ MachVtbl.VideoGetDisplaySize = ArmBoardBlock->VideoGetDisplaySize;
+ MachVtbl.VideoGetBufferSize = ArmBoardBlock->VideoGetBufferSize;
+ MachVtbl.VideoSetTextCursorPosition = ArmBoardBlock->VideoSetTextCursorPosition;
+ MachVtbl.VideoSetTextCursorPosition = ArmBoardBlock->VideoSetTextCursorPosition;
+ MachVtbl.VideoHideShowTextCursor = ArmBoardBlock->VideoHideShowTextCursor;
+ MachVtbl.VideoPutChar = ArmBoardBlock->VideoPutChar;
+ MachVtbl.VideoCopyOffScreenBufferToVRAM = ArmBoardBlock->VideoCopyOffScreenBufferToVRAM;
+ MachVtbl.VideoIsPaletteFixed = ArmBoardBlock->VideoIsPaletteFixed;
+ MachVtbl.VideoSetPaletteColor = ArmBoardBlock->VideoSetPaletteColor;
+ MachVtbl.VideoGetPaletteColor = ArmBoardBlock->VideoGetPaletteColor;
+ MachVtbl.VideoSync = ArmBoardBlock->VideoSync;
+
+ /* Setup the disk and file system buffers */
+ gDiskReadBuffer = 0x00090000;
+ gFileSysBuffer = 0x00090000;
break;
//
// For now that means only Beagle, but ZOOM and others should be ok too
//
case MACH_TYPE_OMAP3_BEAGLE:
-
- //
- // These boards use a UART16550
- //
- ArmOmap3SerialInit(115200);
- MachVtbl.ConsPutChar = ArmOmap3PutChar;
- MachVtbl.ConsKbHit = ArmOmap3KbHit;
- MachVtbl.ConsGetCh = ArmOmap3GetCh;
+ TuiPrintf("Not implemented\n");
+ while (TRUE);
break;
default:
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
+ // Setup disk I/O routines
//
- MachVtbl.DiskGetBootVolume = DiskGetBootVolume;
- MachVtbl.DiskGetSystemVolume = DiskGetSystemVolume;
- MachVtbl.DiskGetBootPath = DiskGetBootPath;
- MachVtbl.DiskGetBootDevice = DiskGetBootDevice;
- MachVtbl.DiskBootingFromFloppy = DiskBootingFromFloppy;
- MachVtbl.DiskNormalizeSystemPath = DiskNormalizeSystemPath;
- MachVtbl.DiskGetPartitionEntry = DiskGetPartitionEntry;
+ MachVtbl.DiskGetBootPath = ArmDiskGetBootPath;
+ MachVtbl.DiskNormalizeSystemPath = ArmDiskNormalizeSystemPath;
//
// We can now print to the console
//
TuiPrintf("%s for ARM\n", GetFreeLoaderVersionString());
- TuiPrintf("Bootargs: %s\n", CommandLine);
+ TuiPrintf("Bootargs: %s\n\n", CommandLine);
}