Author: ros-arm-bringup
Date: Fri Feb 15 10:45:37 2008
New Revision: 32376
URL:
http://svn.reactos.org/svn/reactos?rev=32376&view=rev
Log:
We now setup NLS data in the loader block, as well as setup the minimal loader block
extension fields to pass ExpIsLoaderValid validation.
Modified:
trunk/reactos/boot/freeldr/freeldr/arch/arm/loader.c
trunk/reactos/boot/freeldr/freeldr/reactos/imageldr.c
Modified: trunk/reactos/boot/freeldr/freeldr/arch/arm/loader.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/arm/loader.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/arm/loader.c Fri Feb 15 10:45:37 2008
@@ -22,11 +22,13 @@
CHAR ArmArcHalPath[64];
CHAR ArmNtHalPath[64];
CHAR ArmNtBootPath[64];
+PNLS_DATA_BLOCK ArmNlsDataBlock;
PLOADER_PARAMETER_EXTENSION ArmExtension;
extern ARM_TRANSLATION_TABLE ArmTranslationTable;
extern ARM_COARSE_PAGE_TABLE BootTranslationTable, KernelTranslationTable;
extern ROS_KERNEL_ENTRY_POINT KernelEntryPoint;
extern ULONG_PTR KernelBase;
+extern ULONG_PTR AnsiData, OemData, UnicodeData;
ULONG SizeBits[] =
{
@@ -142,8 +144,6 @@
// Now create the template PTE for the coarse page tables for the next 6MB
//
Pte.L1.Coarse.BaseAddress = (ULONG)KernelTable >> CPT_SHIFT;
- TuiPrintf("Coarse Table at: %x\n", KernelTable);
- TuiPrintf("Coarse Table at: %x\n", Pte.L1.Coarse.BaseAddress);
//
// Map 0x00800000 - 0x00DFFFFF to 0x80800000 - 0x80DFFFFF
@@ -200,7 +200,6 @@
// Now create the template PTE for the pages mapping the next 6MB
//
Pte.L2.Small.BaseAddress = (ULONG)KERNEL_BASE_PHYS >> PTE_SHIFT;
- TuiPrintf("First Kernel PFN at: %x\n", Pte.L2.Small.BaseAddress);
//
// Loop each kernel coarse page table (i).
@@ -225,7 +224,6 @@
// Next iteration
//
KernelTable++;
- TuiPrintf("Coarse Table at: %x\n", KernelTable);
}
}
@@ -300,16 +298,26 @@
//
//
- // TODO: Setup NLS data
- //
+ // Setup NLS data
+ //
+ ArmNlsDataBlock = MmAllocateMemoryWithType(sizeof(NLS_DATA_BLOCK),
+ LoaderOsloaderHeap);
+ ArmLoaderBlock->NlsData = ArmNlsDataBlock;
+ ArmLoaderBlock->NlsData->AnsiCodePageData = (PVOID)(AnsiData | KSEG0_BASE);
+ ArmLoaderBlock->NlsData->OemCodePageData = (PVOID)(OemData | KSEG0_BASE);
+ ArmLoaderBlock->NlsData->UnicodeCodePageData = (PVOID)(UnicodeData |
KSEG0_BASE);
+ ArmLoaderBlock->NlsData = (PVOID)((ULONG_PTR)ArmLoaderBlock->NlsData |
KSEG0_BASE);
//
// TODO: Setup boot-driver data
//
//
- // TODO: Setup extension parameters
- //
+ // Setup extension parameters
+ //
+ ArmExtension->Size = sizeof(LOADER_PARAMETER_EXTENSION);
+ ArmExtension->MajorVersion = 5;
+ ArmExtension->MinorVersion = 2;
//
// Make a copy of the command line
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/imageldr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/reactos/imageldr.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/reactos/imageldr.c Fri Feb 15 10:45:37 2008
@@ -16,7 +16,7 @@
);
extern BOOLEAN FrLdrLoadDriver(PCHAR szFileName, INT nPos);
-
+PVOID AnsiData, OemData, UnicodeData;
/* MODULE MANAGEMENT **********************************************************/
PLOADER_MODULE
@@ -97,6 +97,20 @@
strcpy(NameBuffer, ModuleName);
ModuleData->String = (ULONG_PTR)NameBuffer;
+ /* NLS detection for NT Loader Block */
+ if (!_stricmp(NameBuffer, "ansi.nls"))
+ {
+ AnsiData = (PVOID)NextModuleBase;
+ }
+ else if (!_stricmp(NameBuffer, "oem.nls"))
+ {
+ OemData = (PVOID)NextModuleBase;
+ }
+ else if (!_stricmp(NameBuffer, "casemap.nls"))
+ {
+ UnicodeData = (PVOID)NextModuleBase;
+ }
+
/* Load the file image */
FsReadFile(ModuleImage, LocalModuleSize, NULL, (PVOID)NextModuleBase);