2024-02-25
This week some development on lmacros, instsect, lDebug, and EDR-DOS and FreeDOS happened.
Add the fill_at_least
macros to avoid an overflow in the debugger letting the entire build fail. Instead, the field will be filled if its content is shorter, but allowed to assemble as well if the content is as long as or longer than the fill length.
Two bugfixes: Unlock the correct drive after sector access. And lock the drive even for MS-DOS v7.00 which does not have the "new packet" interface but does require the locking for writing to a disk using int 26h.
fill_at_least
to avoid overflows blocking the buildThe change to the AMIS description line is related to rel.sh deleting the listing files. Upon release 8, the current daily build of the same day as the release will contain the listing files that fit the release build. Moreover, as the release build is never debuggable, the listing files are not very ueful to a user. (Map files are retained as they are relatively small.)
An issue report to the SvarDOS EDR-DOS repo noted that EDR-DOS uses the "hidden sectors" fields of the EBPBs in its UPB (UDSC) in a different way than MS-DOS. In EDR-DOS, the hidden sectors are always treated as an absolute sector in the int 13h unit.
I weighed in that this is what I consider correct because it enables booting off logical partitions, which no one ever does but my loaders generally support.
Further, I examined the UPBs / UDSCs / DDTs of MS-DOS v6.22 (CHS only, no FAT32), v7.00 (CHS or LBA, no FAT32), and v7.10 (CHS or LBA, with FAT32), and EDR-DOS and the FreeDOS kernel. I found that the free kernels pad the EBPBs with different reserved bytes than MS-DOS v7.10, and both add 4 more bytes at the end for different uses.
In CHS mode, MS-DOS (all examined versions) does something odd: The hidden sectors are within the extended partition, and the "cylinder" of the extended partition start is noted in a 16-bit field in the UPB. This is however not added to the hidden sectors to calculate the absolute sector number. Rather, after adding the hidden sectors, the block device will calculate the CHS tuple and only then adds the extended partition start cylinder to the cylinder value of that tuple. This means it will only work correctly if the extended partition starts on a cylinder boundary, as the CHS heads and CHS sectors are never adjusted by the addition.
In LBA mode, MS-DOS v7 (both versions) acts much more like EDR-DOS. FreeDOS instead stores the absolute hidden sectors amount in another new variable in the DDT structure.