From 62b74e469638e42dee60d8d0d18a71e61ba63f52 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 26 Jun 2011 10:49:22 +0000 Subject: [PATCH] [FREELDR] Fix amd64 build. It doesn't work yet svn path=/trunk/; revision=52469 --- reactos/boot/freeldr/freeldr/CMakeLists.txt | 12 ++----- .../boot/freeldr/freeldr/arch/amd64/entry.S | 35 +++++++++++++++++++ .../freeldr/include/arch/amd64/amd64.h | 3 -- reactos/boot/freeldr/freeldr/include/disk.h | 2 -- .../boot/freeldr/freeldr/include/freeldr.h | 17 ++++----- 5 files changed, 44 insertions(+), 25 deletions(-) create mode 100644 reactos/boot/freeldr/freeldr/arch/amd64/entry.S diff --git a/reactos/boot/freeldr/freeldr/CMakeLists.txt b/reactos/boot/freeldr/freeldr/CMakeLists.txt index b7a1396b2ae..485c1f4ee6a 100644 --- a/reactos/boot/freeldr/freeldr/CMakeLists.txt +++ b/reactos/boot/freeldr/freeldr/CMakeLists.txt @@ -1,5 +1,5 @@ -if(ARCH MATCHES i386) +if(ARCH MATCHES i386 OR ARCH MATCHES amd64) CreateBootSectorTarget2(frldr16 ${CMAKE_CURRENT_SOURCE_DIR}/arch/realmode/i386.S ${CMAKE_CURRENT_BINARY_DIR}/frldr16.bin @@ -120,6 +120,7 @@ if(ARCH MATCHES i386) endif() elseif(ARCH MATCHES amd64) list(APPEND FREELDR_COMMON_SOURCE + arch/amd64/entry.S arch/amd64/loader.c arch/i386/hardware.c arch/i386/hwacpi.c @@ -137,15 +138,6 @@ elseif(ARCH MATCHES amd64) arch/i386/pcvideo.c windows/amd64/ntsetup.c windows/amd64/wlmemory.c) - if(NOT MSVC) - list(APPEND FREELDR_COMMON_SOURCE - arch/i386/drvmap.S - arch/i386/i386trap.S - arch/amd64/mb.S) - else() - list(APPEND FREELDR_COMMON_SOURCE - arch/amd64/stubs.S) - endif() else() #TBD endif() diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/entry.S b/reactos/boot/freeldr/freeldr/arch/amd64/entry.S new file mode 100644 index 00000000000..323b88167d7 --- /dev/null +++ b/reactos/boot/freeldr/freeldr/arch/amd64/entry.S @@ -0,0 +1,35 @@ + + +#include +#include + +.code64 + +PUBLIC RealEntryPoint +RealEntryPoint: + +PUBLIC FrldrBootDrive +FrldrBootDrive: + +PUBLIC FrldrBootPartition +FrldrBootPartition: + +PUBLIC PageDirectoryEnd +PageDirectoryEnd: +PUBLIC PageDirectoryStart +PageDirectoryStart: +PUBLIC PnpBiosGetDeviceNode +PnpBiosGetDeviceNode: +PUBLIC PnpBiosGetDeviceNodeCount +PnpBiosGetDeviceNodeCount: +PUBLIC PnpBiosSupported +PnpBiosSupported: +PUBLIC Int386 +Int386: +PUBLIC PxeCallApi +PxeCallApi: + +nop + + +END diff --git a/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h b/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h index 433fbb4f5e1..11aef1f90b6 100644 --- a/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h +++ b/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h @@ -31,9 +31,6 @@ /* Long mode selectors */ #define LMODE_CS 0x10 #define LMODE_DS 0x18 -#define RMODE_CS 0x20 /* RMode code selector, base 0 limit 64k */ -#define RMODE_DS 0x28 /* RMode data selector, base 0 limit 64k */ -#define CMODE_CS 0x30 #define VA_MASK 0x0000FFFFFFFFFFFFUL diff --git a/reactos/boot/freeldr/freeldr/include/disk.h b/reactos/boot/freeldr/freeldr/include/disk.h index 0d53518ef8c..2261930cf4f 100644 --- a/reactos/boot/freeldr/freeldr/include/disk.h +++ b/reactos/boot/freeldr/freeldr/include/disk.h @@ -123,10 +123,8 @@ PCSTR DiskGetErrorCodeString(ULONG ErrorCode); BOOLEAN DiskReadLogicalSectors(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer); // Implemented in i386disk.c BOOLEAN DiskIsDriveRemovable(ULONG DriveNumber); VOID DiskStopFloppyMotor(VOID); // Implemented in i386disk.c -#ifndef _M_AMD64 extern ULONG FrldrBootDrive; extern ULONG FrldrBootPartition; -#endif BOOLEAN DiskGetBootPath(char *BootPath, unsigned Size); diff --git a/reactos/boot/freeldr/freeldr/include/freeldr.h b/reactos/boot/freeldr/freeldr/include/freeldr.h index b229f874ac9..5e4df748261 100644 --- a/reactos/boot/freeldr/freeldr/include/freeldr.h +++ b/reactos/boot/freeldr/freeldr/include/freeldr.h @@ -93,25 +93,22 @@ #include /* arch specific includes */ +#if defined(_M_IX86) || defined(_M_AMD64) +#include +#include +#include +#include +#include +#endif #if defined(_M_IX86) #include #include #include #include #include -#include -#include -#include -#include -#include #include #elif defined(_M_AMD64) #include -#include -#include -#include -#include -#include #include #elif defined(_M_PPC) #include