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()
-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()
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()
+
// ****************************************************************************
//#define DEBUG_MESSAGES /* Uncomment to get debugging messages */
+#ifndef ROS_REGTEST
#define WAIT_FOR_KEY
-
+#endif
// ****************************************************************************
// BEGIN THE BIOS/CODE/DATA SEGMENT
#endif
// Make sure the keyboard buffer is empty
-#ifdef WAIT_FOR_KEY
call pollchar_and_empty
// Check for MBR on harddisk
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
dec byte ptr ds:[TimeoutCount] // decrement timeout counter
jz .boot_harddisk
jmp .next_second
+#endif
.boot_harddisk:
call crlf
mov dx, HEX(0080)
ljmp16 0, HEX(7C00)
-#endif
.boot_cdrom:
#ifdef WAIT_FOR_KEY
--- /dev/null
+
+#define ROS_REGTEST
+#include "isoboot.S"
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()
#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)