[FREELDR]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 26 Jun 2011 10:49:22 +0000 (10:49 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 26 Jun 2011 10:49:22 +0000 (10:49 +0000)
Fix amd64 build. It doesn't work yet

svn path=/trunk/; revision=52469

reactos/boot/freeldr/freeldr/CMakeLists.txt
reactos/boot/freeldr/freeldr/arch/amd64/entry.S [new file with mode: 0644]
reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h
reactos/boot/freeldr/freeldr/include/disk.h
reactos/boot/freeldr/freeldr/include/freeldr.h

index b7a1396..485c1f4 100644 (file)
@@ -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 (file)
index 0000000..323b881
--- /dev/null
@@ -0,0 +1,35 @@
+
+
+#include <asm.inc>
+#include <arch/pc/x86common.h>
+
+.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
index 433fbb4..11aef1f 100644 (file)
@@ -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
 
index 0d53518..2261930 100644 (file)
@@ -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);
 
index b229f87..5e4df74 100644 (file)
 #include <ui/tui.h>
 
 /* arch specific includes */
+#if defined(_M_IX86) || defined(_M_AMD64)
+#include <arch/pc/hardware.h>
+#include <arch/pc/machpc.h>
+#include <arch/pc/x86common.h>
+#include <arch/pc/pcbios.h>
+#include <arch/pc/pxe.h>
+#endif
 #if defined(_M_IX86)
 #include <arch/i386/custom.h>
 #include <arch/i386/drivemap.h>
 #include <arch/i386/i386.h>
 #include <arch/i386/machxbox.h>
 #include <arch/i386/miscboot.h>
-#include <arch/pc/hardware.h>
-#include <arch/pc/machpc.h>
-#include <arch/pc/x86common.h>
-#include <arch/pc/pcbios.h>
-#include <arch/pc/pxe.h>
 #include <internal/i386/intrin_i.h>
 #elif defined(_M_AMD64)
 #include <arch/amd64/amd64.h>
-#include <arch/pc/hardware.h>
-#include <arch/pc/machpc.h>
-#include <arch/pc/x86common.h>
-#include <arch/pc/pcbios.h>
-#include <arch/pc/pxe.h>
 #include <internal/amd64/intrin_i.h>
 #elif defined(_M_PPC)
 #include <arch/powerpc/hardware.h>