mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 01:25:41 +00:00
[FREELDR]
use a dll instead of an exe for the freeldr_pe and setupldr_pe targets and add a spec file to export scsiport stuff. This is the first step in cleaning up the scsiport import hack in freeldr svn path=/trunk/; revision=53914
This commit is contained in:
parent
21ee8eb586
commit
6130e7f546
4 changed files with 82 additions and 21 deletions
|
@ -1,4 +1,6 @@
|
||||||
|
|
||||||
|
spec2def(freeldr.sys freeldr.spec)
|
||||||
|
|
||||||
if(ARCH MATCHES i386)
|
if(ARCH MATCHES i386)
|
||||||
CreateBootSectorTarget2(frldr16
|
CreateBootSectorTarget2(frldr16
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/arch/realmode/i386.S
|
${CMAKE_CURRENT_SOURCE_DIR}/arch/realmode/i386.S
|
||||||
|
@ -126,6 +128,7 @@ elseif(ARCH MATCHES amd64)
|
||||||
arch/i386/hardware.c
|
arch/i386/hardware.c
|
||||||
arch/i386/hwacpi.c
|
arch/i386/hwacpi.c
|
||||||
arch/i386/hwapm.c
|
arch/i386/hwapm.c
|
||||||
|
arch/i386/hwdisk.c
|
||||||
arch/i386/hwpci.c
|
arch/i386/hwpci.c
|
||||||
arch/i386/i386rtl.c
|
arch/i386/i386rtl.c
|
||||||
arch/i386/i386disk.c
|
arch/i386/i386disk.c
|
||||||
|
@ -155,8 +158,12 @@ list(APPEND FREELDR_BASE_SOURCE
|
||||||
rtl/bget.c
|
rtl/bget.c
|
||||||
rtl/libsupp.c)
|
rtl/libsupp.c)
|
||||||
|
|
||||||
add_executable(freeldr_pe ${FREELDR_BASE_SOURCE})
|
if (NOT MSVC)
|
||||||
add_executable(freeldr_pe_dbg EXCLUDE_FROM_ALL ${FREELDR_BASE_SOURCE})
|
list(APPEND FREELDR_BASE_SOURCE ${CMAKE_CURRENT_BINARY_DIR}/freeldr.def)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_library(freeldr_pe SHARED ${FREELDR_BASE_SOURCE})
|
||||||
|
add_library(freeldr_pe_dbg SHARED EXCLUDE_FROM_ALL ${FREELDR_BASE_SOURCE})
|
||||||
|
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
set_target_properties(freeldr_pe PROPERTIES LINK_FLAGS "-Wl,--strip-all,--exclude-all-symbols,--file-alignment,0x1000,-T,${CMAKE_CURRENT_SOURCE_DIR}/freeldr_i386.lnk")
|
set_target_properties(freeldr_pe PROPERTIES LINK_FLAGS "-Wl,--strip-all,--exclude-all-symbols,--file-alignment,0x1000,-T,${CMAKE_CURRENT_SOURCE_DIR}/freeldr_i386.lnk")
|
||||||
|
@ -202,7 +209,7 @@ add_dependencies(freeldr_pe_dbg asm)
|
||||||
|
|
||||||
concatenate_files(
|
concatenate_files(
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/frldr16.bin
|
${CMAKE_CURRENT_BINARY_DIR}/frldr16.bin
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/freeldr_pe.exe
|
freeldr_pe
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/freeldr.sys)
|
${CMAKE_CURRENT_BINARY_DIR}/freeldr.sys)
|
||||||
|
|
||||||
add_custom_target(freeldr ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/freeldr.sys)
|
add_custom_target(freeldr ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/freeldr.sys)
|
||||||
|
@ -218,8 +225,8 @@ if(ARCH MATCHES i386 OR ARCH MATCHES amd64)
|
||||||
list(APPEND SETUPLDR_SOURCE windows/setupldr.c)
|
list(APPEND SETUPLDR_SOURCE windows/setupldr.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(setupldr_pe ${FREELDR_BASE_SOURCE} ${SETUPLDR_SOURCE})
|
add_library(setupldr_pe SHARED ${FREELDR_BASE_SOURCE} ${SETUPLDR_SOURCE})
|
||||||
add_executable(setupldr_pe_dbg EXCLUDE_FROM_ALL ${FREELDR_BASE_SOURCE} ${SETUPLDR_SOURCE})
|
add_library(setupldr_pe_dbg SHARED EXCLUDE_FROM_ALL ${FREELDR_BASE_SOURCE} ${SETUPLDR_SOURCE})
|
||||||
|
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
set_target_properties(setupldr_pe PROPERTIES LINK_FLAGS "-Wl,--strip-all,--exclude-all-symbols,--file-alignment,0x1000,-T,${CMAKE_CURRENT_SOURCE_DIR}/freeldr_i386.lnk" COMPILE_DEFINITIONS "FREELDR_REACTOS_SETUP")
|
set_target_properties(setupldr_pe PROPERTIES LINK_FLAGS "-Wl,--strip-all,--exclude-all-symbols,--file-alignment,0x1000,-T,${CMAKE_CURRENT_SOURCE_DIR}/freeldr_i386.lnk" COMPILE_DEFINITIONS "FREELDR_REACTOS_SETUP")
|
||||||
|
@ -263,7 +270,7 @@ add_dependencies(setupldr_pe_dbg asm)
|
||||||
|
|
||||||
concatenate_files(
|
concatenate_files(
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/frldr16.bin
|
${CMAKE_CURRENT_BINARY_DIR}/frldr16.bin
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/setupldr_pe.exe
|
setupldr_pe
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/setupldr.sys)
|
${CMAKE_CURRENT_BINARY_DIR}/setupldr.sys)
|
||||||
|
|
||||||
add_custom_target(setupldr ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/setupldr.sys)
|
add_custom_target(setupldr ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/setupldr.sys)
|
||||||
|
|
46
reactos/boot/freeldr/freeldr/freeldr.spec
Normal file
46
reactos/boot/freeldr/freeldr/freeldr.spec
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
@ cdecl ScsiDebugPrint()
|
||||||
|
@ stdcall ScsiPortCompleteRequest(ptr long long long long)
|
||||||
|
@ stdcall ScsiPortConvertPhysicalAddressToUlong(long long)
|
||||||
|
@ stdcall -arch=i386 ScsiPortConvertUlongToPhysicalAddress(long)
|
||||||
|
@ stdcall -arch=x86_64 ScsiPortConvertUlongToPhysicalAddress(long)
|
||||||
|
@ stdcall ScsiPortFlushDma(ptr)
|
||||||
|
@ stdcall ScsiPortFreeDeviceBase(ptr ptr)
|
||||||
|
@ stdcall ScsiPortGetBusData(ptr long long long ptr long)
|
||||||
|
@ stdcall ScsiPortGetDeviceBase(ptr long long long long long long)
|
||||||
|
@ stdcall ScsiPortGetLogicalUnit(ptr long long long)
|
||||||
|
@ stdcall ScsiPortGetPhysicalAddress(ptr ptr ptr long)
|
||||||
|
@ stdcall ScsiPortGetSrb(ptr long long long long)
|
||||||
|
@ stdcall ScsiPortGetUncachedExtension(ptr ptr long)
|
||||||
|
@ stdcall ScsiPortGetVirtualAddress(ptr long long)
|
||||||
|
@ stdcall ScsiPortInitialize(ptr ptr ptr ptr)
|
||||||
|
@ stdcall ScsiPortIoMapTransfer(ptr ptr long long)
|
||||||
|
@ stdcall ScsiPortLogError(ptr ptr long long long long long)
|
||||||
|
@ stdcall ScsiPortMoveMemory(ptr ptr long)
|
||||||
|
@ cdecl ScsiPortNotification()
|
||||||
|
@ stdcall ScsiPortReadPortBufferUchar(ptr ptr long)
|
||||||
|
@ stdcall ScsiPortReadPortBufferUshort(ptr ptr long)
|
||||||
|
@ stdcall ScsiPortReadPortBufferUlong(ptr ptr long)
|
||||||
|
@ stdcall ScsiPortReadPortUchar(ptr)
|
||||||
|
@ stdcall ScsiPortReadPortUshort(ptr)
|
||||||
|
@ stdcall ScsiPortReadPortUlong(ptr)
|
||||||
|
@ stdcall ScsiPortReadRegisterBufferUchar(ptr ptr long)
|
||||||
|
@ stdcall ScsiPortReadRegisterBufferUshort(ptr ptr long)
|
||||||
|
@ stdcall ScsiPortReadRegisterBufferUlong(ptr ptr long)
|
||||||
|
@ stdcall ScsiPortReadRegisterUchar(ptr)
|
||||||
|
@ stdcall ScsiPortReadRegisterUshort(ptr)
|
||||||
|
@ stdcall ScsiPortReadRegisterUlong(ptr)
|
||||||
|
@ stdcall ScsiPortSetBusDataByOffset(ptr long long long ptr long long)
|
||||||
|
@ stdcall ScsiPortStallExecution(long)
|
||||||
|
@ stdcall ScsiPortValidateRange(ptr long long long long long long)
|
||||||
|
@ stdcall ScsiPortWritePortBufferUchar(ptr ptr long)
|
||||||
|
@ stdcall ScsiPortWritePortBufferUshort(ptr ptr long)
|
||||||
|
@ stdcall ScsiPortWritePortBufferUlong(ptr ptr long)
|
||||||
|
@ stdcall ScsiPortWritePortUchar(ptr long)
|
||||||
|
@ stdcall ScsiPortWritePortUshort(ptr long)
|
||||||
|
@ stdcall ScsiPortWritePortUlong(ptr long)
|
||||||
|
@ stdcall ScsiPortWriteRegisterBufferUchar(ptr ptr long)
|
||||||
|
@ stdcall ScsiPortWriteRegisterBufferUshort(ptr ptr long)
|
||||||
|
@ stdcall ScsiPortWriteRegisterBufferUlong(ptr ptr long)
|
||||||
|
@ stdcall ScsiPortWriteRegisterUchar(ptr long)
|
||||||
|
@ stdcall ScsiPortWriteRegisterUshort(ptr long)
|
||||||
|
@ stdcall ScsiPortWriteRegisterUlong(ptr long)
|
|
@ -10,6 +10,11 @@ SECTIONS
|
||||||
*(SORT(.rdata*))
|
*(SORT(.rdata*))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.edata BLOCK(__file_alignment__) :
|
||||||
|
{
|
||||||
|
*(.edata)
|
||||||
|
}
|
||||||
|
|
||||||
.bss :
|
.bss :
|
||||||
{
|
{
|
||||||
__bss_start__ = . ;
|
__bss_start__ = . ;
|
||||||
|
|
|
@ -207,7 +207,9 @@ if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
|
||||||
string(REPLACE "/" "\\" ${_native_path} "${_cmake_path}")
|
string(REPLACE "/" "\\" ${_native_path} "${_cmake_path}")
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
function(concatenate_files _file1 _file2 _output)
|
# yeah the parameter mess sucks, but thats what works...
|
||||||
|
function(concatenate_files _file1 _target2 _output)
|
||||||
|
get_target_property(_file2 ${_target2} LOCATION)
|
||||||
to_win_path("${_file1}" _real_file1)
|
to_win_path("${_file1}" _real_file1)
|
||||||
to_win_path("${_file2}" _real_file2)
|
to_win_path("${_file2}" _real_file2)
|
||||||
to_win_path("${_output}" _real_output)
|
to_win_path("${_output}" _real_output)
|
||||||
|
@ -215,15 +217,16 @@ if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
|
||||||
OUTPUT ${_output}
|
OUTPUT ${_output}
|
||||||
COMMAND cmd.exe /C "copy /Y /B ${_real_file1} + ${_real_file2} ${_real_output} > nul"
|
COMMAND cmd.exe /C "copy /Y /B ${_real_file1} + ${_real_file2} ${_real_output} > nul"
|
||||||
DEPENDS ${_file1}
|
DEPENDS ${_file1}
|
||||||
DEPENDS ${_file2})
|
DEPENDS ${_target2})
|
||||||
endfunction()
|
endfunction()
|
||||||
else()
|
else()
|
||||||
macro(concatenate_files _file1 _file2 _output)
|
macro(concatenate_files _file1 _target2 _output)
|
||||||
|
get_target_property(_file2 ${_target2} LOCATION)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${_output}
|
OUTPUT ${_output}
|
||||||
COMMAND cat ${_file1} ${_file2} > ${_output}
|
COMMAND cat ${_file1} ${_file2} > ${_output}
|
||||||
DEPENDS ${_file1}
|
DEPENDS ${_file1}
|
||||||
DEPENDS ${_file2})
|
DEPENDS ${_target2})
|
||||||
endmacro()
|
endmacro()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -242,7 +245,7 @@ endfunction()
|
||||||
|
|
||||||
function(set_module_type MODULE TYPE)
|
function(set_module_type MODULE TYPE)
|
||||||
cmake_parse_arguments(__module "UNICODE" "IMAGEBASE" "ENTRYPOINT" ${ARGN})
|
cmake_parse_arguments(__module "UNICODE" "IMAGEBASE" "ENTRYPOINT" ${ARGN})
|
||||||
|
|
||||||
if(__module_UNPARSED_ARGUMENTS)
|
if(__module_UNPARSED_ARGUMENTS)
|
||||||
message(STATUS "set_module_type : unparsed arguments ${__module_UNPARSED_ARGUMENTS}, module : ${MODULE}")
|
message(STATUS "set_module_type : unparsed arguments ${__module_UNPARSED_ARGUMENTS}, module : ${MODULE}")
|
||||||
endif()
|
endif()
|
||||||
|
@ -258,16 +261,16 @@ function(set_module_type MODULE TYPE)
|
||||||
elseif(NOT ((${TYPE} STREQUAL win32dll) OR (${TYPE} STREQUAL win32ocx) OR (${TYPE} STREQUAL cpl)))
|
elseif(NOT ((${TYPE} STREQUAL win32dll) OR (${TYPE} STREQUAL win32ocx) OR (${TYPE} STREQUAL cpl)))
|
||||||
message(FATAL_ERROR "Unknown type ${TYPE} for module ${MODULE}")
|
message(FATAL_ERROR "Unknown type ${TYPE} for module ${MODULE}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(DEFINED __subsystem)
|
if(DEFINED __subsystem)
|
||||||
set_subsystem(${MODULE} ${__subsystem})
|
set_subsystem(${MODULE} ${__subsystem})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#set unicode definitions
|
#set unicode definitions
|
||||||
if(__module_UNICODE)
|
if(__module_UNICODE)
|
||||||
add_target_compile_definitions(${MODULE} UNICODE _UNICODE)
|
add_target_compile_definitions(${MODULE} UNICODE _UNICODE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# set entry point
|
# set entry point
|
||||||
if(__module_ENTRYPOINT OR (__module_ENTRYPOINT STREQUAL "0"))
|
if(__module_ENTRYPOINT OR (__module_ENTRYPOINT STREQUAL "0"))
|
||||||
list(GET __module_ENTRYPOINT 0 __entrypoint)
|
list(GET __module_ENTRYPOINT 0 __entrypoint)
|
||||||
|
@ -298,7 +301,7 @@ function(set_module_type MODULE TYPE)
|
||||||
set(__entrypoint DllMain)
|
set(__entrypoint DllMain)
|
||||||
set(__entrystack 12)
|
set(__entrystack 12)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(DEFINED __entrypoint)
|
if(DEFINED __entrypoint)
|
||||||
if(DEFINED __entrystack)
|
if(DEFINED __entrystack)
|
||||||
set_entrypoint(${MODULE} ${__entrypoint} ${__entrystack})
|
set_entrypoint(${MODULE} ${__entrypoint} ${__entrystack})
|
||||||
|
@ -306,7 +309,7 @@ function(set_module_type MODULE TYPE)
|
||||||
set_entrypoint(${MODULE} ${__entrypoint})
|
set_entrypoint(${MODULE} ${__entrypoint})
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#set base address
|
#set base address
|
||||||
if(__module_IMAGEBASE)
|
if(__module_IMAGEBASE)
|
||||||
set_image_base(${MODULE} __module_IMAGEBASE)
|
set_image_base(${MODULE} __module_IMAGEBASE)
|
||||||
|
@ -319,21 +322,21 @@ function(set_module_type MODULE TYPE)
|
||||||
elseif(${TYPE} STREQUAL kernelmodedriver)
|
elseif(${TYPE} STREQUAL kernelmodedriver)
|
||||||
set_image_base(${MODULE} 0x00010000)
|
set_image_base(${MODULE} 0x00010000)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Now do some stuff which is specific to each type
|
# Now do some stuff which is specific to each type
|
||||||
if(${TYPE} STREQUAL kernelmodedriver)
|
if(${TYPE} STREQUAL kernelmodedriver)
|
||||||
add_dependencies(${MODULE} bugcodes)
|
add_dependencies(${MODULE} bugcodes)
|
||||||
set_target_properties(${MODULE} PROPERTIES SUFFIX ".sys")
|
set_target_properties(${MODULE} PROPERTIES SUFFIX ".sys")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${TYPE} STREQUAL win32ocx)
|
if(${TYPE} STREQUAL win32ocx)
|
||||||
set_target_properties(${MODULE} PROPERTIES SUFFIX ".ocx")
|
set_target_properties(${MODULE} PROPERTIES SUFFIX ".ocx")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${TYPE} STREQUAL cpl)
|
if(${TYPE} STREQUAL cpl)
|
||||||
set_target_properties(${MODULE} PROPERTIES SUFFIX ".cpl")
|
set_target_properties(${MODULE} PROPERTIES SUFFIX ".cpl")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# do compiler specific stuff
|
# do compiler specific stuff
|
||||||
set_module_type_toolchain(${MODULE} ${TYPE})
|
set_module_type_toolchain(${MODULE} ${TYPE})
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue