diff --git a/reactos/boot/armllb/envir.c b/reactos/boot/armllb/envir.c index 47ff8885a81..514776f87cb 100644 --- a/reactos/boot/armllb/envir.c +++ b/reactos/boot/armllb/envir.c @@ -14,7 +14,8 @@ ULONG LlbEnvHwMemSize; ULONG LlbEnvRamDiskStart; ULONG LlbEnvRamDiskSize; CHAR LlbEnvCmdLine[256]; - +CHAR LlbValueData[32]; + VOID NTAPI LlbEnvParseArguments(IN PATAG Arguments) @@ -105,14 +106,35 @@ PCHAR NTAPI LlbEnvRead(IN PCHAR ValueName) { - PCHAR ValueData; + PCHAR ValuePointer; + ULONG Length = 0; /* Search for the value name */ - ValueData = strstr(LlbEnvCmdLine, ValueName); - if (ValueData) ValueData += strlen(ValueName) + 1; + ValuePointer = strstr(LlbEnvCmdLine, ValueName); + if (ValuePointer) + { + /* Get the value data and its length */ + ValuePointer += strlen(ValueName) + 1; + if (strchr(ValuePointer, ',')) + { + /* Stop before next parameter */ + Length = strchr(ValuePointer, ',') - ValuePointer; + } + else + { + /* Stop before the string ends */ + Length = strlen(ValuePointer); + } + + /* Copy it */ + strncpy(LlbValueData, ValuePointer, Length); + } + + /* Terminate the data */ + LlbValueData[Length] = ANSI_NULL; /* Return the data */ - return ValueData; + return LlbValueData; } /* EOF */ diff --git a/reactos/boot/armllb/hw/versatile/hwinit.c b/reactos/boot/armllb/hw/versatile/hwinit.c index e532b58bda3..e46d95677ee 100755 --- a/reactos/boot/armllb/hw/versatile/hwinit.c +++ b/reactos/boot/armllb/hw/versatile/hwinit.c @@ -30,6 +30,7 @@ NTAPI LlbHwLoadOsLoaderFromRam(VOID) { ULONG Base, RootFs, Size; + PCHAR Offset; CHAR CommandLine[64]; /* On versatile, the NAND image is loaded as the RAMDISK */ @@ -40,9 +41,12 @@ LlbHwLoadOsLoaderFromRam(VOID) /* The OS loader is next, followed by the root file system */ RootFs = Base + 0x80000; // 512 KB (see nandflash) - + + /* Read image offset */ + Offset = LlbEnvRead("rdoffset"); + /* Set parameters for the OS loader */ - sprintf(CommandLine, "rdbase=0x%x rdsize=0x%x rdoffset=%d", RootFs, Size, 32256); + sprintf(CommandLine, "rdbase=0x%x rdsize=0x%x rdoffset=%s", RootFs, Size, Offset); LlbSetCommandLine(CommandLine); /* Return the OS loader base address */ diff --git a/reactos/boot/armllb/hw/video.c b/reactos/boot/armllb/hw/video.c index e07b41804bb..7710645320c 100644 --- a/reactos/boot/armllb/hw/video.c +++ b/reactos/boot/armllb/hw/video.c @@ -351,7 +351,7 @@ LlbVideoPutChar(IN CHAR c) /* Amount of characters in a line */ ScreenWidth = LlbHwGetScreenWidth(); - CharsPerLine = ScreenWidth / FONT_HEIGHT; + CharsPerLine = ScreenWidth / 8; /* Handle new line and scrolling */ if (c == '\n')