Table of Contents
Cleanup, InDOS, trampoline, INSTALLFIRST= lDOS kernel work in August
2025-08-24
wwwecm scripts
- Add tlsfiles to update script.
- Always run mak.sh of tlsfiles, even if no update has been pulled.
tlsfiles
This repo collects all build dl wwwecm .tls files and logs them into hg for public read access using hgweb.
- Add script file to grab .tls files from ~/build-dl-wwwecm/
- Hardcode push destination as ~/webrepos/tlsfiles
- Ignore files already in our directory (tlsfiles)
patchini
- Correct the DOS executable filenames to .COM as they apparently are flat-format files, not segmented MZ executables. (gcc-ia16 defaults to tiny model?)
- Add the combined patldos tool which can operate on the lCFG fields for inicomp depack progress choice, debugger detection, and the lDOS scan mode.
The idea with the combined tool is to decrease the total size of the three tools, as each executable file needs more than 20 kB when compiling them with gcc-ia16.
lDOS (lMS-DOS) kernel
- Fix to sumspace use, only detect incbin directives that actually emit code.
- Include the combined patldos tool into the lDOS comloader (second payload executable image).
- Parse mode table with known scan mode keywords for SCANMODE= kernel command line command. (I started out moving the kernel command line parser into SYSINIT because it needs the
isstring?andskipcommafunctions that we had in SYSINIT. Eventually I undid this and simply called far into the early (pre-relocation) SYSINIT using an immediate far call, only as a subfunction to parse the scan mode keywords.) Picked the table of known keywords from lDebug's chstool.eld - Handle empty SHELL= directive correctly.
- In OKLDX device driver load do not corrupt int 21h function 4B03h Carry Flag.
- Parse FCBs from the command line for INSTALL=
- Properly store I NUL LF for empty INSTALL= command. (The "I" is the command letter, NUL is a 00h byte, and LF is a Line Feed.)
- Fix empty DEVICE= deallocating the prior device driver.
- Add backdoor indicator to be able to tell SYSINIT has been freed yet or not.
- Return to SYSINIT on shell exec failure, prompt for a new shell command.
- Fix a typo in a comment.
- Rename the sysinit return address to shell return address, and the indicator flag likewise.
- Use a near return trampoline for relocated_relocatedentry, to ease debugging. Prepare device entrypoint for common re-use. (This used to push the table address and unit number. I decided to adjust it so it pushes the original SI and AX values and places the parameters into these registers.)
- Support a second unit number byte for relocate mmacro.
- Use the relocateddeventry or relocateddevprnentry entries for all device entrypoints.
- Add an option that allows to disable the DOSCODE entry trampoline.
- Move deventry and devprnentry to early in DOSCODE, allowing to drop one of the two comparisons and branches as we can check in one comparison that the address is below-or-equal a certain offset.
- Move DOSCODE entry error handler out of the control flow, saving a branch on the main path.
- Delete most unused files in the msbio directory.
- Delete most unused files in the msdos directory.
- Drop the .obj to .fob (fixupp) step for all NASM ported files, as it is useless. Exact match of the binaries.
- Create share and format .tls files when called from update dl script.
- Modify InDOS flag differently to better protect variables, helping debugging.
- In ctrlc.nas on termination return to the parent process.
- In exec.nas int 21h function 4B05h return to user.
- In ms_code.nas for int 25h/26h entries. This involves pushing the DOS DS to the user stack frame that was already being created to restore the user DS and SI.
- In exec.nas when entering a new process (function 4B00h).
- In ctrlc.nas modify InDOS closer to the int 24h call.
- Note for ms_code.nas that ILEAVE must preserve the Carry Flag to return from int 25h/26h. This was true already but not noted sufficiently.
- Update a comment's pronoun in disp.nas
- In ctrlc.nas fix releasing process memory to occur after DOS_ABORT call, as the latter needs to access the process's handle table that would likely be freed already. (FreeDOS follows this convention as well.)
- Add the INSTALLFIRST= (and INSTALLFIRSTHIGH=) directive. This is handled like INSTALL= in DR-DOS, that is it is processed in the same pass as DEVICE= directives.
- Add the COMPAT= options (NO)INSTALLASFIRST and (NO)INSTALLASLAST to handle the INSTALL= differently, either like INSTALLFIRST= or like INSTALLLAST= (and corresponding HIGH directives). (COMPAT=INSTALLASLAST overrides the other option if both are set.)
- Add INSTALLMID= directive which always runs in the same pass as lDOS's default INSTALL=, even if the default INSTALL= runs like INSTALLFIRST= or like INSTALLLAST=
- Delete an int3 left over for debugging.
- Add COMPAT= option (NO)PRESERVECDS, default on. This preserves the existing CDS drive entries during the final CDS relocation, like fdpp and Enhanced DR-DOS v7.01.07+. (Unlike MS-DOS and FreeDOS.)
- Undo a weird AND instruction left over from a use with constant zero, presumably.
- Add new function TEMPCDS_after_block_device which only inits new CDS entries and preserves the ones of earlier drives. This matches the fdpp behaviour before today.
- Add COMPAT= option (NO)REINITCDS to switch back to the old (EDR-DOS compatible) behaviour of rewriting all CDS entries whenever a block device is installed.
The idea with the CDS changes is to allow a redirector (like dosemu2's emufs.sys) to redirect drives early during the DEVICE= or INSTALLFIRST= pass and not re-init these CDS entries but rather preserve them up to the final placement of the CDS.
This is still incomplete; ideally, a redirector application that creates drives (like shsucdx) should also be able to run in INSTALLFIRST= and its drives should not be overwritten by any subsequent block devices. This is not yet supported.
The INSTALLFIRST= support is based on the fact that DR-DOS apparently processes INSTALL= in the same pass as DEVICE=, as I learned recently. Aside from data structure questions like the CDS and other relocations, the main hurdle for INSTALLFIRST= was MS-DOS's use of free memory, or in other words a not fully initialised MCB chain, which we already fixed a while ago to always utilise MCBs starting as soon as NEARDOSINIT completes.
