blog:pushbx:2025:1117_ldebug_and_ldos_boot_experimental_loader_support
Table of Contents
lDebug and lDOS boot experimental loader support
2025-11-16
LZEXE
In the lzexedat.sh script, redirect the null device into the dosemu2 process to avoid accidentally activating the input detection of the bootloadable lDebug (in the line if (rc == 0 && ioi == 0) then q).
lDOS boot experimental
- boot32: Note magic bytes for loader support. This is to allow patching the first stage loader so it assumes its second stage (FSIBOOT) is already present in memory, rather than trying to load it from the disk.
- iniload: Add loader support signature and pass through an lsvExtra flag.
- Fix: Pass through the lsvExtra flag properly, not the lsvExtra partition byte.
- Loader:
- Initial commit. This just loads a debugger.
- Support the size query entrypoint, returning the low limit needed for later relocation.
- Provide the placement and debug entrypoints. Placement relocates the loader back to 00600h (and restores the EBDA) while debug is just a hello world program at this point.
- Add _PADDING define to allow enlarging the loader, up to 65520 Bytes.
lDebug
- In mak.sh add the use_build_skip_help option variable to allow re-using the already assembled and compressed help pages instead of recreating them.
- Extract the function get_size_and_ebda from boot_initcode.
- Detect a loader and call its query function if found. Doesn't use the result yet.
- Relocate the early init and images to a higher spot if needed to free up the loader's low limit. This only happens if neither the init nor the images were relocated to a lower position yet. If the lower limit isn't satisfied after having relocated lower, abort with an OOM error. This allows a fairly simple relocation scheme for the relocation to a higher position. (Also calls loader's relocation function.)
- Initialise registers for the loader debug entry, do not set the dif3_gotint19 flag in that case. That means memory at 00600h is preserved, which will hold the loader at this point.
- Enable the loader support of the initial loader (signature and pass the flag).
- Drop an int3 breakpoint left over from development.
ETA:
- Fix a bug that would lead to a crash when booting a _PM=1 build without the full loader being provided, due to a mixup with the different
@@anonymous local labels.
You could leave a comment if you were logged in.
blog/pushbx/2025/1117_ldebug_and_ldos_boot_experimental_loader_support.txt · Last modified: by ecm
