Table of Contents
Lots of work in early mid February
2025-02-16
inicomp
Eric Auer asked about the Snappy depacker of inicomp, so I adapted it for the test file mode of inicomp. In this mode, testfile.asm is assembled to create a depacker application. However, it loads the entire packed file into memory and depacks it using the inicomp depacker protocol. So the available amount of memory (largest block allocatable by 21.48) must be large enough to hold the combined buffer.
lDOS boot
Optimise the iniload relocator. If multiple chunks need to be relocated, then all but the last one must be full 64 KiB chunks. After relocating a full 64 KiB, the offset registers SI and DI are zero again so we needn't re-initialise them. Test cases for loading lCDebugX from lDebug included in the changeset message. This optimisation saves 4 bytes in the ever-important initial loader (the 1536 bytes at the start of the file that must at least be loaded for MS-DOS v6 and lDOS load protocols).
tractest convlist.pl
- In the detailed sections display, support long module names even if a section doesn't have a group name. This helps with lDOS's new makefile that assembles everything from the repo root, so the module name and file name will both be longer.
- Support segment name aliases. This was useful during the intermediate revisions of lDOS in which DOSENTRY became an alias to BIOCODE, prior to actually splitting these two sections.
lDebug
Fix: Open .ELD and .SLD files (EXT command and Y command) as well as CO.ELD copy output files with the no-inherit flag in the debugger, to avoid leaking file handles to the debuggee on 21.4B or 21.55.
callver
- Split reportsmessage off kernel type
-
- OEM 5Eh: RxDOS
- OEM EEh: EDR-DOS
- OEM 26h: lDOS
- OEM DCh: DOS-C
- OEM 00h and 21.4452 not supported: IBM-DOS
- OEM 00h and 21.4452 supported: DR-DOS
- OEM FDh (as before): FreeDOS
- else: Other
- Display the OEM ID as a hexadecimal byte value
lDOS
As of Friday, the MS-DOS v4.01 based lMS-DOS is rebranded as lDOS. It now returns 26h as its OEM ID (21.3000) and v5.26 as the version number (both 21.30 and 21.3306). The default kernel filename is now ldos.com, with a compressed drload-kernel as ldospak.sys. The iniload signature now reads "lDOS" rather than "lDMS". There is a startup message added after the DOSDATA segment is initialised (before filling UPBs and DPBs) which reads "Starting small lDOS (Month) based on MS-DOS v4.01" (re-using the 21.33FF version string).
Detailed list of changes:
- Correct the end condition for the kernel command line processing. This is actually almost a no-op because it only affects things if the last command is empty.
- In dos/msinit.nas do not list new section directives if DONOBITS defined. This helps convlist.pl when creating a trace listing file for the sharer.
- Put all kernel and sharer sections into groups. This was reverted later because of the change to convlist.pl which made it obsolete.
- In sharer avoid empty TEXT sections.
- Add convmake.pl script to help with converting makefiles
- Use convmake.pl to create a makefile template for building the kernel and the sharer
- Add shell scripts to run WarpLink and x2b2 using dosemu2. This converts forward slashes to backslashes, except if they occur at the start of a parameter. This happens to work with the inputs we provide.
- In the WarpLink and x2b2 scripts allow to specify dosemu executable name
- Finish GNU make compatible makefile in repo root (edited from the template)
- Comment out old makefiles' entries for the message files
- In mak.sh call make and error out if it returns an error. Also, recognise the onlykern keyword.
It turns out that dosemu2 correctly passes the error level of an -E command back to the host script that called dosemu. This is very convenient for our new makefile.
- Add WarpLink response files for msbio.bin and share.exe building needed by new makefile.
- In mak.sh copy the two binaries created by GNU make into the repo root.
- In mak.sh do not create command.tls trace listing file if called with onlykern keyword parameter.
- Undo the changeset adding groups to all sections.
- In nasm.mac temporarily define DOSENTRY as an alias to BIOCODE
- Replace some uses of BIOCODE by DOSENTRY
- In dos/msinit.nas only initialise first 128 bytes of init PSP.
- Fix 2F.0803 call to return correct first UPB segment rather than segment 70h
- In msvolid.nas skip LFNs instead of matching them as volume labels
- In dcodeseg.nas add DOSBIOCODE (an early addition to the DOSCODE segment ahead of the other BIOCODE users)
- The big change to address DOSENTRY with ds or es, rather than cs. Also adds the DOSENTRY define to msbio1.nas for use by convlist.pl so we can create trace listing files. Many users of DOSENTRY variables will now call the new biocode_get_ds/es_dosentry functions, and preserve their original ds or es on the stack.
It seems that MS-DOS v5 chose to address what we call DOSENTRY (segment 70h) using DS throughout. This required changing things so the current UPB is addressed using ES:DI rather than DS:DI. Obviously this choice is valid but I think ours is just as good.
- Replace some more uses of BIOCODE by DOSENTRY
- Drop FLAGBITS variable no longer used
- Prepare ispatched function for msbio/msdisk.nas, as well as msbio/ms96tpi.nas
- Replace PURGE_96TPI patches by using ispatched function
- Move BIOCODE section directives from msdos files into entryseg.nas
- Include entryseg.nas in msbio1.nas
- Comment out the ms96tpi PATCHTABLE (no longer used)
- Add debug numbers output to sysconf.nas, commented out in a single spot. The callers use a macro that can be enabled by changing the single spot.
- Split DOSENTRY and BIOCODE. This was relatively painless after the preparations of prior changesets.
- Prefer the configuration filename ldos.ini to config.sys (part of rebrand)
- Implement the 2F.4A00 disk change notification callout. This was easy enough, but it turns out dosemu2 incorrectly interfered with this call when switching from the B: drive to A:. (Also, MS-DOS v5 sets DH as
DL ^ 1so it may not work as intended for drives other than A: and B:. FreeDOS and lDOS set DH from the block device unit number from the old UPB instead.) - Add the minimal (5 entries) Interrupt Restoration Table to 70h:100h. Initialise it. OLD13 variable now part of this IRT.
- In the interrupt 19h handler use the entire IRT.
- Fix sharer build with new makefile: The parent directory of the source file to build must be included first, or sharer gets the wrong message server include file.
- In sharer's MCB walker check for a valid PSP by comparing the word at offset 0 to 20CDh (int 20h opcode)
Both lDOS TSRs (RxANSI, lClock, example, KEEPHOOK, SEEKEXT, IDLEDPMS) and FreeDOS devload will create self-owned MCBs that do not contain a valid PSP. Avoid possibly corrupting memory on encountering them. The lDOS applications will behave this way for /J0 which is still the default. /J1 to /J4 will avoid the misleading MCB contents, at the cost of some memory and possibly legibility in memory listers.
- In sharer's MCB walker call 2F.1261 to find first UMCB, and continue to walk it even if the last LMCB has a 'Z' signature
- Rename kernel files to ldos.com, ldospak.sys
- Use lDOS signature rather than lDMS
- Set OEM number 26h for lDOS
- Add checks for alternative version number to most programs
- Report lDOS kernel version as 5.26
- Update lDOS version string to 2025 February
- In sharer support empty PHT
- In sharer's MCB walker add loop detection
- Default to LZSA2 compression method for kernel
- Fix ms96tpi.bas function CHECKIO re-using CHECKFATRET. The latter now pops ES (used to address DOSENTRY) so the re-use became invalid.
- Change ms96tpi_i13 to use a far call to DOSENTRY:transfer_real13 rather than juggling the stack to transfer to the address in DOSENTRY:REAL13
- Add amis.mac from tsr example repo
- In sharer use an IISP entry header to support AMIS TSRs that may want to find the sharer's int 2Fh downlink
I also added a section on the lDOS kernel to the webbed page.
