mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 06:53:00 +00:00
[FORMATTING] Remove trailing whitespace. Addendum to 34593d93
.
Excluded: 3rd-party code (incl. wine) and most of the win32ss.
This commit is contained in:
parent
bbabe2489e
commit
9393fc320e
701 changed files with 14685 additions and 14693 deletions
|
@ -12,7 +12,7 @@
|
|||
|
||||
NESTED_ENTRY _start
|
||||
PROLOG_END _start
|
||||
|
||||
|
||||
#ifdef _BEAGLE_ // This is only used for TI BootROM on Beagle/Emulator for now
|
||||
/*
|
||||
* On Beagle, the boot is directly from TI BootROM that reads NAND flash.
|
||||
|
@ -53,7 +53,7 @@
|
|||
.byte 2 // ARM
|
||||
.byte 2 // Kernel
|
||||
.byte 0 // No compression
|
||||
.ascii "ReactOS ARM Low-Level Bootloader"
|
||||
.ascii "ReactOS ARM Low-Level Bootloader"
|
||||
#endif
|
||||
|
||||
/* Load C entrypoint and setup LLB stack */
|
||||
|
|
|
@ -50,7 +50,7 @@ DbgPrint(const char *fmt, ...)
|
|||
va_start(args, fmt);
|
||||
i = vsprintf(Buffer, fmt, args);
|
||||
va_end(args);
|
||||
|
||||
|
||||
for (j = 0; j < i; j++) LlbSerialPutChar(Buffer[j]);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -16,13 +16,13 @@ ULONG LlbEnvRamDiskSize = 0;
|
|||
ULONG LlbEnvHwRevision;
|
||||
CHAR LlbEnvCmdLine[256];
|
||||
CHAR LlbValueData[32];
|
||||
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
LlbEnvParseArguments(IN PATAG Arguments)
|
||||
{
|
||||
PATAG Atag;
|
||||
|
||||
|
||||
/* Parse the ATAGs */
|
||||
Atag = Arguments;
|
||||
while (Atag->Hdr.Size)
|
||||
|
@ -31,59 +31,59 @@ LlbEnvParseArguments(IN PATAG Arguments)
|
|||
switch (Atag->Hdr.Tag)
|
||||
{
|
||||
case ATAG_CORE:
|
||||
|
||||
|
||||
/* Save page size */
|
||||
LlbEnvHwPageSize = Atag->u.Core.PageSize;
|
||||
break;
|
||||
|
||||
|
||||
case ATAG_REVISION:
|
||||
|
||||
/* Save page size */
|
||||
LlbEnvHwRevision = Atag->u.Revision.Rev;
|
||||
break;
|
||||
|
||||
|
||||
case ATAG_MEM:
|
||||
|
||||
|
||||
/* Save RAM start and size */
|
||||
if (!LlbEnvHwMemStart) LlbEnvHwMemStart = Atag->u.Mem.Start;
|
||||
LlbEnvHwMemSize += Atag->u.Mem.Size;
|
||||
break;
|
||||
|
||||
|
||||
case ATAG_INITRD2:
|
||||
|
||||
|
||||
/* Save RAMDISK start and size */
|
||||
LlbEnvRamDiskStart = Atag->u.InitRd2.Start;
|
||||
LlbEnvRamDiskSize = Atag->u.InitRd2.Size;
|
||||
|
||||
|
||||
#ifdef _BEAGLE_
|
||||
/* Make sure it's 16MB-aligned */
|
||||
LlbEnvRamDiskSize = (LlbEnvRamDiskSize + (16 * 1024 * 1024) - 1)
|
||||
LlbEnvRamDiskSize = (LlbEnvRamDiskSize + (16 * 1024 * 1024) - 1)
|
||||
&~ ((16 * 1024 * 1024) - 1);
|
||||
|
||||
|
||||
/* The RAMDISK actually starts 16MB later */
|
||||
LlbEnvRamDiskStart += 16 * 1024 * 1024;
|
||||
LlbEnvRamDiskSize -= 16 * 1024 * 1024;
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
case ATAG_CMDLINE:
|
||||
|
||||
|
||||
/* Save command line */
|
||||
strncpy(LlbEnvCmdLine,
|
||||
Atag->u.CmdLine.CmdLine,
|
||||
Atag->Hdr.Size * sizeof(ULONG));
|
||||
break;
|
||||
|
||||
|
||||
/* Nothing left to handle */
|
||||
case ATAG_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/* Next tag */
|
||||
Atag = (PATAG)((PULONG)Atag + Atag->Hdr.Size);
|
||||
}
|
||||
|
||||
|
||||
/* For debugging */
|
||||
DbgPrint("[BOOTROM] Board Revision: %lx PageSize: %dKB RAM: %dMB CMDLINE: %s\n"
|
||||
"[RAMDISK] Base: %lx Size: %dMB\n",
|
||||
|
@ -115,7 +115,7 @@ LlbEnvGetRamDiskInformation(IN PULONG Base,
|
|||
*Size = 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/* Return ramdisk information */
|
||||
*Base = LlbEnvRamDiskStart;
|
||||
*Size = LlbEnvRamDiskSize;
|
||||
|
@ -128,7 +128,7 @@ LlbEnvRead(IN PCHAR ValueName)
|
|||
{
|
||||
PCHAR ValuePointer;
|
||||
ULONG Length = 0;
|
||||
|
||||
|
||||
/* Search for the value name */
|
||||
ValuePointer = strstr(LlbEnvCmdLine, ValueName);
|
||||
if (ValuePointer)
|
||||
|
@ -145,11 +145,11 @@ LlbEnvRead(IN PCHAR ValueName)
|
|||
/* Stop before the string ends */
|
||||
Length = strlen(ValuePointer);
|
||||
}
|
||||
|
||||
|
||||
/* Copy it */
|
||||
strncpy(LlbValueData, ValuePointer, Length);
|
||||
}
|
||||
|
||||
|
||||
/* Terminate the data */
|
||||
LlbValueData[Length] = ANSI_NULL;
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ LlbFwVideoGetDisplaySize(OUT PULONG Width,
|
|||
/* Query static settings */
|
||||
*Width = LlbHwGetScreenWidth() / 8;
|
||||
*Height = LlbHwGetScreenHeight() / 16;
|
||||
|
||||
|
||||
/* Depth is always 16 bpp */
|
||||
*Depth = 16;
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ LlbFwVideoPutChar(IN INT c,
|
|||
{
|
||||
ULONG Color, BackColor;
|
||||
PUSHORT Buffer;
|
||||
|
||||
|
||||
/* Convert EGA index to color used by hardware */
|
||||
Color = LlbHwVideoCreateColor(ColorPalette[Attr & 0xF][0],
|
||||
ColorPalette[Attr & 0xF][1],
|
||||
|
@ -100,10 +100,10 @@ LlbFwVideoPutChar(IN INT c,
|
|||
BackColor = LlbHwVideoCreateColor(ColorPalette[Attr >> 4][0],
|
||||
ColorPalette[Attr >> 4][1],
|
||||
ColorPalette[Attr >> 4][2]);
|
||||
|
||||
|
||||
/* Compute buffer address */
|
||||
Buffer = (PUSHORT)LlbHwGetFrameBuffer() + (LlbHwGetScreenWidth() * (Y * 16)) + (X * 8);
|
||||
|
||||
|
||||
/* Draw it */
|
||||
LlbVideoDrawChar(c, Buffer, Color, BackColor);
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ CHAR LlbHwScanCodeToAsciiTable[58][2] =
|
|||
{ 0,0 } ,
|
||||
{ ' ',' ' } ,
|
||||
};
|
||||
|
||||
|
||||
/* EXTENDED KEY TABLE *********************************************************/
|
||||
|
||||
UCHAR LlbHwExtendedScanCodeTable[128] =
|
||||
|
@ -143,14 +143,14 @@ UCHAR LlbHwExtendedScanCodeTable[128] =
|
|||
/* FUNCTIONS ******************************************************************/
|
||||
|
||||
USHORT LlbKbdLastScanCode;
|
||||
|
||||
|
||||
UCHAR
|
||||
NTAPI
|
||||
LlbKbdTranslateScanCode(IN USHORT ScanCode,
|
||||
IN PUCHAR KeyCode)
|
||||
{
|
||||
ULONG LastScanCode;
|
||||
|
||||
|
||||
/* Check for extended scan codes */
|
||||
if ((ScanCode == 0xE0) || (ScanCode == 0xE1))
|
||||
{
|
||||
|
@ -166,7 +166,7 @@ LlbKbdTranslateScanCode(IN USHORT ScanCode,
|
|||
LlbKbdLastScanCode = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Only act on the break, not the make */
|
||||
if (ScanCode > 0x80) return 0;
|
||||
|
||||
|
@ -183,10 +183,10 @@ LlbKbdTranslateScanCode(IN USHORT ScanCode,
|
|||
{
|
||||
/* E0 extended codes */
|
||||
case 0xE0:
|
||||
|
||||
|
||||
/* Skip bogus codes */
|
||||
if ((ScanCode == 0x2A) || (ScanCode == 0x36)) return 0;
|
||||
|
||||
|
||||
/* Lookup the code for it */
|
||||
if (!LlbHwExtendedScanCodeTable[ScanCode]) return 0;
|
||||
*KeyCode = LlbHwExtendedScanCodeTable[ScanCode];
|
||||
|
@ -194,7 +194,7 @@ LlbKbdTranslateScanCode(IN USHORT ScanCode,
|
|||
|
||||
/* E1 extended codes */
|
||||
case 0xE1:
|
||||
|
||||
|
||||
/* Only recognize one (the SYSREQ/PAUSE sequence) */
|
||||
if (ScanCode != 0x1D) return 0;
|
||||
LlbKbdLastScanCode = 0x100;
|
||||
|
@ -202,7 +202,7 @@ LlbKbdTranslateScanCode(IN USHORT ScanCode,
|
|||
|
||||
/* PAUSE sequence */
|
||||
case 0x100:
|
||||
|
||||
|
||||
/* Make sure it's the one */
|
||||
if (ScanCode != 0x45) return 0;
|
||||
*KeyCode = E1_PAUSE;
|
||||
|
@ -219,22 +219,22 @@ LlbKbdTranslateScanCode(IN USHORT ScanCode,
|
|||
/* Translation success */
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
CHAR
|
||||
NTAPI
|
||||
LlbKeyboardGetChar(VOID)
|
||||
{
|
||||
UCHAR ScanCode, KeyCode;
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
/* Read the scan code and convert it to a virtual key code */
|
||||
ScanCode = LlbHwKbdRead();
|
||||
} while (!LlbKbdTranslateScanCode(ScanCode, &KeyCode));
|
||||
|
||||
|
||||
/* Is this ASCII? */
|
||||
if (KeyCode > 96) return ScanCode;
|
||||
|
||||
|
||||
/* Return the ASCII character */
|
||||
return LlbHwScanCodeToAsciiTable[KeyCode][0];
|
||||
}
|
||||
|
|
|
@ -23,18 +23,18 @@ UCHAR KeyMatrix[8][8] =
|
|||
};
|
||||
|
||||
/* FUNCTIONS ******************************************************************/
|
||||
|
||||
|
||||
CHAR
|
||||
NTAPI
|
||||
LlbKeypadGetChar(VOID)
|
||||
{
|
||||
UCHAR ScanCode;
|
||||
UCHAR Col, Row;
|
||||
|
||||
|
||||
ScanCode = LlbHwKbdRead();
|
||||
Col = ScanCode >> 4;
|
||||
Row = ScanCode & 0xF;
|
||||
|
||||
|
||||
/* Return the ASCII character */
|
||||
return KeyMatrix[Col][Row];
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ NTAPI
|
|||
LlbHwGetSerialUart(VOID)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
|
@ -70,7 +70,7 @@ LlbHwGetScreenHeight(VOID)
|
|||
{
|
||||
return 720;
|
||||
}
|
||||
|
||||
|
||||
PVOID
|
||||
NTAPI
|
||||
LlbHwGetFrameBuffer(VOID)
|
||||
|
@ -102,28 +102,28 @@ LlbHwBuildMemoryMap(IN PBIOS_MEMORY_MAP MemoryMap)
|
|||
{
|
||||
PBIOS_MEMORY_MAP MapEntry;
|
||||
ULONG Base, Size, FsBase, FsSize;
|
||||
|
||||
|
||||
/* Parse hardware memory map */
|
||||
MapEntry = LlbHwOmap3MemoryMap;
|
||||
while (MapEntry->Length)
|
||||
{
|
||||
/* Add this entry */
|
||||
LlbAllocateMemoryEntry(MapEntry->Type, MapEntry->BaseAddress, MapEntry->Length);
|
||||
|
||||
|
||||
/* Move to the next one */
|
||||
MapEntry++;
|
||||
}
|
||||
|
||||
|
||||
/* Query memory and RAMDISK information */
|
||||
LlbEnvGetMemoryInformation(&Base, &Size);
|
||||
LlbEnvGetRamDiskInformation(&FsBase, &FsSize);
|
||||
|
||||
|
||||
/* Add-in the size of the ramdisk */
|
||||
Base = FsBase + FsSize;
|
||||
|
||||
|
||||
/* Subtract size of ramdisk and anything else before it */
|
||||
Size -= Base;
|
||||
|
||||
|
||||
/* Allocate an entry for it */
|
||||
LlbAllocateMemoryEntry(BiosMemoryUsable, Base, Size);
|
||||
}
|
||||
|
|
|
@ -41,13 +41,13 @@ LlbHwGetUartBase(IN ULONG Port)
|
|||
}
|
||||
else if (Port == 2)
|
||||
{
|
||||
return 0x4806C000;
|
||||
return 0x4806C000;
|
||||
}
|
||||
else if (Port == 3)
|
||||
{
|
||||
return 0x49020000;
|
||||
return 0x49020000;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,14 +38,14 @@ NTAPI
|
|||
LlbHwGetSerialUart(VOID)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
ULONG
|
||||
LlbHwRtcRead(VOID)
|
||||
{
|
||||
/* Issue the GET_TIME request on the RTC control register */
|
||||
LlbHwOmap3TwlWrite1(0x4B, 0x29, 0x41);
|
||||
|
||||
|
||||
/* Read the BCD registers and convert them */
|
||||
LlbTime.Second = BCD_INT(LlbHwOmap3TwlRead1(0x4B, 0x1C));
|
||||
LlbTime.Minute = BCD_INT(LlbHwOmap3TwlRead1(0x4B, 0x1D));
|
||||
|
|
|
@ -61,18 +61,18 @@ LlbHwBuildMemoryMap(IN PBIOS_MEMORY_MAP MemoryMap)
|
|||
{
|
||||
PBIOS_MEMORY_MAP MapEntry;
|
||||
ULONG Base, Size, FsBase, FsSize;
|
||||
|
||||
|
||||
/* Parse hardware memory map */
|
||||
MapEntry = LlbHwOmap3MemoryMap;
|
||||
while (MapEntry->Length)
|
||||
{
|
||||
/* Add this entry */
|
||||
LlbAllocateMemoryEntry(MapEntry->Type, MapEntry->BaseAddress, MapEntry->Length);
|
||||
|
||||
|
||||
/* Move to the next one */
|
||||
MapEntry++;
|
||||
}
|
||||
|
||||
|
||||
/* Query memory and RAMDISK information */
|
||||
LlbEnvGetMemoryInformation(&Base, &Size);
|
||||
LlbEnvGetRamDiskInformation(&FsBase, &FsSize);
|
||||
|
@ -80,10 +80,10 @@ LlbHwBuildMemoryMap(IN PBIOS_MEMORY_MAP MemoryMap)
|
|||
#ifdef _BEAGLE_
|
||||
/* Add-in the size of the ramdisk */
|
||||
Base = FsBase + FsSize;
|
||||
|
||||
|
||||
/* Subtract size of ramdisk and anything else before it */
|
||||
Size -= Base;
|
||||
|
||||
|
||||
/* Allocate an entry for it */
|
||||
LlbAllocateMemoryEntry(BiosMemoryUsable, Base, Size);
|
||||
#endif
|
||||
|
@ -95,10 +95,10 @@ LlbHwInitialize(VOID)
|
|||
{
|
||||
/* Setup the UART (NS16550) */
|
||||
LlbHwOmap3UartInitialize();
|
||||
|
||||
|
||||
/* Setup the NEC WVGA LCD Panel and the Display Controller */
|
||||
LlbHwOmap3LcdInitialize();
|
||||
|
||||
|
||||
/* Setup the keyboard */
|
||||
LlbHwOmap3SynKpdInitialize();
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ LlbHwOmap3LcdInitialize(VOID)
|
|||
/* Now turn on the functional and interface clocks in the CORE domain */
|
||||
WRITE_REGISTER_ULONG(0x48004a00, 0x03fffe29); /* Functional clocks */
|
||||
WRITE_REGISTER_ULONG(0x48004a10, 0x3ffffffb); /* Interface clocks */
|
||||
|
||||
|
||||
/* The HS I2C interface is now on, configure it */
|
||||
WRITE_REGISTER_USHORT(0x48070024, 0x0); /* Disable I2c */
|
||||
WRITE_REGISTER_USHORT(0x48070030, 0x17); /* Configure clock divider */
|
||||
|
@ -44,7 +44,7 @@ LlbHwOmap3LcdInitialize(VOID)
|
|||
WRITE_REGISTER_USHORT(0x4807000c, 0x636f); /* Select wakeup bits */
|
||||
WRITE_REGISTER_USHORT(0x48070014, 0x4343); /* Disable DMA */
|
||||
WRITE_REGISTER_USHORT(0x48070024, 0x8000); /* Enable I2C */
|
||||
|
||||
|
||||
/*
|
||||
* Set the VPLL2 to cover all device groups instead of just P3.
|
||||
* This essentially enables the VRRTC to power up the LCD panel.
|
||||
|
@ -59,7 +59,7 @@ LlbHwOmap3LcdInitialize(VOID)
|
|||
|
||||
/* Set GPIO pin 7 signal on the TWL4030 ON. This powers the LCD backlight */
|
||||
LlbHwOmap3TwlWrite1(0x49, 0xA4, 0x80);
|
||||
|
||||
|
||||
/* Now go on the McSPI interface and program it on for the channel */
|
||||
WRITE_REGISTER_ULONG(0x48098010, 0x15);
|
||||
WRITE_REGISTER_ULONG(0x48098020, 0x1);
|
||||
|
@ -77,7 +77,7 @@ LlbHwOmap3LcdInitialize(VOID)
|
|||
|
||||
/* Reset the Display Controller (DISPC) */
|
||||
WRITE_REGISTER_ULONG(0x48050410, 0x00000005); // DISPC_SYSCONFIG
|
||||
|
||||
|
||||
/* Set the frame buffer address */
|
||||
WRITE_REGISTER_ULONG(0x48050480, 0x800A0000); // DISPC_GFX_BA0
|
||||
|
||||
|
@ -102,7 +102,7 @@ LlbHwGetScreenWidth(VOID)
|
|||
{
|
||||
return 800;
|
||||
}
|
||||
|
||||
|
||||
ULONG
|
||||
NTAPI
|
||||
LlbHwGetScreenHeight(VOID)
|
||||
|
|
|
@ -19,13 +19,13 @@ LlbHwOmap3SynKpdInitialize(VOID)
|
|||
|
||||
/* Set GPIO pin 8 signal on the TWL4030 ON. This powers the keypad backlight */
|
||||
LlbHwOmap3TwlWrite1(0x49, 0xA4, 0xC0);
|
||||
|
||||
|
||||
/* Set PENDDIS and COR on the the keypad interrupt controller */
|
||||
LlbHwOmap3TwlWrite1(0x4A, 0xE9, 0x06);
|
||||
|
||||
/* Only falling edge detection for key pressed */
|
||||
LlbHwOmap3TwlWrite1(0x4A, 0xE8, 0x01);
|
||||
|
||||
|
||||
/* Unmask key-pressed events */
|
||||
LlbHwOmap3TwlWrite1(0x4A, 0xE4, 0x0E);
|
||||
|
||||
|
@ -46,10 +46,10 @@ LlbHwKbdReady(VOID)
|
|||
|
||||
Value = LlbHwOmap3TwlRead1(0x4A, 0xE3);
|
||||
if (!Value) return FALSE;
|
||||
|
||||
|
||||
LastState ^= 1;
|
||||
if (!LastState) return FALSE;
|
||||
|
||||
|
||||
/* Return whether or not an interrupt is pending */
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ NTAPI
|
|||
LlbHwKbdRead(VOID)
|
||||
{
|
||||
UCHAR ActiveCol = 0, ActiveRow = 0, col, coldata, row;
|
||||
|
||||
|
||||
for (col = 0; col < 8; col++)
|
||||
{
|
||||
coldata = LlbHwOmap3TwlRead1(0x4A, 0xDB + col);
|
||||
|
@ -76,7 +76,7 @@ LlbHwKbdRead(VOID)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return ((ActiveCol << 4) | ActiveRow);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ LlbHwOmap3TwlRead1(IN UCHAR ChipAddress,
|
|||
IN UCHAR RegisterAddress)
|
||||
{
|
||||
volatile int i = 1000;
|
||||
|
||||
|
||||
/* Select the register */
|
||||
LlbHwOmap3TwlWrite(ChipAddress, RegisterAddress, 0, NULL);
|
||||
|
||||
|
@ -43,7 +43,7 @@ LlbHwOmap3TwlWrite(IN UCHAR ChipAddress,
|
|||
/* Enable master transmit mode */
|
||||
WRITE_REGISTER_USHORT(0x48070024, 0x8601);
|
||||
WRITE_REGISTER_USHORT(0x4807001c, RegisterAddress);
|
||||
|
||||
|
||||
/* Loop each byte */
|
||||
for (j = 0; j < Length; j++)
|
||||
{
|
||||
|
|
|
@ -55,7 +55,7 @@ LlbHwGetUartBase(IN ULONG Port)
|
|||
{
|
||||
return 0x10000000;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,10 +14,10 @@ LlbSerialPutChar(IN CHAR c)
|
|||
{
|
||||
/* Properly support new-lines */
|
||||
if (c == '\n') LlbSerialPutChar('\r');
|
||||
|
||||
|
||||
/* Wait for ready */
|
||||
while (!LlbHwUartTxReady());
|
||||
|
||||
|
||||
/* Send character */
|
||||
LlbHwUartSendChar(c);
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ LlbConvertRtcTime(IN ULONG RtcTime,
|
|||
|
||||
/* Get the year, based on days since 1970 */
|
||||
Year = 1970 + Days / 365;
|
||||
|
||||
|
||||
/* Account for leap years which changed the number of days/year */
|
||||
Days -= (Year - 1970) * 365 + LEAPS_THRU_END_OF(Year - 1) - LEAPS_THRU_END_OF(1970 - 1);
|
||||
if (Days < 0)
|
||||
|
@ -64,8 +64,8 @@ LlbConvertRtcTime(IN ULONG RtcTime,
|
|||
/* How many days in this month? */
|
||||
DaysLeft = Days - LlbDayOfMonth(Month, Year);
|
||||
if (DaysLeft < 0) break;
|
||||
|
||||
/* How many days left total? */
|
||||
|
||||
/* How many days left total? */
|
||||
Days = DaysLeft;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,11 +31,11 @@ LlbHwVersaClcdInitialize(VOID)
|
|||
/* Set framebuffer address */
|
||||
WRITE_REGISTER_ULONG(PL110_LCDUPBASE, (ULONG)LlbHwGetFrameBuffer());
|
||||
WRITE_REGISTER_ULONG(PL110_LCDLPBASE, (ULONG)LlbHwGetFrameBuffer());
|
||||
|
||||
|
||||
/* Initialize timings to 720x400 */
|
||||
WRITE_REGISTER_ULONG(PL110_LCDTIMING0, LCDTIMING0_PPL(LlbHwGetScreenWidth()));
|
||||
WRITE_REGISTER_ULONG(PL110_LCDTIMING1, LCDTIMING1_LPP(LlbHwGetScreenHeight()));
|
||||
|
||||
|
||||
/* Enable the TFT/LCD Display */
|
||||
WRITE_REGISTER_ULONG(PL110_LCDCONTROL,
|
||||
LCDCONTROL_LCDEN |
|
||||
|
@ -50,7 +50,7 @@ LlbHwGetScreenWidth(VOID)
|
|||
{
|
||||
return 720;
|
||||
}
|
||||
|
||||
|
||||
ULONG
|
||||
NTAPI
|
||||
LlbHwGetScreenHeight(VOID)
|
||||
|
|
|
@ -74,28 +74,28 @@ LlbHwBuildMemoryMap(IN PBIOS_MEMORY_MAP MemoryMap)
|
|||
{
|
||||
PBIOS_MEMORY_MAP MapEntry;
|
||||
ULONG Base, Size, FsBase, FsSize;
|
||||
|
||||
|
||||
/* Parse hardware memory map */
|
||||
MapEntry = LlbHwVersaMemoryMap;
|
||||
while (MapEntry->Length)
|
||||
{
|
||||
/* Add this entry */
|
||||
LlbAllocateMemoryEntry(MapEntry->Type, MapEntry->BaseAddress, MapEntry->Length);
|
||||
|
||||
|
||||
/* Move to the next one */
|
||||
MapEntry++;
|
||||
}
|
||||
|
||||
|
||||
/* Query memory and RAMDISK information */
|
||||
LlbEnvGetMemoryInformation(&Base, &Size);
|
||||
LlbEnvGetRamDiskInformation(&FsBase, &FsSize);
|
||||
|
||||
|
||||
/* Add-in the size of the ramdisk */
|
||||
Base = FsBase + FsSize;
|
||||
|
||||
|
||||
/* Subtract size of ramdisk and anything else before it */
|
||||
Size -= Base;
|
||||
|
||||
|
||||
/* Allocate an entry for it */
|
||||
LlbAllocateMemoryEntry(BiosMemoryUsable, Base, Size);
|
||||
}
|
||||
|
|
|
@ -14,10 +14,10 @@ LlbHwInitialize(VOID)
|
|||
{
|
||||
/* Setup the CLCD (PL110) */
|
||||
LlbHwVersaClcdInitialize();
|
||||
|
||||
|
||||
/* Setup the UART (PL011) */
|
||||
LlbHwVersaUartInitialize();
|
||||
|
||||
|
||||
/* Setup the KMI (PL050) */
|
||||
LlbHwVersaKmiInitialize();
|
||||
}
|
||||
|
@ -32,20 +32,20 @@ LlbHwLoadOsLoaderFromRam(VOID)
|
|||
ULONG Base, RootFs, Size;
|
||||
PCHAR Offset;
|
||||
CHAR CommandLine[64];
|
||||
|
||||
|
||||
/* On versatile we load the RAMDISK with initrd */
|
||||
LlbEnvGetRamDiskInformation(&RootFs, &Size);
|
||||
|
||||
|
||||
/* The OS Loader is at 0x20000, always */
|
||||
Base = 0x20000;
|
||||
|
||||
|
||||
/* Read image offset */
|
||||
Offset = LlbEnvRead("rdoffset");
|
||||
|
||||
|
||||
/* Set parameters for the OS loader */
|
||||
sprintf(CommandLine, "rdbase=0x%x rdsize=0x%x rdoffset=%s", RootFs, Size, Offset);
|
||||
LlbSetCommandLine(CommandLine);
|
||||
|
||||
|
||||
/* Return the OS loader base address */
|
||||
return (POSLOADER_INIT)Base;
|
||||
}
|
||||
|
|
|
@ -64,13 +64,13 @@ NTAPI
|
|||
LlbHwVersaKmiSendAndWait(IN ULONG Value)
|
||||
{
|
||||
volatile int i = 1000;
|
||||
|
||||
|
||||
/* Send the value */
|
||||
LlbHwKbdSend(Value);
|
||||
|
||||
|
||||
/* Wait a bit */
|
||||
while (--i);
|
||||
|
||||
|
||||
/* Now make sure we received an ACK */
|
||||
if (LlbHwKbdRead() != PS2_I_ACK) DbgPrint("PS/2 FAILURE!\n");
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ NTAPI
|
|||
LlbHwVersaKmiInitialize(VOID)
|
||||
{
|
||||
UCHAR Divisor;
|
||||
|
||||
|
||||
/* Setup divisor and enable KMI */
|
||||
Divisor = (LlbHwGetPClk() / 8000000) - 1;
|
||||
WRITE_REGISTER_UCHAR(PL050_KMICLKDIV, Divisor);
|
||||
|
@ -104,13 +104,13 @@ LlbHwKbdSend(IN ULONG Value)
|
|||
{
|
||||
ULONG Status;
|
||||
|
||||
/* Wait for ready signal */
|
||||
/* Wait for ready signal */
|
||||
do
|
||||
{
|
||||
/* Read TX buffer state */
|
||||
Status = READ_REGISTER_UCHAR(PL050_KMISTAT);
|
||||
} while (!(Status & KMISTAT_TXEMPTY));
|
||||
|
||||
|
||||
/* Send value */
|
||||
WRITE_REGISTER_UCHAR(PL050_KMIDATA, Value);
|
||||
}
|
||||
|
|
|
@ -53,26 +53,26 @@ LlbHwVersaUartInitialize(VOID)
|
|||
/* Query peripheral rate, hardcore baudrate */
|
||||
ClockRate = LlbHwGetPClk();
|
||||
Baudrate = 115200;
|
||||
|
||||
|
||||
/* Calculate baudrate clock divider and remainder */
|
||||
Divider = ClockRate / (16 * Baudrate);
|
||||
Remainder = ClockRate % (16 * Baudrate);
|
||||
|
||||
|
||||
/* Calculate the fractional part */
|
||||
Fraction = (8 * Remainder / Baudrate) >> 1;
|
||||
Fraction += (8 * Remainder / Baudrate) & 1;
|
||||
|
||||
|
||||
/* Disable interrupts */
|
||||
WRITE_REGISTER_ULONG(UART_PL011_CR, 0);
|
||||
|
||||
|
||||
/* Set the baud rate to 115200 bps */
|
||||
WRITE_REGISTER_ULONG(UART_PL011_IBRD, Divider);
|
||||
WRITE_REGISTER_ULONG(UART_PL011_FBRD, Fraction);
|
||||
|
||||
|
||||
/* Set 8 bits for data, 1 stop bit, no parity, FIFO enabled */
|
||||
WRITE_REGISTER_ULONG(UART_PL011_LCRH,
|
||||
UART_PL011_LCRH_WLEN_8 | UART_PL011_LCRH_FEN);
|
||||
|
||||
|
||||
/* Clear and enable FIFO */
|
||||
WRITE_REGISTER_ULONG(UART_PL011_CR,
|
||||
UART_PL011_CR_UARTEN |
|
||||
|
@ -106,9 +106,9 @@ LlbHwGetUartBase(IN ULONG Port)
|
|||
}
|
||||
else if (Port == 1)
|
||||
{
|
||||
return 0x101F2000;
|
||||
return 0x101F2000;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -299,7 +299,7 @@ LlbVideoDrawChar(IN UCHAR c,
|
|||
Buffer[x] = (Line & 1) ? Color : BackColor;
|
||||
Line >>= 1;
|
||||
}
|
||||
|
||||
|
||||
/* Next line */
|
||||
Buffer += ScreenWidth;
|
||||
}
|
||||
|
@ -312,11 +312,11 @@ LlbVideoClearScreen(IN BOOLEAN OsLoader)
|
|||
ULONG ScreenSize, p;
|
||||
ULONG BackColor;
|
||||
PUSHORT VideoBuffer;
|
||||
|
||||
|
||||
/* Get frame buffer and reset cursor position */
|
||||
VideoBuffer = LlbHwGetFrameBuffer();
|
||||
ScreenCursor = 0;
|
||||
|
||||
|
||||
/* Backcolor on this machine */
|
||||
if (OsLoader)
|
||||
{
|
||||
|
@ -333,10 +333,10 @@ LlbVideoClearScreen(IN BOOLEAN OsLoader)
|
|||
#endif
|
||||
BackColor = (BackColor << 16) | BackColor;
|
||||
}
|
||||
|
||||
|
||||
/* Screen size on this machine */
|
||||
ScreenSize = LlbHwGetScreenWidth() * LlbHwGetScreenHeight();
|
||||
|
||||
|
||||
/* Clear the screen with the given color */
|
||||
for (p = 0; p < ScreenSize * 2; p += 4)
|
||||
{
|
||||
|
@ -349,14 +349,14 @@ NTAPI
|
|||
LlbVideoPutChar(IN UCHAR c)
|
||||
{
|
||||
ULONG cx, cy, CharsPerLine, BackColor, ScreenWidth;
|
||||
|
||||
|
||||
/* Backcolor on this machine */
|
||||
#ifdef BLUE_SCREEN
|
||||
BackColor = LlbHwVideoCreateColor(14, 0, 82);
|
||||
#else
|
||||
BackColor = LlbHwVideoCreateColor(0, 0, 0);
|
||||
#endif
|
||||
|
||||
|
||||
/* Amount of characters in a line */
|
||||
ScreenWidth = LlbHwGetScreenWidth();
|
||||
CharsPerLine = ScreenWidth / 8;
|
||||
|
@ -366,7 +366,7 @@ LlbVideoPutChar(IN UCHAR c)
|
|||
{
|
||||
/* Move a line down */
|
||||
ScreenCursor += CharsPerLine - (ScreenCursor % CharsPerLine);
|
||||
|
||||
|
||||
/* FIXME: Scrolling */
|
||||
}
|
||||
else
|
||||
|
|
|
@ -69,7 +69,7 @@ VOID
|
|||
LlbFwVideoClearScreen(
|
||||
IN UCHAR Attr
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
LlbFwVideoPutChar(
|
||||
IN INT c,
|
||||
|
|
|
@ -17,7 +17,7 @@ NTAPI
|
|||
LlbHwGetScreenWidth(
|
||||
VOID
|
||||
);
|
||||
|
||||
|
||||
ULONG
|
||||
NTAPI
|
||||
LlbHwGetScreenHeight(
|
||||
|
@ -55,7 +55,7 @@ NTAPI
|
|||
LlbHwGetTmr0Base(
|
||||
VOID
|
||||
);
|
||||
|
||||
|
||||
ULONG
|
||||
NTAPI
|
||||
LlbHwGetUartBase(
|
||||
|
@ -67,7 +67,7 @@ NTAPI
|
|||
LlbHwGetSerialUart(
|
||||
VOID
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
LlbHwUartSendChar(
|
||||
|
|
|
@ -26,5 +26,5 @@ LlbVideoDrawChar(
|
|||
IN USHORT Color,
|
||||
IN USHORT BackColor
|
||||
);
|
||||
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -21,13 +21,13 @@ LlbStartup(IN ULONG Reserved,
|
|||
|
||||
/* Either QEMU or U-Boot itself should send this information */
|
||||
LlbEnvParseArguments(Arguments);
|
||||
|
||||
|
||||
/* Clean up the screen */
|
||||
LlbVideoClearScreen(FALSE);
|
||||
|
||||
/* Print header */
|
||||
printf("\nReactOS ARM Low-Level Boot Loader [" __DATE__ " "__TIME__ "]\n");
|
||||
|
||||
|
||||
/* Boot the OS Loader */
|
||||
LlbBoot();
|
||||
while (TRUE);
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
BIOS_MEMORY_MAP MemoryMap[32];
|
||||
ARM_BOARD_CONFIGURATION_BLOCK ArmBlock;
|
||||
POSLOADER_INIT LoaderInit;
|
||||
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
LlbAllocateMemoryEntry(IN BIOS_MEMORY_TYPE Type,
|
||||
|
@ -19,16 +19,16 @@ LlbAllocateMemoryEntry(IN BIOS_MEMORY_TYPE Type,
|
|||
IN ULONG Length)
|
||||
{
|
||||
PBIOS_MEMORY_MAP Entry;
|
||||
|
||||
|
||||
/* Get the next memory entry */
|
||||
Entry = MemoryMap;
|
||||
while (Entry->Length) Entry++;
|
||||
|
||||
|
||||
/* Fill it out */
|
||||
Entry->Length = Length;
|
||||
Entry->BaseAddress = BaseAddress;
|
||||
Entry->Type = Type;
|
||||
|
||||
|
||||
/* Block count */
|
||||
ArmBlock.MemoryMapEntryCount++;
|
||||
}
|
||||
|
@ -48,27 +48,27 @@ LlbBuildArmBlock(VOID)
|
|||
/* Write version number */
|
||||
ArmBlock.MajorVersion = ARM_BOARD_CONFIGURATION_MAJOR_VERSION;
|
||||
ArmBlock.MinorVersion = ARM_BOARD_CONFIGURATION_MINOR_VERSION;
|
||||
|
||||
|
||||
/* Get arch type */
|
||||
ArmBlock.BoardType = LlbHwGetBoardType();
|
||||
|
||||
|
||||
/* Get peripheral clock rate */
|
||||
ArmBlock.ClockRate = LlbHwGetPClk();
|
||||
|
||||
|
||||
/* Get timer and serial port base addresses */
|
||||
ArmBlock.TimerRegisterBase = LlbHwGetTmr0Base();
|
||||
ArmBlock.UartRegisterBase = LlbHwGetUartBase(LlbHwGetSerialUart());
|
||||
|
||||
|
||||
/* Debug */
|
||||
DbgPrint("Machine Identifier: %lx\nPCLK: %d\nTIMER 0: %p\nSERIAL UART: %p\n",
|
||||
ArmBlock.BoardType,
|
||||
ArmBlock.ClockRate,
|
||||
ArmBlock.TimerRegisterBase,
|
||||
ArmBlock.UartRegisterBase);
|
||||
|
||||
|
||||
/* Now load the memory map */
|
||||
ArmBlock.MemoryMap = MemoryMap;
|
||||
|
||||
|
||||
/* Write firmware callbacks */
|
||||
ArmBlock.ConsPutChar = LlbFwPutChar;
|
||||
ArmBlock.ConsKbHit = LlbFwKbHit;
|
||||
|
@ -101,24 +101,24 @@ LlbHwLoadOsLoaderFromRam(VOID)
|
|||
ULONG Base, RootFs, Size;
|
||||
PCHAR Offset;
|
||||
CHAR CommandLine[64];
|
||||
|
||||
|
||||
/* On versatile we load the RAMDISK with initrd */
|
||||
LlbEnvGetRamDiskInformation(&RootFs, &Size);
|
||||
DbgPrint("Root fs: %lx, size: %lx\n", RootFs, Size);
|
||||
|
||||
|
||||
/* The OS Loader is at 0x20000, always */
|
||||
Base = 0x20000;
|
||||
|
||||
|
||||
/* Read image offset */
|
||||
Offset = LlbEnvRead("rdoffset");
|
||||
|
||||
|
||||
/* Set parameters for the OS loader */
|
||||
snprintf(CommandLine,
|
||||
sizeof(CommandLine),
|
||||
"rdbase=0x%lx rdsize=0x%lx rdoffset=%s",
|
||||
RootFs, Size, Offset);
|
||||
LlbSetCommandLine(CommandLine);
|
||||
|
||||
|
||||
/* Return the OS loader base address */
|
||||
return (POSLOADER_INIT)Base;
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ NTAPI
|
|||
LlbLoadOsLoader(VOID)
|
||||
{
|
||||
PCHAR BootDevice;
|
||||
|
||||
|
||||
/* Read the current boot device */
|
||||
BootDevice = LlbEnvRead("boot-device");
|
||||
printf("Loading OS Loader from: %s...\n", BootDevice);
|
||||
|
@ -150,7 +150,7 @@ LlbLoadOsLoader(VOID)
|
|||
{
|
||||
//todo
|
||||
}
|
||||
|
||||
|
||||
LoaderInit = (PVOID)0x80000000;
|
||||
#ifdef _ZOOM2_ // need something better than this...
|
||||
LoaderInit = (PVOID)0x81070000;
|
||||
|
@ -164,10 +164,10 @@ LlbBoot(VOID)
|
|||
{
|
||||
/* Setup the ARM block */
|
||||
LlbBuildArmBlock();
|
||||
|
||||
|
||||
/* Build the memory map */
|
||||
LlbBuildMemoryMap();
|
||||
|
||||
|
||||
/* Load the OS loader */
|
||||
LlbLoadOsLoader();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue