User Tools

Site Tools


blog:pushbx:2022:1111_ldebug_bootunitflx_flag_2_to_force_using_bpb_geometry

lDebug: BOOTUNITFLx flag 2 to force using BPB geometry

After having found that some pcjs.org machines report wrong CHS geometries on function 13.08, I prepared a flag that can be set in lDebug's BOOTUNITFLx variables to force falling back to the geometry noted in a unit's BPB. (For now this blindly assumes that the unit starts with a boot sector with BPB, even if the unit is actually >= 80h and partitioned with an MBR.)

This is a hack, and probably will be extended or replaced by something better, but it does work insofar as what it's intended to do. I also prepared a small test case to check that it works, at https://pushbx.org/ecm/test/20221111/geofake.txt

0060:0000 B80000            mov     ax, 0000
0060:0003 8ED8              mov     ds, ax
0060:0005 668B1E4C00        mov     ebx, [004C]
0060:000A 0E                push    cs
0060:000B 680010            push    word 1000
0060:000E 662E891E0020      mov     [cs:2000], ebx
0060:0014 668F064C00        pop     dword [004C]
0060:0019 90                nop
0060:001A CC                int3
0060:001B 90                nop

0060:1000 80FC08            cmp     ah, 08
0060:1003 751B              jnz     1020
0060:1005 9C                pushf
0060:1006 2EFF1E0020        call    far [cs:2000]
0060:100B 7203              jb      1010
0060:100D B10F              mov     cl, 0F
0060:100F 90                nop
0060:1010 55                push    bp
0060:1011 89E5              mov     bp, sp
0060:1013 D05E06            rcr     byte [bp+06], 1
0060:1016 D04606            rol     byte [bp+06], 1
0060:1019 5D                pop     bp
0060:101A CF                iret

0060:1020 2EFF2E0020        jmp     far [cs:2000]

Before running the interrupt handler interception, try boot dir fda (on a typical 1440 KiB 90mm diskette drive). It will list the directory entries. Run the interception. boot dir fda will show nothing now. Run r bootunitfl(0) or= 2. The directory listing works again.

Discussion

C. MaslochC. Masloch, 2022-11-18 19:23:28 +0100 Nov Fri

The flag to force reading geometry from the BPB was changed to 4 to somewhat match the query patch facility of iniload, which uses the flag 4 to re-use the BPB's values as passed by the prior loader. Flag 2 is now the force LBA access flag, exactly matching query patch's flag 2. Flag 1 is, as before, force CHS access.

You could leave a comment if you were logged in.
blog/pushbx/2022/1111_ldebug_bootunitflx_flag_2_to_force_using_bpb_geometry.txt · Last modified: 2022-11-11 21:11:12 +0100 Nov Fri by ecm