Skip to content

Commit ddf55b3

Browse files
authored
[BOOTSECT][FREELDR] Rewrite the Ext bootsector (reactos#7544)
Rewrite the Ext bootsector because the older one was broken and had no compatibility with Ext4 extents. Introduce a 3rd-stage bootsector for complex code. CORE-14235 - Why was the previous bootsector broken? Because of hardcoded inode size, hardcoded freeldr base address, etc. - Why is there a extldr.sys? The extldr.sys was introduced because the limited code space in the bootsector prevents adding new features, such as Ext4 full extents support. - What is extldr.sys and What does it do? It is the helper file for the Ext bootsector and that is necessary for adding Ext4 support. It locates the freeldr.sys file, loads it into memory and runs it.
1 parent 7c61e57 commit ddf55b3

File tree

4 files changed

+1313
-690
lines changed

4 files changed

+1313
-690
lines changed

boot/freeldr/bootsect/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ include_directories(${REACTOS_SOURCE_DIR}/boot/freeldr)
44
if(ARCH STREQUAL "i386" OR ARCH STREQUAL "amd64")
55

66
CreateBootSectorTarget(dosmbr ${CMAKE_CURRENT_SOURCE_DIR}/dosmbr.S ${CMAKE_CURRENT_BINARY_DIR}/dosmbr.bin 7c00)
7-
CreateBootSectorTarget(ext2 ${CMAKE_CURRENT_SOURCE_DIR}/ext2.S ${CMAKE_CURRENT_BINARY_DIR}/ext2.bin 0)
7+
CreateBootSectorTarget(ext ${CMAKE_CURRENT_SOURCE_DIR}/ext.S ${CMAKE_CURRENT_BINARY_DIR}/ext.bin 7c00)
8+
CreateBootSectorTarget(extldr ${CMAKE_CURRENT_SOURCE_DIR}/extldr.S ${CMAKE_CURRENT_BINARY_DIR}/extldr.sys 8000)
89

910
CreateBootSectorTarget(fat ${CMAKE_CURRENT_SOURCE_DIR}/fat.S ${CMAKE_CURRENT_BINARY_DIR}/fat.bin 7c00)
1011
CreateBootSectorTarget(fat32 ${CMAKE_CURRENT_SOURCE_DIR}/fat32.S ${CMAKE_CURRENT_BINARY_DIR}/fat32.bin 7c00)
@@ -31,7 +32,8 @@ if(ARCH STREQUAL "i386" OR ARCH STREQUAL "amd64")
3132
CreateBootSectorTarget(isombr ${CMAKE_CURRENT_SOURCE_DIR}/isombr.S ${CMAKE_CURRENT_BINARY_DIR}/isombr.bin 7000)
3233

3334
add_cd_file(TARGET dosmbr DESTINATION loader NO_CAB FILE ${CMAKE_CURRENT_BINARY_DIR}/dosmbr.bin FOR bootcd regtest)
34-
add_cd_file(TARGET ext2 DESTINATION loader NO_CAB FILE ${CMAKE_CURRENT_BINARY_DIR}/ext2.bin FOR bootcd regtest)
35+
add_cd_file(TARGET ext DESTINATION loader NO_CAB FILE ${CMAKE_CURRENT_BINARY_DIR}/ext.bin FOR bootcd regtest)
36+
add_cd_file(TARGET extldr DESTINATION loader NO_CAB FILE ${CMAKE_CURRENT_BINARY_DIR}/extldr.sys FOR bootcd regtest)
3537
add_cd_file(TARGET btrfsvbr DESTINATION loader NO_CAB FILE ${CMAKE_CURRENT_BINARY_DIR}/btrfs.bin FOR bootcd regtest)
3638
add_cd_file(TARGET fat DESTINATION loader NO_CAB FILE ${CMAKE_CURRENT_BINARY_DIR}/fat.bin FOR bootcd regtest)
3739
add_cd_file(TARGET fat32 DESTINATION loader NO_CAB FILE ${CMAKE_CURRENT_BINARY_DIR}/fat32.bin FOR bootcd regtest)

0 commit comments

Comments
 (0)