====== Early September work ====== **2024-09-08** The prior week nothing changed and that Sunday I didn't get to write a blog post regardless. This week some changes did happen. ===== inicomp ===== * [[https://hg.pushbx.org/ecm/inicomp/rev/48a020dd26d2|Add _OPTIMISE_SMALL_INPUT define]]. Barely used yet. This actually sat in my repo for a while already but I only got around to committing it last Sunday. * [[https://hg.pushbx.org/ecm/inicomp/rev/2194a004d65f|Use a single dispatch]] for progress choice rather than two. * [[https://hg.pushbx.org/ecm/inicomp/rev/b1d3cb40ad42|Use addsection and usesection macros]]. * [[https://hg.pushbx.org/ecm/inicomp/rev/397a27e0ee9a|Add an INIT0B section]], empty. * [[https://hg.pushbx.org/ecm/inicomp/rev/6c60896336b0|Add a trampoline to INIT0B section]], so it can run between section INIT0 and section INIT1. * [[https://hg.pushbx.org/ecm/inicomp/rev/a2a912471311|Include INIT0B]] if _PROGRESS (or _LCFG) is set. * [[https://hg.pushbx.org/ecm/inicomp/rev/1a770ab3936b|Move progress set up into INIT0B section]], reducing the memory needed for INIT1 during depacking. * [[https://hg.pushbx.org/ecm/inicomp/rev/4939517ca50b|Change progress dispatch]] to modify (SMC) a direct jmp rel16 branch instead of an indirect branch variable. * [[https://hg.pushbx.org/ecm/inicomp/rev/3a5f5183451d|Mark new SMC uses]]. (The jmp rel16 dispatch as well as the empty progress step call, which is patched to __TEST_IMM16 if it shouldn't call down.) * [[https://hg.pushbx.org/ecm/inicomp/rev/5012fc9ce504|Comment on existing test program replacement]] of ''jc error'' to ''retf'' \ ''nop''. * [[https://hg.pushbx.org/ecm/inicomp/rev/129228cd1a39|Optimise progress setup in INIT0B]] if kernel-only mode is being built. (For Enhanced DR-DOS kernel builds.) * Optimise, [[https://hg.pushbx.org/ecm/inicomp/rev/ee656a5fb4f9|drop an addition]] if the image .exe CS adjustment is zero. * [[https://hg.pushbx.org/ecm/inicomp/rev/a97ea07a3afe|Add _DEVICE condition to some spots]] where previously only _IMAGE_EXE was read. * [[https://hg.pushbx.org/ecm/inicomp/rev/2a52e5b5156e|Add _LCFG_CFG define]] to assemble additional lCFG block configuration items. * [[https://hg.pushbx.org/ecm/inicomp/rev/2a52e5b5156e|Add _PASSLCFG option]] to pass along the inicomp stage's lCFG block to the next stage. The last two changes were actually added in a single changeset. They extend the inicomp to packed payload protocols as follows: * The uncompressed lCFG block is copied to the end of the resident INIT1 to preserve it during depacking. This buffer is called the transfer lCFG block. * For kernel and application mode, the transfer lCFG block address is passed in ''cx:di''. * For device mode, the transfer lCFG block address is passed in the dword behind the strategy and interrupt entrypoints of the device header. It is expected that this dword should be pre-initialised to a zero value. The suggested protocol is as follows: * Device mode entrypoint should check the dword in which inicomp writes the transfer lCFG block's address. If it isn't zero, assume we were loaded from inicomp and save the lCFG block from the transfer location to a buffer in the depacked program stage. * For the kernel mode and application mode, the entrypoint address that inicomp jumps to should be changed, for example by incrementing it by one. This allows the depacked program stage to detect if it was loaded from inicomp or without an inicomp stage (eg directly from iniload). If the former then the pointer in ''cx:di''is valid, and should be used to access or copy the transfer lCFG block. ===== kernwrap ===== Add an option [[https://hg.pushbx.org/ecm/kernwrap/rev/4e0c178bb110|to generate and pass an lCFG block to the kernel]]. This uses the changes to inicomp and drkernpl. Like suggested for inicomp, this changes the _EXEC_OFFSET define in inicomp to 1 to signal to the drkernpl that it is being loaded from inicomp. ===== lDOS boot ===== Add options to [[https://hg.pushbx.org/ecm/ldosboot/rev/439448ca4188|drkernpl to pass lCFG block]], copy an inicomp lCFG block, and to include an lCFG block within the drkernpl stage. The latter is only to be used if the kernel is not compressed with inicomp. If the option to copy the inicomp transfer lCFG block is enabled, then inicomp entry is detected by being entered with ''ip'' equal to 1 instead of 0. Similarly to the inicomp to drkernpl protocol, the drkernpl to drbio protocol is changed so that ''cx:di'' points to the lCFG block. For drkernpl its lCFG block always lives between 00600h and 00700h, which is conveniently always available. There is, however, no way for drbio to detect that an lCFG block is passed. It must be built to assume whether this is true or not. ===== patchini ===== Adds the patchdeb tool. This operates on Enhanced DR-DOS's "check debugger" byte in the lCFG block (at offset 20). The first revision [[https://hg.pushbx.org/ecm/patchini/rev/1b95c25d475d|copied the patchpro source text without changes]]. The second revision [[https://hg.pushbx.org/ecm/patchini/rev/a5561522a4d6|implemented patchdeb first]], recognising only the flags 1 (check) and 2 (assume). Unlike the FreeDOS kernel, the EDR-DOS implementation treats these as flags, so 0 = do not check and assume no, 1 = check and assume no, 2 = do not check and assume yes, and 3 = check and assume yes. The third revision [[https://hg.pushbx.org/ecm/patchini/rev/ad472c110665|added support for recognising the flags]] 4 (check only if vector is valid) and 8 (check only if vector points to an IBM Interrupt Sharing Protocol header). Of note is that patchdeb also allows setting or clearing flags in the configuration byte that it doesn't recognise, so a current patchdeb could be used to operate on future yet to be defined flags. ===== lDebug ===== * [[https://hg.pushbx.org/ecm/ldebug/rev/15094416c02e|Add pass lCFG field to device header]]. Not used yet. Doesn't actually change the binary because there was zero-padding right after the existing structure of the device header. * [[https://hg.pushbx.org/ecm/ldebug/rev/b21be1908bbd|Copy sss code]] from ss.asm into ssshared.asm * [[https://hg.pushbx.org/ecm/ldebug/rev/0b9f601492b4|Include ssshared.asm]] from ss.asm * [[https://hg.pushbx.org/ecm/ldebug/rev/ea43db6b6566|Add macros to ss.asm]] for dual use of ssshared.asm for normal use or ELD use * In ss.asm macros [[https://hg.pushbx.org/ecm/ldebug/rev/d49f530ca986|allow second parameter to extcall]] * [[https://hg.pushbx.org/ecm/ldebug/rev/bc66de4d5352|Add some links]] for s.eld * [[https://hg.pushbx.org/ecm/ldebug/rev/85064a741acd|Add section_of for count_store function]] * [[https://hg.pushbx.org/ecm/ldebug/rev/71eac5ddf7e0|Add code link for count_store]] * [[https://hg.pushbx.org/ecm/ldebug/rev/54934fd1fbcd|Make code link for count_store conditional]] on ''_COUNT || _SCOUNT'' * [[https://hg.pushbx.org/ecm/ldebug/rev/a7638763147c|Prepare ssshared.asm]] for use in an ELD * [[https://hg.pushbx.org/ecm/ldebug/rev/e427103b179e|Fix wrong data link adjustments]] for testopt uses * [[https://hg.pushbx.org/ecm/ldebug/rev/7a045d7cd81e|Add s.eld]] with same features as original S command * Change so resident s.eld [[https://hg.pushbx.org/ecm/ldebug/rev/a32de4c130ee|only recognises S command if the letter S is followed by a separator]], allowing to drop the separate detection of the SLEEP command * [[https://hg.pushbx.org/ecm/ldebug/rev/8f80d7d0326d|Add a copy of the getstr function]] to the S ELD * [[https://hg.pushbx.org/ecm/ldebug/rev/f9872f90fd97|Add missed code relocations]] to the displacement write table, and enable _SDUMPDISPLACEMENT for the S ELD * [[https://hg.pushbx.org/ecm/ldebug/rev/c7cb44bf9799|Add code link for hexdword]], needed for lDebugX to load the S ELD. Also always include this function if _PM. * [[https://hg.pushbx.org/ecm/ldebug/rev/663a4a2dc9ef|Support WILD and CAPS keywords in S ELD search pattern]]. A tag buffer is used which adds two tag bits per pattern byte. * [[https://hg.pushbx.org/ecm/ldebug/rev/77334512532d|Support a single CAPS keyword after the RANGE keyword]] for the S ELD, to treat the entire search pattern range as capitalisation-normalised. * [[https://hg.pushbx.org/ecm/ldebug/rev/d32912dc76a2|Add patternbuffer to the S ELD]] to not use auxbuff for the pattern. * [[https://hg.pushbx.org/ecm/ldebug/rev/736bdd631a91|Document in the manual]] chstool.eld (very sparsely) and s.eld (exhaustively). ===== x2b2 ===== [[https://hg.pushbx.org/ecm/x2b2/rev/b63975f6f605|Do not call the Has_SS error/warning function twice]] if the /S switch is passed and both the SS and SP in the .exe header are nonzero. This switch is used for the amdpd build. ===== ident86 ===== * [[https://hg.pushbx.org/ecm/ident86/rev/7c653b1e4af2|Fix running without the -a switch]], which would end the run after the first different byte immediately. (Have to detect and specialcase a value of 0 for the switch.) * [[https://hg.pushbx.org/ecm/ident86/rev/898dce5692c3|Add some debugging output]] for where the start of a range is detected. ===== tractest convlist.pl ===== * [[https://hg.pushbx.org/ecm/tractest/rev/ce0901cc3976|Support TASM v4.1]] listing files * [[https://hg.pushbx.org/ecm/tractest/rev/c28782c2f990|Support some more TASM specifics]], such as a pipe symbol after a 66 (o32) prefix, possible additional blanks before the hexdump offset, and swapping the bytes of words in the hexdump * [[https://hg.pushbx.org/ecm/tractest/rev/6c6fbd8cb56a|Allow for hexdump continuation lines]] for TASM * [[https://hg.pushbx.org/ecm/tractest/rev/72657e3d0428|Allow a leading digit before TASM line number]], possibly indicating an include file is active? * [[https://hg.pushbx.org/ecm/tractest/rev/8780dc2d0ede|Add a heuristic]] (expecting a comment at file start) to detect differing TASM prefix width. I do not know how we're supposed to tell what the prefix width is, so this is an optimistic effort. The TASM support was needed to create a complete trace listing file from the TASM listings of the amdpd driver, so that ident86 could be utilised to its fullest potential. ===== Enhanced DR-DOS ===== * [[https://hg.pushbx.org/ecm/edrdos/rev/575895d7321b|Support check debugger byte from lDOS flavour lCFG block]]. As mentioned in the patchini section, the kernel treats the 8 bits of this byte as flags, it does not treat the entire byte as an ordinal. * [[https://hg.pushbx.org/ecm/edrdos/rev/d4f67d33b5bf|Add lCFG block to the SvarDOS flavours]]. This lCFG block is put in place of two device headers, which are copied to overwrite the lCFG block later during the boot. * [[https://hg.pushbx.org/ecm/edrdos/rev/63a259b4d22b|Note that the SvarDOS flavours kernflg debugging flag]] is no longer used. * [[https://hg.pushbx.org/ecm/edrdos/rev/ed68a3f96daa|Update lDOS version]] to 2024 August. * [[https://hg.pushbx.org/ecm/edrdos/rev/1e453d972df2|Add handling for the check debugger flags]] for 4 (check only if int 3 vector is valid) and 8 (check only if int 3 handler has an IISP header). * [[https://hg.pushbx.org/ecm/edrdos/rev/3fd575c97fcb|Fix too long lines in make.bat scripts]], pointed out [[https://github.com/SvarDOS/edrdos/issues/104#issuecomment-2328308336|by Bernd Böckmann]]. * In bdosldr.nas [[https://hg.pushbx.org/ecm/edrdos/rev/649fd4e80405|exclude DOS loader code]] if not building SvarDOS flavours. * Default [[https://hg.pushbx.org/ecm/edrdos/rev/e9fda276079f|to build single-file SvarDOS flavour]] if SvarDOS option is enabled. * [[https://hg.pushbx.org/ecm/edrdos/rev/638d078560b8|Make the call to c:\autowat.bat conditional]], as [[https://github.com/SvarDOS/edrdos/issues/104#issuecomment-2328355211|suggested by Bernd Böckmann]]. * [[https://hg.pushbx.org/ecm/edrdos/rev/1e13fb4b8765|Change %ifdef LDOS to %if LDOS]], so that passing a value of 0 is handled properly. * In drdos module [[https://hg.pushbx.org/ecm/edrdos/rev/803e8e8cde87|use SvarDOS version string]] for the 21.33FF function. Two picks from the SvarDOS repo: * [[https://hg.pushbx.org/ecm/edrdos/rev/3e3bb89ed581|Expand COMSPEC content using 21.60]], to make sure it is an absolute pathname. * [[https://hg.pushbx.org/ecm/edrdos/rev/353577d5dbca|Fix filename parsing]] concerning three-dots components. ===== fixmem ===== These changes were driven by the amdpd porting effort. * [[https://hg.pushbx.org/ecm/fixmem/rev/4e9e3e4e473e|Recognise "stack" segment attribute]]. * In structure instances [[https://hg.pushbx.org/ecm/fixmem/rev/dff190597876|support equate as repetition count, support lowercase "dup", and support trailing comment]]. * [[https://hg.pushbx.org/ecm/fixmem/rev/9690e9745b76|Expand dot then label after a closing bracket]] to just the label added to the prior address parts. * [[https://hg.pushbx.org/ecm/fixmem/rev/a14ef6088a74|Recognise TASM CPU directives]]. * [[https://hg.pushbx.org/ecm/fixmem/rev/bfb723224bcf|Allow blanks after colons]] in EXTRN directives. * [[https://hg.pushbx.org/ecm/fixmem/rev/077a5451e10d|Replace .asm filename extension]] in include directives by .nas * [[https://hg.pushbx.org/ecm/fixmem/rev/cc7c988cadec|Recognise 386 registers]]. * [[https://hg.pushbx.org/ecm/fixmem/rev/b7c263a04de5|Recognise use16 and use32 segment attributes]]. ===== amdpd ===== This is an AMD PCnet packet driver sourced from crynwr.com. It is free software under the GNU GPL v1-only. It supports the pcnet device of qemu. I ported the entire driver to build with NASM, WarpLink, x2b2, and convlist.pl. During this work I also [[https://hg.pushbx.org/ecm/amdpd/rev/f70eb41ed0f6|lightly optimised some segment uses]] in the original TASM source texts by adding some assume directives, to simplify the porting. I used fixmem.pl and ident86 in large parts to do the porting, albeit I did do some replacements manually rather than adding handling for everything to fixmem. I tested [[https://hg.pushbx.org/ecm/amdpd/rev/86d07f781cd3|the final build]] with the ethflop client and server both running on FreeDOS in qemu. ===== ethflop ===== I made some suggestions to the ethernet diskette emulator, in [[http://svardos.org/?p=forum&thread=1725345339|the SvarDOS forum thread announcing it]]. I may work on it my self later as well. ===== wwwecm.scr ===== [[https://hg.pushbx.org/ecm/wwwecm.scr/rev/c4d0a9404190|Added the amdpd build]] to update-dl-wwwecm. {{tag>inicomp kernwrap ldosboot drkernpl patchini ldebug x2b2 ident86 convlist edrdos fixmem amdpd ethflop}} ~~DISCUSSION~~