File tree Expand file tree Collapse file tree 2 files changed +20
-8
lines changed
Expand file tree Collapse file tree 2 files changed +20
-8
lines changed Original file line number Diff line number Diff line change 5858
5959;%define ISFAT12 1
6060;%define ISFAT16 1
61+ ;verify one and only one of ISFAT12 or ISFAT16 is defined
62+ %ifdef ISFAT12
63+ %ifdef ISFAT16
64+ %error Must select one FS
65+ %endif
66+ %elifndef ISFAT16
67+ %error Must select one FS
68+ %endif
6169
6270
6371segment .text
@@ -104,15 +112,11 @@ Entry: jmp short real_start
104112 ; The filesystem ID is used by lDOS's instsect (by ecm)
105113 ; by default to validate that the filesystem matches.
106114%ifdef ISFAT12
107- db "FAT12"
108- %ifdef ISFAT16
109- %error Must select one FS
110- %endif
115+ %define FATFS "FAT12"
111116%elifdef ISFAT16
112- db "FAT16"
113- %else
114- %error Must select one FS
117+ %define FATFS "FAT16"
115118%endif
119+ db FATFS
116120 times 3Eh - ($ - $$) db 32
117121
118122; using bp-Entry+loadseg_xxx generates smaller code than using just
@@ -417,6 +421,14 @@ read_next:
417421 mov dl , [ drive ]
418422
419423 ; NOTE: sys must be updated if location changes!!!
424+ %ifdef ISFAT12
425+ %define LBA_TEST_OFFSET 179h
426+ %elifdef ISFAT16
427+ %define LBA_TEST_OFFSET 176h
428+ %endif
429+ %if ($ - Entry) != LBA_TEST_OFFSET
430+ %error Must update constant offset (LBA_TEST_OFFSET) to test dl , dl here and in sys.c for FATFS
431+ %endif
420432 test dl , dl ; don't use LBA addressing on A:
421433 jz read_normal_BIOS ; might be a (buggy)
422434 ; CDROM-BOOT floppy emulation
Original file line number Diff line number Diff line change @@ -1560,7 +1560,7 @@ void put_boot(SYSOptions *opts)
15601560 /* !!! if boot sector changes then update these locations !!! */
15611561 {
15621562 unsigned offset ;
1563- offset = (fs == FAT16 ) ? 0x175 : 0x178 ;
1563+ offset = (fs == FAT16 ) ? 0x176 : 0x179 ;
15641564
15651565 if ( (newboot [offset ]== 0x84 ) && (newboot [offset + 1 ]== 0xD2 ) ) /* test dl,dl */
15661566 {
You can’t perform that action at this time.
0 commit comments