Reply 60 of 70, by kjliew
The definition of IBM PC standard Int13h
CH[7:0] = Cylinder[7:0]
CL[5:0] = Sector, CL[7:6] = Cylinder[9:8]
DH[7:0] = Head[7:0]
There are 24-bit addressing for blocks, 0x000000 for the 1st block and 0xFFFFFF for the last block. This is how DOSBox internal Int13h handler manages the translation, sort of a simplified linear LBA scheme. Since the patch was meant for DOSBox, there isn't any compatibility concerns.
BTW, parted can work on image file, too, IIRC, and should be able to create the MBR partition and FAT filesystem that DOSBox can boot. Just remember that the FAT partition type should be non-LBA. Parted supports toggling off the LBA flag. And, fdisk gives you precisely the partition type to set. If toggling LBA flag in parted did not work, then you just use fdisk to create the MBR partition and set type. Then use parted to create the FAT filesystem. I guess this is the part that you missed, both parted and fdisk set LBA flag by default. Then you just need to boot DOSBox with floppy image and SYS C: to make it bootable.
I wasn't 100% sure as I haven't gone through the workflow. I maybe able to do that shortly and get back to you. I knew I was able to use QEMU to prepare the disk image, then all I need is to remove the LBA flag and DOSBox can boot the image. So I think it is possible to do the same with parted/fdisk/mkfs without QEMU.