diff --git a/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c b/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c index a6aa4ab1326..6d8f07dceb6 100644 --- a/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c +++ b/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c @@ -476,6 +476,8 @@ VOID PpcRTCGetCurrentDateTime( PULONG Hear, PULONG Month, PULONG Day, VOID PpcHwDetect() { printf("PpcHwDetect\n"); + /* Almost all PowerPC boxen use PCI */ + BootInfo.machineType = PCIBus; } BOOLEAN PpcDiskNormalizeSystemPath(char *SystemPath, unsigned Size) { diff --git a/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c b/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c index ebac599db53..0fa2f9929b5 100644 --- a/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c +++ b/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c @@ -184,6 +184,11 @@ FrLdrStartup(ULONG Magic) LdrPEFixupImports ((PVOID)reactos_modules[i].ModStart, (PCHAR)reactos_modules[i].String); + else /* Make RVA */ + { + reactos_modules[i].ModStart -= (ULONG_PTR)KernelMemory; + reactos_modules[i].ModEnd -= (ULONG_PTR)KernelMemory; + } } /* We don't use long longs, but longs for the addresses in the @@ -680,6 +685,7 @@ FrLdrLoadModule(FILE *ModuleImage, } while(TempName); NameBuffer = reactos_module_strings[LoaderBlock.ModsCount]; + /* Get Module Size */ LocalModuleSize = FsGetFileSize(ModuleImage); @@ -723,8 +729,9 @@ FrLdrMapImage(IN FILE *Image, IN PCHAR ShortName, IN ULONG ImageType) else { PVOID ModuleBase = (PVOID)NextModuleBase; + if(FrLdrMapModule(Image, ShortName, 0, 0)) - Result = ModuleBase; + Result = ModuleBase; } return Result; } diff --git a/reactos/boot/freeldr/freeldr/arch/powerpc/prep.c b/reactos/boot/freeldr/freeldr/arch/powerpc/prep.c index 0a25d5bcd58..33a8c86f960 100644 --- a/reactos/boot/freeldr/freeldr/arch/powerpc/prep.c +++ b/reactos/boot/freeldr/freeldr/arch/powerpc/prep.c @@ -1,8 +1,10 @@ #include "freeldr.h" #include "machine.h" +#include "ppcboot.h" #include "ppcmmu/mmu.h" #include "prep.h" +extern boot_infos_t BootInfo; int prep_serial = 0x800003f8; void sync() { __asm__("eieio\n\tsync"); } @@ -63,6 +65,8 @@ void PpcPrepVideoGetDisplaySize( PULONG Width, PULONG Height, PULONG Depth ) void PpcPrepVideoPrepareForReactOS(BOOLEAN setup) { + /* Prep boxen are PCI */ + BootInfo.machineType = PCIBus; pci_setup(&pci1_desc); } diff --git a/reactos/include/reactos/arc/arc.h b/reactos/include/reactos/arc/arc.h index 43ccdc0e042..0aba0b6761b 100644 --- a/reactos/include/reactos/arc/arc.h +++ b/reactos/include/reactos/arc/arc.h @@ -342,6 +342,7 @@ typedef struct _I386_LOADER_BLOCK typedef struct _PPC_LOADER_BLOCK { PVOID BootInfo; + ULONG MachineType; } PPC_LOADER_BLOCK, *PPPC_LOADER_BLOCK; // diff --git a/reactos/include/reactos/ppcboot.h b/reactos/include/reactos/ppcboot.h index 8dc39c24bf8..c28ed643ab1 100644 --- a/reactos/include/reactos/ppcboot.h +++ b/reactos/include/reactos/ppcboot.h @@ -4,6 +4,7 @@ typedef char font_char[57]; typedef struct _boot_infos_t { void *loaderBlock; + int machineType; int dispDeviceRect[4]; int dispDeviceRowBytes; int dispDeviceDepth;