mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-28 12:23:28 +00:00
[FREELDR]
use baseaddress of ßx10000 on MSVC builds. This doesn't yet work on gcc, because we still have 16 bit code inside the PE, that must reside below 64k svn path=/trunk/; revision=52249
This commit is contained in:
@@ -359,7 +359,11 @@ get_fs_structures:
|
||||
call crlf
|
||||
#endif
|
||||
|
||||
#ifdef _USE_ML
|
||||
mov bx, HEX(F000) // bx = load address
|
||||
#else
|
||||
mov bx, HEX(8000) // bx = load address
|
||||
#endif
|
||||
mov si, di // restore file pointer
|
||||
mov cx, HEX(0FFFF) // load the whole file
|
||||
call getfssec // get the whole file
|
||||
@@ -374,7 +378,11 @@ get_fs_structures:
|
||||
mov dh, 0 // dh = boot partition
|
||||
|
||||
/* Transfer execution to the bootloader */
|
||||
#ifdef _USE_ML
|
||||
ljmp16 0, HEX(F000)
|
||||
#else
|
||||
ljmp16 0, HEX(8000)
|
||||
#endif
|
||||
|
||||
//
|
||||
// searchdir:
|
||||
|
||||
@@ -24,6 +24,7 @@ if(ARCH MATCHES i386)
|
||||
arch/i386/i386bug.c)
|
||||
else()
|
||||
list(APPEND FREELDR_BASE64K_SOURCE
|
||||
arch/i386/entry.S
|
||||
arch/i386/realmode.S)
|
||||
endif()
|
||||
elseif(ARCH MATCHES amd64)
|
||||
@@ -168,10 +169,17 @@ set_source_files_properties(${FREELDR_ARCH_SOURCE} PROPERTIES COMPILE_DEFINITION
|
||||
add_library(freeldr_arch ${FREELDR_ARCH_SOURCE})
|
||||
add_dependencies(freeldr_arch bugcodes)
|
||||
|
||||
if (NOT MSVC)
|
||||
CreateBootSectorTarget2(frldr16
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/arch/realmode/i386.S
|
||||
${CMAKE_CURRENT_BINARY_DIR}/frldr16.bin
|
||||
8000)
|
||||
else()
|
||||
CreateBootSectorTarget2(frldr16
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/arch/realmode/i386.S
|
||||
${CMAKE_CURRENT_BINARY_DIR}/frldr16.bin
|
||||
F000)
|
||||
endif()
|
||||
|
||||
list(APPEND FREELDR_SOURCE
|
||||
bootmgr.c
|
||||
@@ -183,12 +191,13 @@ add_executable(freeldr_pe ${FREELDR_SOURCE})
|
||||
|
||||
if(NOT MSVC)
|
||||
set_target_properties(freeldr_pe PROPERTIES LINK_FLAGS "-Wl,--strip-all -Wl,--exclude-all-symbols -Wl,--file-alignment,0x1000 -Wl,-T,${CMAKE_CURRENT_SOURCE_DIR}/freeldr_i386.lnk")
|
||||
set_image_base(freeldr_pe 0x9000)
|
||||
else()
|
||||
set_target_properties(freeldr_pe PROPERTIES LINK_FLAGS "/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 /SUBSYSTEM:BOOT_APPLICATION")
|
||||
set_image_base(freeldr_pe 0x10000)
|
||||
endif()
|
||||
|
||||
set_subsystem(freeldr_pe native)
|
||||
set_image_base(freeldr_pe 0x9000)
|
||||
set_entrypoint(freeldr_pe RealEntryPoint)
|
||||
|
||||
if(ARCH MATCHES i386)
|
||||
@@ -237,12 +246,13 @@ add_executable(setupldr_pe ${SETUPLDR_SOURCE})
|
||||
|
||||
if(NOT MSVC)
|
||||
set_target_properties(setupldr_pe PROPERTIES LINK_FLAGS "-Wl,--strip-all -Wl,--exclude-all-symbols -Wl,--file-alignment,0x1000 -Wl,-T,${CMAKE_CURRENT_SOURCE_DIR}/freeldr_i386.lnk" COMPILE_DEFINITIONS "FREELDR_REACTOS_SETUP")
|
||||
set_image_base(setupldr_pe 0x9000)
|
||||
else()
|
||||
set_target_properties(setupldr_pe PROPERTIES LINK_FLAGS "/DRIVER /SECTION:.text,ERWP,ALIGN=0x1000" COMPILE_DEFINITIONS "FREELDR_REACTOS_SETUP")
|
||||
set_image_base(setupldr_pe 0x10000)
|
||||
endif()
|
||||
|
||||
set_subsystem(setupldr_pe native)
|
||||
set_image_base(setupldr_pe 0x9000)
|
||||
set_entrypoint(setupldr_pe RealEntryPoint)
|
||||
|
||||
if(ARCH MATCHES i386)
|
||||
|
||||
@@ -6,8 +6,13 @@
|
||||
/* Memory layout */
|
||||
#define STACK16ADDR HEX(6F00) /* The 16-bit stack top will be at 0000:6F00 */
|
||||
#define BSS_START HEX(6F00)
|
||||
#if defined(_USE_ML) || defined(_MSC_VER)
|
||||
#define FREELDR_BASE HEX(f000)
|
||||
#define FREELDR_PE_BASE HEX(10000)
|
||||
#else
|
||||
#define FREELDR_BASE HEX(8000)
|
||||
#define FREELDR_PE_BASE HEX(9000)
|
||||
#endif
|
||||
#define STACK32ADDR HEX(78000) /* The 32-bit stack top will be at 7000:8000, or 0x78000 */
|
||||
#define BIOSCALLBUFFER HEX(78000) /* Buffer to store temporary data for any Int386() call */
|
||||
#define BIOSCALLBUFSEGMENT HEX(7800) /* Buffer to store temporary data for any Int386() call */
|
||||
|
||||
Reference in New Issue
Block a user