Author: tkreuzer
Date: Sat Oct 1 12:14:45 2011
New Revision: 53914
URL:
http://svn.reactos.org/svn/reactos?rev=53914&view=rev
Log:
[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
Added:
trunk/reactos/boot/freeldr/freeldr/freeldr.spec (with props)
Modified:
trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt
trunk/reactos/boot/freeldr/freeldr/freeldr_i386.lnk
trunk/reactos/cmake/CMakeMacros.cmake
Modified: trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/CMake…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] Sat Oct 1 12:14:45
2011
@@ -1,3 +1,5 @@
+
+spec2def(freeldr.sys freeldr.spec)
if(ARCH MATCHES i386)
CreateBootSectorTarget2(frldr16
@@ -126,6 +128,7 @@
arch/i386/hardware.c
arch/i386/hwacpi.c
arch/i386/hwapm.c
+ arch/i386/hwdisk.c
arch/i386/hwpci.c
arch/i386/i386rtl.c
arch/i386/i386disk.c
@@ -155,8 +158,12 @@
rtl/bget.c
rtl/libsupp.c)
-add_executable(freeldr_pe ${FREELDR_BASE_SOURCE})
-add_executable(freeldr_pe_dbg EXCLUDE_FROM_ALL ${FREELDR_BASE_SOURCE})
+if (NOT MSVC)
+ 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)
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 @@
concatenate_files(
${CMAKE_CURRENT_BINARY_DIR}/frldr16.bin
- ${CMAKE_CURRENT_BINARY_DIR}/freeldr_pe.exe
+ freeldr_pe
${CMAKE_CURRENT_BINARY_DIR}/freeldr.sys)
add_custom_target(freeldr ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/freeldr.sys)
@@ -218,8 +225,8 @@
list(APPEND SETUPLDR_SOURCE windows/setupldr.c)
endif()
-add_executable(setupldr_pe ${FREELDR_BASE_SOURCE} ${SETUPLDR_SOURCE})
-add_executable(setupldr_pe_dbg EXCLUDE_FROM_ALL ${FREELDR_BASE_SOURCE}
${SETUPLDR_SOURCE})
+add_library(setupldr_pe SHARED ${FREELDR_BASE_SOURCE} ${SETUPLDR_SOURCE})
+add_library(setupldr_pe_dbg SHARED EXCLUDE_FROM_ALL ${FREELDR_BASE_SOURCE}
${SETUPLDR_SOURCE})
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")
@@ -263,7 +270,7 @@
concatenate_files(
${CMAKE_CURRENT_BINARY_DIR}/frldr16.bin
- ${CMAKE_CURRENT_BINARY_DIR}/setupldr_pe.exe
+ setupldr_pe
${CMAKE_CURRENT_BINARY_DIR}/setupldr.sys)
add_custom_target(setupldr ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/setupldr.sys)
Added: trunk/reactos/boot/freeldr/freeldr/freeldr.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/freel…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/freeldr.spec (added)
+++ trunk/reactos/boot/freeldr/freeldr/freeldr.spec [iso-8859-1] Sat Oct 1 12:14:45 2011
@@ -1,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)
Propchange: trunk/reactos/boot/freeldr/freeldr/freeldr.spec
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/boot/freeldr/freeldr/freeldr_i386.lnk
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/freel…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/freeldr_i386.lnk [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/freeldr_i386.lnk [iso-8859-1] Sat Oct 1 12:14:45
2011
@@ -8,6 +8,11 @@
*(SORT(.data*))
*(.rdata)
*(SORT(.rdata*))
+ }
+
+ .edata BLOCK(__file_alignment__) :
+ {
+ *(.edata)
}
.bss :
Modified: trunk/reactos/cmake/CMakeMacros.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/CMakeMacros.cmake?re…
==============================================================================
--- trunk/reactos/cmake/CMakeMacros.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/CMakeMacros.cmake [iso-8859-1] Sat Oct 1 12:14:45 2011
@@ -207,7 +207,9 @@
string(REPLACE "/" "\\" ${_native_path}
"${_cmake_path}")
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("${_file2}" _real_file2)
to_win_path("${_output}" _real_output)
@@ -215,15 +217,16 @@
OUTPUT ${_output}
COMMAND cmd.exe /C "copy /Y /B ${_real_file1} + ${_real_file2}
${_real_output} > nul"
DEPENDS ${_file1}
- DEPENDS ${_file2})
+ DEPENDS ${_target2})
endfunction()
else()
- macro(concatenate_files _file1 _file2 _output)
+ macro(concatenate_files _file1 _target2 _output)
+ get_target_property(_file2 ${_target2} LOCATION)
add_custom_command(
OUTPUT ${_output}
COMMAND cat ${_file1} ${_file2} > ${_output}
DEPENDS ${_file1}
- DEPENDS ${_file2})
+ DEPENDS ${_target2})
endmacro()
endif()
@@ -242,7 +245,7 @@
function(set_module_type MODULE TYPE)
cmake_parse_arguments(__module "UNICODE" "IMAGEBASE"
"ENTRYPOINT" ${ARGN})
-
+
if(__module_UNPARSED_ARGUMENTS)
message(STATUS "set_module_type : unparsed arguments
${__module_UNPARSED_ARGUMENTS}, module : ${MODULE}")
endif()
@@ -258,16 +261,16 @@
elseif(NOT ((${TYPE} STREQUAL win32dll) OR (${TYPE} STREQUAL win32ocx) OR (${TYPE}
STREQUAL cpl)))
message(FATAL_ERROR "Unknown type ${TYPE} for module ${MODULE}")
endif()
-
+
if(DEFINED __subsystem)
set_subsystem(${MODULE} ${__subsystem})
endif()
-
+
#set unicode definitions
if(__module_UNICODE)
add_target_compile_definitions(${MODULE} UNICODE _UNICODE)
endif()
-
+
# set entry point
if(__module_ENTRYPOINT OR (__module_ENTRYPOINT STREQUAL "0"))
list(GET __module_ENTRYPOINT 0 __entrypoint)
@@ -298,7 +301,7 @@
set(__entrypoint DllMain)
set(__entrystack 12)
endif()
-
+
if(DEFINED __entrypoint)
if(DEFINED __entrystack)
set_entrypoint(${MODULE} ${__entrypoint} ${__entrystack})
@@ -306,7 +309,7 @@
set_entrypoint(${MODULE} ${__entrypoint})
endif()
endif()
-
+
#set base address
if(__module_IMAGEBASE)
set_image_base(${MODULE} __module_IMAGEBASE)
@@ -319,21 +322,21 @@
elseif(${TYPE} STREQUAL kernelmodedriver)
set_image_base(${MODULE} 0x00010000)
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)
add_dependencies(${MODULE} bugcodes)
set_target_properties(${MODULE} PROPERTIES SUFFIX ".sys")
endif()
-
+
if(${TYPE} STREQUAL win32ocx)
set_target_properties(${MODULE} PROPERTIES SUFFIX ".ocx")
endif()
-
+
if(${TYPE} STREQUAL cpl)
set_target_properties(${MODULE} PROPERTIES SUFFIX ".cpl")
endif()
-
+
# do compiler specific stuff
set_module_type_toolchain(${MODULE} ${TYPE})
endfunction()