[ros-diffs] [tkreuzer] 52156: [BOOTSECTOR] - export obj2bin on gcc builds, too - Add new macro CreateBootSectorTarget2, which uses portable assembly and use it with isoboot.S. I will replace all bootsectors wi...

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Thu Jun 9 13:56:46 UTC 2011


Author: tkreuzer
Date: Thu Jun  9 13:56:44 2011
New Revision: 52156

URL: http://svn.reactos.org/svn/reactos?rev=52156&view=rev
Log:
[BOOTSECTOR]
- export obj2bin on gcc builds, too
- Add new macro CreateBootSectorTarget2, which uses portable assembly and use it with isoboot.S. I will replace all bootsectors with the new code one at a time, and in the end we can eventually drop nmake
- add wrapper isobtrt.S, which defines ROS_REGTEST and includes isoboot.S

Added:
    trunk/reactos/boot/freeldr/bootsect/isobtrt.S   (with props)
Modified:
    trunk/reactos/CMakeLists.txt
    trunk/reactos/boot/freeldr/bootsect/CMakeLists.txt
    trunk/reactos/boot/freeldr/bootsect/isoboot.S
    trunk/reactos/gcc.cmake
    trunk/reactos/msc.cmake

Modified: trunk/reactos/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/CMakeLists.txt?rev=52156&r1=52155&r2=52156&view=diff
==============================================================================
--- trunk/reactos/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/CMakeLists.txt [iso-8859-1] Thu Jun  9 13:56:44 2011
@@ -59,7 +59,7 @@
     add_subdirectory(lib)
 
     if(NOT MSVC)
-        export(TARGETS widl wrc gendib cabman cdmake mkhive spec2def geninc FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- )
+        export(TARGETS widl wrc gendib cabman cdmake mkhive obj2bin spec2def geninc FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- )
     else()
         export(TARGETS gendib cabman cdmake mkhive obj2bin spec2def geninc FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- )
     endif()

Modified: trunk/reactos/boot/freeldr/bootsect/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/bootsect/CMakeLists.txt?rev=52156&r1=52155&r2=52156&view=diff
==============================================================================
--- trunk/reactos/boot/freeldr/bootsect/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/bootsect/CMakeLists.txt [iso-8859-1] Thu Jun  9 13:56:44 2011
@@ -1,12 +1,18 @@
 
-if(MSVC)
-CreateBootSectorTarget(fat32 ${CMAKE_CURRENT_SOURCE_DIR}/fat32.S ${CMAKE_CURRENT_BINARY_DIR}/fat32.bin 7c00)
-else()
+if(ARCH MATCHES i386 OR ARCH MATCHES amd64)
+
+#CreateBootSectorTarget2(dosmbr ${CMAKE_CURRENT_SOURCE_DIR}/dosmbr.S ${CMAKE_CURRENT_BINARY_DIR}/dosmbr.bin 0)
+#CreateBootSectorTarget2(ext2 ${CMAKE_CURRENT_SOURCE_DIR}/ext2.S ${CMAKE_CURRENT_BINARY_DIR}/ext2.bin 0)
+#CreateBootSectorTarget2(fat32 ${CMAKE_CURRENT_SOURCE_DIR}/fat32.S ${CMAKE_CURRENT_BINARY_DIR}/fat32.bin 7c00)
+#CreateBootSectorTarget2(fat ${CMAKE_CURRENT_SOURCE_DIR}/fat.S ${CMAKE_CURRENT_BINARY_DIR}/fat.bin 0)
+CreateBootSectorTarget2(isoboot ${CMAKE_CURRENT_SOURCE_DIR}/isoboot.S ${CMAKE_CURRENT_BINARY_DIR}/isoboot.bin 7000)
+#CreateBootSectorTarget2(isobtrt ${CMAKE_CURRENT_SOURCE_DIR}/isobtrt.S ${CMAKE_CURRENT_BINARY_DIR}/isobtrt.bin 0)
+
+if(NOT MSVC)
 CreateBootSectorTarget(dosmbr ${CMAKE_CURRENT_SOURCE_DIR}/dosmbr.asm ${CMAKE_CURRENT_BINARY_DIR}/dosmbr.bin 0)
 CreateBootSectorTarget(ext2 ${CMAKE_CURRENT_SOURCE_DIR}/ext2.asm ${CMAKE_CURRENT_BINARY_DIR}/ext2.bin 0)
-CreateBootSectorTarget(fat32 ${CMAKE_CURRENT_SOURCE_DIR}/fat32.asm ${CMAKE_CURRENT_BINARY_DIR}/fat32.bin 0)
+CreateBootSectorTarget(fat32 ${CMAKE_CURRENT_SOURCE_DIR}/fat32.asm ${CMAKE_CURRENT_BINARY_DIR}/fat32.bin 7c00)
 CreateBootSectorTarget(fat ${CMAKE_CURRENT_SOURCE_DIR}/fat.asm ${CMAKE_CURRENT_BINARY_DIR}/fat.bin 0)
-CreateBootSectorTarget(isoboot ${CMAKE_CURRENT_SOURCE_DIR}/isoboot.asm ${CMAKE_CURRENT_BINARY_DIR}/isoboot.bin 0)
 CreateBootSectorTarget(isobtrt ${CMAKE_CURRENT_SOURCE_DIR}/isobtrt.asm ${CMAKE_CURRENT_BINARY_DIR}/isobtrt.bin 0)
 endif()
 
@@ -17,3 +23,5 @@
 add_cd_file(TARGET isoboot DESTINATION loader NO_CAB FILE ${CMAKE_CURRENT_BINARY_DIR}/isoboot.bin FOR all)
 add_cd_file(TARGET isobtrt DESTINATION loader NO_CAB FILE ${CMAKE_CURRENT_BINARY_DIR}/isobtrt.bin FOR all)
 
+endif()
+

Modified: trunk/reactos/boot/freeldr/bootsect/isoboot.S
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/bootsect/isoboot.S?rev=52156&r1=52155&r2=52156&view=diff
==============================================================================
--- trunk/reactos/boot/freeldr/bootsect/isoboot.S [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/bootsect/isoboot.S [iso-8859-1] Thu Jun  9 13:56:44 2011
@@ -45,8 +45,9 @@
 // ****************************************************************************
 
 //#define DEBUG_MESSAGES                /* Uncomment to get debugging messages */
+#ifndef ROS_REGTEST
 #define WAIT_FOR_KEY
-
+#endif
 
 // ****************************************************************************
 //    BEGIN THE BIOS/CODE/DATA SEGMENT
@@ -129,7 +130,6 @@
 #endif
 
     // Make sure the keyboard buffer is empty
-#ifdef WAIT_FOR_KEY
     call pollchar_and_empty
 
     // Check for MBR on harddisk
@@ -148,6 +148,7 @@
     je .boot_cdrom // no boot sector found (hopefully there are no weird bootsectors which begin with 0)
     pop ax
 
+#ifdef WAIT_FOR_KEY
     // Display the 'Press key' message and wait for a maximum of 5 seconds
     call crlf
     mov si, offset presskey_msg // si points to 'Press key' message
@@ -171,6 +172,7 @@
     dec byte ptr ds:[TimeoutCount]        // decrement timeout counter
     jz .boot_harddisk
     jmp .next_second
+#endif
 
 .boot_harddisk:
     call crlf
@@ -192,7 +194,6 @@
     mov dx, HEX(0080)
 
     ljmp16 0, HEX(7C00)
-#endif
 
 .boot_cdrom:
 #ifdef WAIT_FOR_KEY

Added: trunk/reactos/boot/freeldr/bootsect/isobtrt.S
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/bootsect/isobtrt.S?rev=52156&view=auto
==============================================================================
--- trunk/reactos/boot/freeldr/bootsect/isobtrt.S (added)
+++ trunk/reactos/boot/freeldr/bootsect/isobtrt.S [iso-8859-1] Thu Jun  9 13:56:44 2011
@@ -1,0 +1,3 @@
+
+#define ROS_REGTEST
+#include "isoboot.S"

Propchange: trunk/reactos/boot/freeldr/bootsect/isobtrt.S
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: trunk/reactos/gcc.cmake
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/gcc.cmake?rev=52156&r1=52155&r2=52156&view=diff
==============================================================================
--- trunk/reactos/gcc.cmake [iso-8859-1] (original)
+++ trunk/reactos/gcc.cmake [iso-8859-1] Thu Jun  9 13:56:44 2011
@@ -352,3 +352,23 @@
     set_source_files_properties(${_object_file} PROPERTIES GENERATED TRUE)
     add_custom_target(${_target_name} ALL DEPENDS ${_object_file})
 endmacro()
+
+macro(CreateBootSectorTarget2 _target_name _asm_file _binary_file _base_address)
+    set(_object_file ${_binary_file}.o)
+
+    add_custom_command(
+        OUTPUT ${_object_file}
+        COMMAND ${CMAKE_ASM_COMPILER} -x assembler-with-cpp -o ${_object_file} -I${REACTOS_SOURCE_DIR}/include/asm -I${REACTOS_BINARY_DIR}/include/asm -D__ASM__ -c ${_asm_file}
+        DEPENDS ${_asm_file})
+
+    add_custom_command(
+        OUTPUT ${_binary_file}
+        COMMAND native-obj2bin ${_object_file} ${_binary_file} ${_base_address}
+        # COMMAND objcopy --output-target binary --image-base 0x${_base_address} ${_object_file} ${_binary_file}
+        DEPENDS ${_object_file})
+
+    set_source_files_properties(${_object_file} ${_binary_file} PROPERTIES GENERATED TRUE)
+
+    add_custom_target(${_target_name} ALL DEPENDS ${_binary_file})
+
+endmacro()

Modified: trunk/reactos/msc.cmake
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/msc.cmake?rev=52156&r1=52155&r2=52156&view=diff
==============================================================================
--- trunk/reactos/msc.cmake [iso-8859-1] (original)
+++ trunk/reactos/msc.cmake [iso-8859-1] Thu Jun  9 13:56:44 2011
@@ -192,7 +192,7 @@
 #pseh workaround
 set(PSEH_LIB "pseh")
 
-macro(CreateBootSectorTarget _target_name _asm_file _binary_file _base_address)
+macro(CreateBootSectorTarget2 _target_name _asm_file _binary_file _base_address)
 
     set(_object_file ${_binary_file}.obj)
     set(_temp_file ${_binary_file}.tmp)




More information about the Ros-diffs mailing list