| Title | [lDOS boot] Add options for disabled LBA / auto-HDD LBA detection templates in boot sector loaders |
|---|---|
| Author | E. C. Masloch |
| Created | 2026-06-17 01:31:26 +0200 Jun Wed |
| State | closed |
The options were introduced by instsect's LBA code search and patch patterns first. They should match the instsect code.
These are for including code for LBA access or the HDD-only LBA use attempts but disabling them by default, with the magic bytes and code template present to allow instsect to patch the loader so as to allow enabling these features. (If these features are completely disabled then instsect cannot patch them enabled.)
Adds the _FORCE_CHS option (disable LBA completely) and the
_LBA_HDD_ONLY_DISABLED option (disable skip LBA for diskettes).
The latter disable option will treat diskettes and hard disks
in just the same way (so LBA may still be used).
Reference: https://hg.pushbx.org/ecm/instsect/file/17a79f48fff1/lbasuch.asm#l136
Note some oddities:
If _FORCE_CHS and _LBA_HDD_ONLY are both enabled,
then the code for _LBA_HDD_ONLY_DISABLED should actually be used.
Failure to do so results in instsect not recognising any template.
If _FORCE_CHS is enabled and _LBA_SKIP_CHECK is disabled,
then the int 13h calls that actually read (function 42h) are
also patched to no-ops even though there is no need for this.
This complicates the patching but is likely not harmful.
Appears to have happened on accident in instsect.
Open question: Is the instsect LBA search prefix-free? If not, take measures to prefer the better (larger?) match.
Added in hg cd59a044016e today.