diff --git a/reactos/boot/freeldr/freeldr/CMakeLists.txt b/reactos/boot/freeldr/freeldr/CMakeLists.txt index 5dfa2951124..3a219e2443c 100644 --- a/reactos/boot/freeldr/freeldr/CMakeLists.txt +++ b/reactos/boot/freeldr/freeldr/CMakeLists.txt @@ -91,7 +91,6 @@ if(ARCH STREQUAL "i386") fs/pxe.c arch/i386/archmach.c arch/i386/drivemap.c - arch/i386/halstub.c arch/i386/hardware.c arch/i386/hwacpi.c arch/i386/hwapm.c @@ -103,7 +102,6 @@ if(ARCH STREQUAL "i386") arch/i386/i386rtl.c arch/i386/i386vid.c arch/i386/machpc.c - arch/i386/ntoskrnl.c arch/i386/pccons.c arch/i386/pcdisk.c arch/i386/pcmem.c @@ -118,7 +116,9 @@ if(ARCH STREQUAL "i386") arch/i386/xboxmem.c arch/i386/xboxrtc.c arch/i386/xboxvideo.c - arch/i386/winldr.c + windows/arch/i386/halstub.c + windows/arch/i386/ntoskrnl.c + windows/arch/i386/winldr.c windows/headless.c disk/scsiport.c) if(NOT MSVC) @@ -142,19 +142,20 @@ elseif(ARCH STREQUAL "amd64") arch/i386/i386disk.c arch/i386/i386vid.c arch/i386/machpc.c - arch/i386/ntoskrnl.c arch/i386/pccons.c arch/i386/pcdisk.c arch/i386/pcmem.c arch/i386/pcrtc.c arch/i386/pcvideo.c - arch/amd64/winldr.c) + windows/arch/i386/ntoskrnl.c + windows/arch/amd64/winldr.c) elseif(ARCH STREQUAL "arm") list(APPEND FREELDR_COMMON_ASM_SOURCE arch/arm/boot.S) list(APPEND FREELDR_COMMON_SOURCE + arch/arm/entry.c arch/arm/macharm.c - arch/arm/winldr.c) + windows/arch/arm/winldr.c) else() #TBD endif() @@ -193,7 +194,7 @@ if(MSVC) add_target_link_flags(freeldr_pe "/ignore:4078 /ignore:4254 /DRIVER") add_target_link_flags(freeldr_pe_dbg "/ignore:4078 /ignore:4254 /DRIVER") else() - add_target_link_flags(freeldr_pe "/ignore:4078 /ignore:4254 /DRIVER /FIXED /ALIGN:0x400 /SECTION:.text,ERW /SECTION:.data,RW /MERGE:.text16=.text /MERGE:.data=.text /MERGE:.rdata=.text /MERGE:.bss=.text ") + add_target_link_flags(freeldr_pe "/ignore:4078 /ignore:4254 /DRIVER /FIXED /ALIGN:0x400 /SECTION:.text,ERW /SECTION:.data,RW /MERGE:.text16=.text /MERGE:.data=.text /MERGE:.rdata=.text /MERGE:.bss=.text") add_target_link_flags(freeldr_pe_dbg "/ignore:4078 /ignore:4254 /DRIVER /FIXED /ALIGN:0x400 /SECTION:.text,ERW /SECTION:.data,RW /MERGE:.text16=.text /MERGE:.data=.text /MERGE:.rdata=.text /MERGE:.bss=.text") endif() else() diff --git a/reactos/boot/freeldr/freeldr/arch/arm/entry.c b/reactos/boot/freeldr/freeldr/arch/arm/entry.c new file mode 100644 index 00000000000..4f5a015e4f8 --- /dev/null +++ b/reactos/boot/freeldr/freeldr/arch/arm/entry.c @@ -0,0 +1,31 @@ +/* + * PROJECT: ReactOS Boot Loader + * LICENSE: BSD - See COPYING.ARM in the top level directory + * FILE: boot/freeldr/freeldr/arch/arm/entry.c + * PURPOSE: Implements the entry point for ARM machines (see also boot.S) + * PROGRAMMERS: ReactOS Portable Systems Group + */ + +/* INCLUDES ***************************************************************/ + +#include +#include + +/* FUNCTIONS **************************************************************/ + +VOID +RealEntryPoint(VOID) +{ + BootMain(""); +} + +VOID +FrLdrBugCheckWithMessage( + ULONG BugCode, + PCHAR File, + ULONG Line, + PSTR Format, + ...) +{ + +} diff --git a/reactos/boot/freeldr/freeldr/arch/arm/macharm.c b/reactos/boot/freeldr/freeldr/arch/arm/macharm.c index 1b0dde8703d..f9c0c8d3ac7 100644 --- a/reactos/boot/freeldr/freeldr/arch/arm/macharm.c +++ b/reactos/boot/freeldr/freeldr/arch/arm/macharm.c @@ -61,6 +61,10 @@ ULONG LenBits[] = /* FUNCTIONS ******************************************************************/ +VOID DiskStopFloppyMotor(VOID) +{ +} + VOID FrLdrCheckCpuCompatiblity(VOID) { diff --git a/reactos/boot/freeldr/freeldr/include/freeldr.h b/reactos/boot/freeldr/freeldr/include/freeldr.h index 0bdc9988655..47eb11671a3 100644 --- a/reactos/boot/freeldr/freeldr/include/freeldr.h +++ b/reactos/boot/freeldr/freeldr/include/freeldr.h @@ -79,6 +79,8 @@ #include #include #include + +/* NTOS loader */ #include /* File system headers */ diff --git a/reactos/boot/freeldr/freeldr/include/winldr.h b/reactos/boot/freeldr/freeldr/include/winldr.h index c85a7efba64..f5b3a8821c7 100644 --- a/reactos/boot/freeldr/freeldr/include/winldr.h +++ b/reactos/boot/freeldr/freeldr/include/winldr.h @@ -160,9 +160,6 @@ WinLdrpDumpBootDriver(PLOADER_PARAMETER_BLOCK LoaderBlock); VOID WinLdrpDumpArcDisks(PLOADER_PARAMETER_BLOCK LoaderBlock); -BOOLEAN -MempAllocatePageTables(); - BOOLEAN MempSetupPaging(IN PFN_NUMBER StartPage, IN PFN_NUMBER NumberOfPages, diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/winldr.c b/reactos/boot/freeldr/freeldr/windows/arch/amd64/winldr.c similarity index 99% rename from reactos/boot/freeldr/freeldr/arch/amd64/winldr.c rename to reactos/boot/freeldr/freeldr/windows/arch/amd64/winldr.c index e82a4e6da3f..784f0e6c5ee 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/winldr.c +++ b/reactos/boot/freeldr/freeldr/windows/arch/amd64/winldr.c @@ -28,6 +28,7 @@ ULONG_PTR TssBasePage; /* FUNCTIONS **************************************************************/ +static BOOLEAN MempAllocatePageTables(VOID) { @@ -60,6 +61,7 @@ MempAllocatePageTables(VOID) return TRUE; } +static PHARDWARE_PTE MempGetOrCreatePageDir(PHARDWARE_PTE PdeBase, ULONG Index) { @@ -85,6 +87,7 @@ MempGetOrCreatePageDir(PHARDWARE_PTE PdeBase, ULONG Index) return SubDir; } +static BOOLEAN MempMapSinglePage(ULONG64 VirtualAddress, ULONG64 PhysicalAddress) { @@ -143,6 +146,7 @@ MempIsPageMapped(PVOID VirtualAddress) return TRUE; } +static PFN_NUMBER MempMapRangeOfPages(ULONG64 VirtualAddress, ULONG64 PhysicalAddress, PFN_NUMBER cPages) { @@ -202,6 +206,7 @@ MempUnmapPage(PFN_NUMBER Page) // TRACE(">>> MempUnmapPage\n"); } +static VOID WinLdrpMapApic(VOID) { @@ -234,6 +239,7 @@ WinLdrpMapApic(VOID) MempMapSinglePage(APIC_BASE, APICAddress); } +static BOOLEAN WinLdrMapSpecialPages(VOID) { @@ -265,6 +271,7 @@ WinLdrMapSpecialPages(VOID) return TRUE; } +static VOID Amd64SetupGdt(PVOID GdtBase, ULONG64 TssBase) { @@ -313,6 +320,7 @@ Amd64SetupGdt(PVOID GdtBase, ULONG64 TssBase) TRACE("Leave Amd64SetupGdt()\n"); } +static VOID Amd64SetupIdt(PVOID IdtBase) { @@ -421,4 +429,3 @@ VOID MempDump(VOID) { } - diff --git a/reactos/boot/freeldr/freeldr/arch/arm/winldr.c b/reactos/boot/freeldr/freeldr/windows/arch/arm/winldr.c similarity index 97% rename from reactos/boot/freeldr/freeldr/arch/arm/winldr.c rename to reactos/boot/freeldr/freeldr/windows/arch/arm/winldr.c index a478612b1ad..820eb3b4800 100644 --- a/reactos/boot/freeldr/freeldr/arch/arm/winldr.c +++ b/reactos/boot/freeldr/freeldr/windows/arch/arm/winldr.c @@ -99,6 +99,7 @@ MempDump(VOID) return; } +static BOOLEAN WinLdrMapSpecialPages(ULONG PcrBasePage) { @@ -191,6 +192,7 @@ WinLdrSetupForNt(IN PLOADER_PARAMETER_BLOCK LoaderBlock, LoaderBlock->Thread = (ULONG_PTR)PdrPage->InitialThread; } +static BOOLEAN MempAllocatePageTables(VOID) { @@ -277,24 +279,3 @@ WinLdrSetupMachineDependent( PLOADER_PARAMETER_BLOCK LoaderBlock) { } - -VOID DiskStopFloppyMotor(VOID) -{ -} - -VOID -RealEntryPoint(VOID) -{ - BootMain(""); -} - -VOID -FrLdrBugCheckWithMessage( - ULONG BugCode, - PCHAR File, - ULONG Line, - PSTR Format, - ...) -{ - -} diff --git a/reactos/boot/freeldr/freeldr/arch/i386/halstub.c b/reactos/boot/freeldr/freeldr/windows/arch/i386/halstub.c similarity index 99% rename from reactos/boot/freeldr/freeldr/arch/i386/halstub.c rename to reactos/boot/freeldr/freeldr/windows/arch/i386/halstub.c index 2bcff89969a..19366e01849 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/halstub.c +++ b/reactos/boot/freeldr/freeldr/windows/arch/i386/halstub.c @@ -8,7 +8,7 @@ /* INCLUDES ******************************************************************/ -#include +#include "ntoskrnl.h" #define NDEBUG #include diff --git a/reactos/boot/freeldr/freeldr/arch/i386/ntoskrnl.c b/reactos/boot/freeldr/freeldr/windows/arch/i386/ntoskrnl.c similarity index 99% rename from reactos/boot/freeldr/freeldr/arch/i386/ntoskrnl.c rename to reactos/boot/freeldr/freeldr/windows/arch/i386/ntoskrnl.c index 3c30cad41ce..0ab63b5f0a5 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/ntoskrnl.c +++ b/reactos/boot/freeldr/freeldr/windows/arch/i386/ntoskrnl.c @@ -8,7 +8,7 @@ /* INCLUDES ******************************************************************/ -#include +#include "ntoskrnl.h" /* For KeStallExecutionProcessor */ #if defined(_M_IX86) || defined(_M_AMD64) diff --git a/reactos/boot/freeldr/freeldr/include/ntoskrnl.h b/reactos/boot/freeldr/freeldr/windows/arch/i386/ntoskrnl.h similarity index 100% rename from reactos/boot/freeldr/freeldr/include/ntoskrnl.h rename to reactos/boot/freeldr/freeldr/windows/arch/i386/ntoskrnl.h diff --git a/reactos/boot/freeldr/freeldr/arch/i386/winldr.c b/reactos/boot/freeldr/freeldr/windows/arch/i386/winldr.c similarity index 99% rename from reactos/boot/freeldr/freeldr/arch/i386/winldr.c rename to reactos/boot/freeldr/freeldr/windows/arch/i386/winldr.c index 729989f771e..38b167cd88f 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/winldr.c +++ b/reactos/boot/freeldr/freeldr/windows/arch/i386/winldr.c @@ -46,6 +46,7 @@ PVOID GdtIdt; /* FUNCTIONS **************************************************************/ +static BOOLEAN MempAllocatePageTables(VOID) { @@ -115,6 +116,7 @@ MempAllocatePageTables(VOID) return TRUE; } +static VOID MempAllocatePTE(ULONG Entry, PHARDWARE_PTE *PhysicalPT, PHARDWARE_PTE *KernelPT) { @@ -144,8 +146,8 @@ MempAllocatePTE(ULONG Entry, PHARDWARE_PTE *PhysicalPT, PHARDWARE_PTE *KernelPT) BOOLEAN MempSetupPaging(IN PFN_NUMBER StartPage, - IN PFN_COUNT NumberOfPages, - IN BOOLEAN KernelMapping) + IN PFN_COUNT NumberOfPages, + IN BOOLEAN KernelMapping) { PHARDWARE_PTE PhysicalPT; PHARDWARE_PTE KernelPT; @@ -221,6 +223,7 @@ MempUnmapPage(PFN_NUMBER Page) } } +static VOID WinLdrpMapApic(VOID) { @@ -252,6 +255,7 @@ WinLdrpMapApic(VOID) HalPageTable[(APIC_BASE - 0xFFC00000) >> MM_PAGE_SHIFT].CacheDisable = 1; } +static BOOLEAN WinLdrMapSpecialPages(void) { @@ -297,6 +301,7 @@ enum UltraVision_8x10Font = 0x12, }; +static void WinLdrSetupSpecialDataPointers(VOID) { REGS BiosRegs; @@ -690,4 +695,3 @@ MempDump(VOID) } } #endif -