Author: hbelusca
Date: Sat Dec 26 16:57:41 2015
New Revision: 70423
URL:
http://svn.reactos.org/svn/reactos?rev=70423&view=rev
Log:
[BOOTSECTORS]
- Use the old fat.S source for compiling the FAT12 boot sector, until FATX.S is completely
implemented.
- Fix an assembly error in FATX.S
- In comments I added experimental FAT12/16/32 targets based on Timo's FATX.S.
Modified:
trunk/reactos/boot/freeldr/bootsect/CMakeLists.txt
trunk/reactos/boot/freeldr/bootsect/fatx.S
Modified: trunk/reactos/boot/freeldr/bootsect/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/bootsect/CMak…
==============================================================================
--- trunk/reactos/boot/freeldr/bootsect/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/bootsect/CMakeLists.txt [iso-8859-1] Sat Dec 26 16:57:41
2015
@@ -3,8 +3,21 @@
CreateBootSectorTarget(dosmbr ${CMAKE_CURRENT_SOURCE_DIR}/dosmbr.S
${CMAKE_CURRENT_BINARY_DIR}/dosmbr.bin 7c00)
CreateBootSectorTarget(ext2 ${CMAKE_CURRENT_SOURCE_DIR}/ext2.S
${CMAKE_CURRENT_BINARY_DIR}/ext2.bin 0)
- CreateBootSectorTarget(fat ${CMAKE_CURRENT_SOURCE_DIR}/fatx.S
${CMAKE_CURRENT_BINARY_DIR}/fat.bin 7c00)
+
+ CreateBootSectorTarget(fat ${CMAKE_CURRENT_SOURCE_DIR}/fat.S
${CMAKE_CURRENT_BINARY_DIR}/fat.bin 7c00)
CreateBootSectorTarget(fat32 ${CMAKE_CURRENT_SOURCE_DIR}/fat32.S
${CMAKE_CURRENT_BINARY_DIR}/fat32.bin 7c00)
+
+ ## New versions using FATX.S (experimental)
+ # add_definitions(-DFAT12)
+ # CreateBootSectorTarget(fat_new ${CMAKE_CURRENT_SOURCE_DIR}/fatx.S
${CMAKE_CURRENT_BINARY_DIR}/fat_new.bin 7c00)
+ # remove_definitions(-DFAT12)
+ # add_definitions(-DFAT16)
+ # CreateBootSectorTarget(fat16_new ${CMAKE_CURRENT_SOURCE_DIR}/fatx.S
${CMAKE_CURRENT_BINARY_DIR}/fat16_new.bin 7c00)
+ # remove_definitions(-DFAT16)
+ # add_definitions(-DFAT32)
+ # CreateBootSectorTarget(fat32_new ${CMAKE_CURRENT_SOURCE_DIR}/fatx.S
${CMAKE_CURRENT_BINARY_DIR}/fat32_new.bin 7c00)
+ # remove_definitions(-DFAT32)
+
CreateBootSectorTarget(isoboot ${CMAKE_CURRENT_SOURCE_DIR}/isoboot.S
${CMAKE_CURRENT_BINARY_DIR}/isoboot.bin 7000)
CreateBootSectorTarget(isobtrt ${CMAKE_CURRENT_SOURCE_DIR}/isobtrt.S
${CMAKE_CURRENT_BINARY_DIR}/isobtrt.bin 7000)
Modified: trunk/reactos/boot/freeldr/bootsect/fatx.S
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/bootsect/fatx…
==============================================================================
--- trunk/reactos/boot/freeldr/bootsect/fatx.S [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/bootsect/fatx.S [iso-8859-1] Sat Dec 26 16:57:41 2015
@@ -64,7 +64,8 @@
******************************************************************************/
/* We have 3 bytes at the entry point to jump over the data area */
start:
- jmp short main
+ jmp short main // FIXME: When compiling FAT32, assembler will complain
+ // that the label is too far... Need investigation!
nop
/* Here starts the BIOS Parameter Block (BPB) data.
@@ -233,8 +234,8 @@
add eax, dword ptr BP_REL(HiddenSectors)
/* Load sector count into ecx */
-#if FAT32
- mov ecx, BP_REL(SectorsPerFatBig)
+#ifdef FAT32
+ mov ecx, dword ptr BP_REL(SectorsPerFatBig)
#else
movzx ecx, word ptr BP_REL(SectorsPerFat)
#endif
@@ -350,7 +351,7 @@
dec dx
jnz .CheckDirEntry
-#if FAT32
+#ifdef FAT32
/* Check to see if this was the last cluster in the chain */
cmp eax, HEX(0ffffff8)
jnb BootFailure
@@ -367,7 +368,7 @@
.FoundFreeLoader:
/* Load the cluster number of freeldr into eax */
-#if FAT32
+#ifdef FAT32
#error unsupported
#else
movzx eax, word ptr es:[bx + HEX(1A)]
@@ -384,9 +385,9 @@
call ReadCluster
/* Check if this is the last cluster in the chain */
-#if FAT32
+#if defined(FAT32)
cmp eax, HEX(0ffffff8)
-#elif FAT12
+#elif defined(FAT12)
cmp ax, HEX(0ff8)
#else
cmp ax, HEX(0fff8)
@@ -453,9 +454,9 @@
/* Save ES */
push es
-#if FAT32
-#error FAT23 not implemented
-#elif FAT12
+#if defined(FAT32)
+#error FAT32 not implemented
+#elif defined(FAT12)
#error FAT12 not implemented
#else
/* DX:AX = AX * 2 (since FAT16 entries are 2 bytes) */