====== A variety of progress ====== **2025-08-30** As August's end nears, this week I did a lot of things. ===== patchini ===== [[https://hg.pushbx.org/ecm/patchini/rev/bfabe3bc2849|List the supported flags as hex as well]], if they are >= 16 and not part of a dual-flag entry. This makes it easier to determine how to combine flags, or specify single ones using + or -. Fix: [[https://hg.pushbx.org/ecm/patchini/rev/6c571fdcff11|List the progress choices as types]] (0, 1, 2, 3, 4) rather than flags (1, 2, 4, 8, 16). ===== renumber ===== This program allows to renumber the AMIS multiplex number of a resident AMIS multiplexer if its int 2Dh entrypoint follows a certain format. Of course, our TSRs all do follow this format. * [[https://hg.pushbx.org/ecm/renumber/rev/374efa9cb73e|Update initial]] to ecm, and attribution year. * [[https://hg.pushbx.org/ecm/renumber/rev/6ded1c17c887|Comment out the debugger detection]] as its result is never used. * [[https://hg.pushbx.org/ecm/renumber/rev/8ddbb34e6650|Detect if the two numbers are the same]], rather than detecting the number as being in use. * If the 2nd number is not free, [[https://hg.pushbx.org/ecm/renumber/rev/7113d17e8f3e|display its status]]. * [[https://hg.pushbx.org/ecm/renumber/rev/99b98263dde4|Likewise]] if it isn't free but write is forced with the /F switch. * [[https://hg.pushbx.org/ecm/renumber/rev/95347488d733|Comment out the unused getdecit function]]. ===== Instruction reference ===== [[https://hg.pushbx.org/ecm/insref/rev/10e2ef760411|Note the equivalent instructions]] using AL for cmpsb, insb, movsb, and outsb. The particularly interesting one is ''lodsb'' followed by ''scasb'' for cmpsb, as it implies that scasb is like ''cmp al, [es:di]'' because cmpsb is like ''cmp byte [si], [es:di]'' ("source index" first). Sometimes, like for the AMIS check id function, it is relevant which way the scasb comparison is. ===== tractest ===== Adds the sortmap.pl script, which extracts the interesting bits from the WarpLink extended map file's detailed segment map and sorts the file sections according to the binary order of the full sections instead of according to the files. * [[https://hg.pushbx.org/ecm/tractest/rev/229e475f4db1|Initial commit]] of sortmap.pl * Add -%%%%-list-empty switch [[https://hg.pushbx.org/ecm/tractest/rev/5b187c0a6c07|to list empty sections once]], if they do not occur at all in the dump otherwise. * Fix, [[https://hg.pushbx.org/ecm/tractest/rev/ddb7fa5d8b16|OMF PAGE alignment means 256 Bytes]], not 512 Bytes. The remaining two changes are not only on sortmap.pl: * [[https://hg.pushbx.org/ecm/tractest/rev/22ec13b61e95|Support 4KIB alignment in map files]], matching the new support in WarpLink. * listvars.pl: [[https://hg.pushbx.org/ecm/tractest/rev/a5bb2ec9419c|Recognise relocated mmacro as defining a label]]. ===== WarpLink ===== During testing the sortmap.pl script, I found that one file section showed up with an alignment of "512" (should read "256") or, in the map file, "PAGE". Curiously enough, the actual alignment seemed to be on a byte boundary. I created some tests to see how NASM emits the different possible alignments, and studied the [[https://github.com/boeckmann/omfdump|omfdump]] and WarpLink extended map file outputs of those. (I [[https://bugzilla.nasm.us/show_bug.cgi?id=3392948|found a NASM bug during this]], where it is supposed to emit a warning if it rounds up an alignment, but the warning only shows up if an error is emitted.) Sure enough, out of the 7 possible values for alignment, WarpLink only supported BYTE, WORD, PARA, and PAGE. The unsupported DWORD, 4KIB, and a remaining invalid value where handled in different ways in the three spots relevant to this. That's how we observed a "PAGE" alignment in the map file but the section wasn't actually aligned to a 256-byte boundary. Through the wonders of free software I determined where the alignment is read, and added support for NASM's DWORD and 4KIB alignment. The changes in particular: * [[https://hg.pushbx.org/ecm/warplink/rev/6ab94e11b3cb|Initial commit]] of the support. * [[https://hg.pushbx.org/ecm/warplink/rev/65dcbe032e09|Increment ecm release]] to release 1. * Bugfix, [[https://hg.pushbx.org/ecm/warplink/rev/bfd7729482b8|do not add wrong offset to stack segments]], a bug introduced by the initial commit. * [[https://hg.pushbx.org/ecm/warplink/rev/319bf908e2e5|Refactor into a function align_ax_from_bl]] which uses a table for the 8 possible values of the A field of the acbp byte. (The zero value is never used as it indicates an absolute segment.) The function is called twice. * [[https://hg.pushbx.org/ecm/warplink/rev/1343b0f413eb|Increment ecm release]] to release 2. ===== lDOS kernel ===== * [[https://hg.pushbx.org/ecm/msdos4/rev/53b85dd6afb3|Optimise int 2Fh handlers]], eliminating two far jumps and relocating entries in DOSENTRY. (This unnecessary use of DOSENTRY space was the main reason to do this.) Now, the head i2F handler (set_i13_i2F) will chain using near jumps to disk_i2F and msdos_i2F. Also some more optimisation. The RE_INIT function in SYSINIT is now empty as it only initialised the msbio int 2Fh handler atop the msdos one installed by NEARDOSINIT. * msbdata.nas: [[https://hg.pushbx.org/ecm/msdos4/rev/18e66b634ba3|Move strategyentry elsewhere]] to collect padding. * code.asm: [[https://hg.pushbx.org/ecm/msdos4/rev/3ac8adf09acd|Move an xchg instruction into DOSCODE]] to save a byte of DOSENTRY. * [[https://hg.pushbx.org/ecm/msdos4/rev/613ecf913bdc|Add AMIS entry and related data]] to DOSENTRY. The int 2Dh entry comes with a full standard IISP header, and a renumber-compatible comparison to a multiplex number, chaining with a far indirect jump to the downlink. This downlink is initialised to point to entry_iret, but being fully functional it is valid for other applications to patch this downlink to point elsewhere. The AMIS interrupt list (only listing int 2Dh) must live in the same CS as the IISP header. The AMIS signatures could live elsewhere but for compatibility I put them into DOSENTRY too. (All of them are addressed using segment 26h.) * [[https://hg.pushbx.org/ecm/msdos4/rev/ba3c65002027|Implement a basic AMIS multiplexer]], code located in DOSCODE. Functions 0, 4, and 10h. (Not compliant because function 2 is missing, and function 4 only lists the int 2Dh entrypoint without the terminal DOS interrupt handlers.) * [[https://hg.pushbx.org/ecm/msdos4/rev/fcbf6f85dc82|Add AMIS function 6]]. * [[https://hg.pushbx.org/ecm/msdos4/rev/693592bf0802|Move ldos_getnum into SYSINIT segment]]. This required putting a far function that calls this function near into a different file, as NASM's ''call far'' didn't seem to work correctly when both the call and the destination were in the same object file. * [[https://hg.pushbx.org/ecm/msdos4/rev/c27af38a0ef5|Add the AMISNUMBER= directive]] to ldos.ini * [[https://hg.pushbx.org/ecm/msdos4/rev/d1aba06c81f4|Fix ifsflink.asm with new code links]]. * [[https://hg.pushbx.org/ecm/msdos4/rev/798ebff0514a|Add AMIS function 11h]], check id. Only id entered yet is for the sharer. * [[https://hg.pushbx.org/ecm/msdos4/rev/172d65e8626a|Optimise checkid to compare the length and text]] using a single repeated string comparison instruction. * [[https://hg.pushbx.org/ecm/msdos4/rev/172d65e8626a|Add the dependency on msgserv.nas]] for sharesr.obj in the makefiles. * [[https://hg.pushbx.org/ecm/msdos4/rev/00e386c6bb67|Introduce the new expected DOS version]] (5.38) to the versiona.mac file. * [[https://hg.pushbx.org/ecm/msdos4/rev/cdc71e989e29|Add check_amis function]] to the sharer. If DOS version is returned as v5.26 and the multiplexer isn't found, accept. If it is returned as v5.26 and the multiplexer is found but function 11h isn't supported (returns al = 00h), accept. If the version is returned as v5.26 and the function 11h is supported, check the function return. If the version is returned as v5.38, the multiplexer must be found, the function 11h must be supported, and the function must return that the id is supported. The check id function is passed [[https://hg.pushbx.org/ecm/msdos4/rev/cdc71e989e29#l1.12|a structure]] that includes a reserved word, a sequential number, and a counted string as application ID. The DOS's multiplexer compares the ID and sequential against a table, returning an F0h to FFh return code to accept or an E0h to EFh return code to fail. The design of passing a sequential is copied from plans I had for lRxDOS v7.30 that never materialised. However, some of the parsing the table is offloaded to the multiplexer resident in the DOS, providing greater flexibility. * [[https://hg.pushbx.org/ecm/msdos4/rev/d6796127b26e|Change several segments in many applications to word alignment]], needed for the AMIS signature and id structures. * [[https://hg.pushbx.org/ecm/msdos4/rev/23fd89cdfebe|Add new version number]] (5.38) to versiona.inc * [[https://hg.pushbx.org/ecm/msdos4/rev/b2375d95d30b|Add all the other AMIS id structures]]. * [[https://hg.pushbx.org/ecm/msdos4/rev/e29dc4f68831|Add id version checks]] to the message servers. * [[https://hg.pushbx.org/ecm/msdos4/rev/9dee255b1d18|Extract idtable.asm from ms_code.nas]] and fill the table. * Bugfix, in check_amis [[https://hg.pushbx.org/ecm/msdos4/rev/65b6e929411d|preserve the AX return value of int 21h function 30h]] for the subsequent DOS v2 check. (It could detect DOS v1 instead and try to terminate with an int 20h not in the PSP CS, which crashed!) * [[https://hg.pushbx.org/ecm/msdos4/rev/4e06f49fbe82|Delete unused file]] versionc.h * [[https://hg.pushbx.org/ecm/msdos4/rev/2608d6384349|Fix chkdsk and Debug groups]] for addressing amis_sign. * [[https://hg.pushbx.org/ecm/msdos4/rev/38d40437acb5|Fix the id table entry for debug]] by passing the ID string as a quoted string rather than a token. * [[https://hg.pushbx.org/ecm/msdos4/rev/c2adede9fe20|Enable all id table entries]]. * [[https://hg.pushbx.org/ecm/msdos4/rev/dd89e3aafd2f|Change lDOS reported version number to v5.38]], requiring the AMIS check id function to indicate acceptance of an application. (As yet all sequentials are zero and the accepted sequentials range from zero to 00FFh, for every ID.) * [[https://hg.pushbx.org/ecm/msdos4/rev/eaef5ba71f89|Correct a comment typo in i2D handler]] in DOSCODE. That was it on the version checks. * [[https://hg.pushbx.org/ecm/msdos4/rev/7513ac45ac96|Share three entrypoints using an NC/CY status]] to save 3 bytes thrice. * [[https://hg.pushbx.org/ecm/msdos4/rev/d270bf55ac23|Move the run_int21_shell entry and incompatible_ALTAH variable earlier]] in the resident DOSENTRY section. * [[https://hg.pushbx.org/ecm/msdos4/rev/d4898dbe2d45|Update early ksection.txt descriptions some]]. * [[https://hg.pushbx.org/ecm/msdos4/rev/2fe9fd572d9e|Delete unused sysinitmcb template]]. * [[https://hg.pushbx.org/ecm/msdos4/rev/b0f53dbd8783|Branch to GOINIT directly]] instead of to SYSINIT with a near jump to GOINIT. * [[https://hg.pushbx.org/ecm/msdos4/rev/3cc4b12a11bb|Move back the tables and messages]] only used for SCANMODE= parsing. * [[https://hg.pushbx.org/ecm/msdos4/rev/ab3d9df6d8d0|Add sysinisw.mac switch file]], to give a new stack reservation value for the SYSINIT segment. * [[https://hg.pushbx.org/ecm/msdos4/rev/3c093ba4f03e|Increase stack reservation]]. * [[https://hg.pushbx.org/ecm/msdos4/rev/e7b64db4f2aa|Reserve stack space for SYSINIT]], and put GOINIT code into SYSINITLAST to be merged into the stack space. At least 512 Bytes of stack are available with this. * Ensure that early DOSENTRY init [[https://hg.pushbx.org/ecm/msdos4/rev/35e12c452e4d|discards at least SYSINITSTACK bytes]], so that the SYSINIT relocation logically cannot fail. * [[https://hg.pushbx.org/ecm/msdos4/rev/b1bfb44e91f9|Delete TempStack variable]], no longer used. * Fix [[https://hg.pushbx.org/ecm/msdos4/rev/5424517e0742|to not point the int 24h vector into SYSINIT]] unnecessarily. This could blow up once SYSINIT is freed. And the handler exactly matched what we already had for the early int 24h in DOSENTRY (''mov al, 3'' and ''iret''). * [[https://hg.pushbx.org/ecm/msdos4/rev/2fd025f9bb72|Update ksection.txt init sequence some]], and [[https://hg.pushbx.org/ecm/msdos4/rev/0ca42dc8d642|correct a typo]]. * [[https://hg.pushbx.org/ecm/msdos4/rev/181bc2652e51|Update ksection.txt descriptions]] of NEARDOSINIT and INITDPB. * [[https://hg.pushbx.org/ecm/msdos4/rev/3ae096bfe71c|Note that WarpLink ecm release 1 is needed]] for msbio2.obj (one section has DWORD alignment). * [[https://hg.pushbx.org/ecm/msdos4/rev/7c34d15a3564|Add several missing assume directives]], for listvars.pl * [[https://hg.pushbx.org/ecm/msdos4/rev/c901a5dceb13|Add more assume directives]], for listvars.pl -%%%%-list-expect * [[https://hg.pushbx.org/ecm/msdos4/rev/b86c0bd87591|Add sortmap.pl output]] to end of ksection.txt * [[https://hg.pushbx.org/ecm/msdos4/rev/832ca860e7dd|Delete unused file]] sharehdr.inc * [[https://hg.pushbx.org/ecm/msdos4/rev/3f303f34fdf6|Note that WarpLink ecm release 2 is needed]]. (Release 1 had a bug that only affected the MZEXESTACK section, but still.) * Add to ksection.txt [[https://hg.pushbx.org/ecm/msdos4/rev/9d9cd3b51ba3|a list of all resident DOSENTRY contents]], including padding and alignment bytes (those actually emitted, not all possible ones). * [[https://hg.pushbx.org/ecm/msdos4/rev/851df3322d5f|Note why DiskSector must be paragraph-aligned]]. * [[https://hg.pushbx.org/ecm/msdos4/rev/4a55602f485c|Update the sortmap.pl output]] in ksection.txt with the corrected MZEXESTACK. * [[https://hg.pushbx.org/ecm/msdos4/rev/9eb1bfa0e2ab|Point out the used WarpLink release]]. * [[https://hg.pushbx.org/ecm/msdos4/rev/1de670745724|Update lDOS version]] to "2025 August". * [[https://hg.pushbx.org/ecm/msdos4/rev/c91de8e4080e|Handle SETDRIVE error return (CY)]], return device driver error 1 (unknown unit) if detected. * [[https://hg.pushbx.org/ecm/msdos4/rev/b1ebd1e544f4|Delete an unneeded mov bx in msioctl.nas]] (likely left over from lds di optimisation). (Yes, [[https://hg.pushbx.org/ecm/msdos4/rev/9514a5f3c5e4#l9.605|in a big changeset]] on 2025-02-13 that also changed this to use lds.) * In msioctl.nas [[https://hg.pushbx.org/ecm/msdos4/rev/494fe588a5a8|return error if IOCTL$GETOWN scans past the last UPB]]. The SETDRIVE case was interesting in that the function did return an error status, but this was only ever checked in two spots. Everywhere else, the caller assumed ds:di -%%%%> a valid UPB and acted accordingly. This could lead to memory or data corruption if a caller specified an unknown unit number. ===== lDebug ===== The only two changes are [[https://hg.pushbx.org/ecm/ldebug/rev/7be5e91468d1|updating and syncing the AMIS private function descriptions]] in [[https://pushbx.org/ecm/doc/ldebug.htm#int2D|the manual]] and in amis.asm, as well as [[https://hg.pushbx.org/ecm/ldebug/rev/71c346ff69bc|updating the attribution year]] in amis.asm to read 2025. {{tag>patchini renumber insref tractest sortmap.pl convlist.pl listvars.pl warplink nasm ldos amis ldebug}} ~~DISCUSSION~~