|
|
— |
blog:pushbx:2023:1119_mid_november_work [2023-11-19 17:42:55 +0100 Nov Sun] (current) ecm created |
| ====== Mid November work ====== |
| |
| **2023-11-19** |
| |
| This week I worked some on lDebug, its Extensions for lDebug, and on a few other projects. |
| |
| |
| ===== Adding the E. ===== |
| |
| [[https://hg.pushbx.org/ecm/ldebug/rev/6de17cca42d0|lDebug]], [[https://hg.pushbx.org/ecm/ldosboot/rev/3ad19e177d89|lDOS boot]], [[https://hg.pushbx.org/ecm/inicomp/rev/0722ee32cdc7|inicomp]], [[https://hg.pushbx.org/ecm/instsect/rev/8bdee0b6f068|instsect]], and [[https://hg.pushbx.org/ecm/webecm/rev/bbfc3d546de0|the pushbx.org/ecm/web/ page]] were all updated to render my name more completely, adding the initial for my first given name. |
| |
| |
| ===== Web site update ===== |
| |
| The section for seekext [[https://hg.pushbx.org/ecm/webecm/rev/540d151d2374|received a few updates]]. |
| |
| |
| ===== AMIS multiplexer lister (amitsrs) ===== |
| |
| The amitsrs program originates in Ralf Brown's AMIS libraries. I have updated it several times in the past. This week I fixed a few bugs: |
| |
| * When more than one hotkey is advertised, [[https://hg.pushbx.org/ecm/amitsrs/rev/74aebfff64a8|do not repeatedly display the first one]]. (Note that Ralf Brown's only example program with a hotkey list, NOTE, only had one hotkey.) |
| * Hotkey scancode [[https://hg.pushbx.org/ecm/amitsrs/rev/c924913a3304|is checked for array bounds]] before reading from the array. |
| * Unknown hotkey scancodes will not show up as "nokey" any longer. |
| |
| |
| ==== Port to 8086 assembly and ELD ==== |
| |
| (I [[blog:pushbx:2023:1115_porting_the_amitsrs_tool_to_an_eld|wrote about this port]] in an earlier blog post.) |
| |
| I also ported amitsrs to an ELD of the same name. This was at first a very close recreation of the original, except I did allow it to operate as a residently installed ELD to begin with. |
| |
| Later, I replaced the simple check for a nonempty command line tail by parsing for specific keywords to select which lines to additionally display. This allows to select the second line (multiplex number, version, private entry point) or the hotkeys display or the interrupt list display. |
| |
| |
| ===== TSR changes ===== |
| |
| ==== testhotk ==== |
| |
| A new TSR, [[https://hg.pushbx.org/ecm/testhotk/|testhotk]], was added to test out the amitsrs hotkey list display. |
| |
| |
| ==== BP process relocation change ==== |
| |
| All TSRs were [[https://hg.pushbx.org/ecm/tsr/rev/e3245eb7505f|updated to push BP before the termination call]] used for process relocation, and pop it afterwards. This means the method is less dependent on the termination preserving registers, though it does depend on the SS:SP being carried over correctly. |
| |
| |
| ==== KEEPHOOK section fix ==== |
| |
| When KEEPHOOK was updated between 2023 March and 2023 May, a differing alignment directive presumably [[https://hg.pushbx.org/ecm/keephook/rev/bad1fc98c8fc|let the patch utility place the /J options table in the wrong section]]. It was placed at the end of the resident section, rather than in the transient section. This [[https://hg.pushbx.org/ecm/keephook/rev/7475ac718e2d|is now fixed]]. |
| |
| The most obvious tell, which actually made me notice something was wrong, was that KEEPHOOK would install into the LMA even though no /JU switch was present and enough UMA space was free. |
| |
| I did an audit of all other TSRs and the same error was not present in any of them. |
| |
| It seems that the patch went wrong because the end of the transient section had a ''align 16, db 0'' directive in KEEPHOOK, as opposed to the ''align 16'' in all other TSRs. |
| |
| |
| |
| ===== lDebug ===== |
| |
| ==== Path search ELD ==== |
| |
| The path.eld uses the filename extension warning and guessing as well as the path search originally added to the debugger's init and ports them to a residently installable ELD. |
| |
| [[https://hg.pushbx.org/ecm/ldebug/rev/bfdd610850d4|A later change]], which affects the init's path search too, is to ignore directories found during the search. |
| |
| The path.eld [[https://hg.pushbx.org/ecm/ldebug/rev/69e77fe36a7c|also gained subcommands]] to display, turn on, turn off, or toggle parts of its functionality. These correspond to the /PW, /PS, and /PE switches of init. |
| |
| The [[https://hg.pushbx.org/ecm/ldebug/file/0b8b44f1088a/source/pathshar.asm|shared source file pathshar.asm]] defines three different blocks of code, which are to be included at different points in the host program. This was chosen over placing the blocks into mmacros to preserve the excellent NASM listing output. Source code in mmacros is not listed this well. (Whitespace and comments are stripped off the macro expansion, while the macro definition doesn't get the binary opcodes the code assembles into.) |
| |
| The WHILE buffer and swch1 variables [[https://hg.pushbx.org/ecm/ldebug/rev/874a2957e67f|had to be added]] to the debugger's data links to allow this ELD to work with minimal changes to the shared sources. |
| |
| The ''linkinfo_data_as'' macro [[https://hg.pushbx.org/ecm/ldebug/rev/94e8a483a132|was added to make a data link]] with an alias name differing from the label whose value is actually linked. |
| |
| ==== Commas before executable pathname ==== |
| |
| MSDebug allows separators before the executable pathname that it accepts in its K and N commands, as well as on its command line. Compatibility in lDebug only extends to a single comma, however. |
| |
| The K command already fully supported skipping a single comma, as the cmd4 dispatcher calls ''skipcomma'' before dispatching to the command function. |
| |
| The N command in MSDebug-compatible mode would not include a leading comma in the command line tail it writes. [[https://hg.pushbx.org/ecm/ldebug/rev/b392101ebad2|This is fixed]]. |
| |
| The init's command line tail invocation of the K command also did not skip a leading comma, which [[https://hg.pushbx.org/ecm/ldebug/rev/f5aed230cbb9|it will now do]]. |
| |
| |
| ==== dosdrive.eld ==== |
| |
| This ELD [[https://hg.pushbx.org/ecm/ldebug/rev/5f33ddd58884|now allows a SET QUIET command]] with the empty string as pathname after the keywords. It will silently not change the current drive then. |
| |
| |
| ==== ldmem ==== |
| |
| The eldstrict mode [[https://hg.pushbx.org/ecm/ldebug/rev/5bf329cd8ae5|was enabled for this ELD]]. This mode makes most relocation errors fail much more obviously, during build time. |
| |
| The common string " segment: " [[https://hg.pushbx.org/ecm/ldebug/rev/a0268dd62217|is now shared]] for the MEM display. |
| |
| There is [[https://hg.pushbx.org/ecm/ldebug/rev/362aac0abb37|a new display called SEG]] which lists only the segment values, and in PM selector values, of all sections. This makes for a much terser output than MEM, which is better if one wants to learn only the seg/sel value of a section. |
| |
| The SEG display originally re-used the section names from MEM, but [[https://hg.pushbx.org/ecm/ldebug/rev/6d841a226710|shorter aliases were added for some of them]]. The columns of the SEG display are long enough for the name but at least 5 columns wide. |
| |
| ==== amitsrs ==== |
| |
| This ELD was already described in an earlier section and in its own blog post. |
| |
| |
| ==== FAT12 boot read fix ==== |
| |
| The FAT12 reader for EXT, Y, and BOOT DIR commands [[https://hg.pushbx.org/ecm/ldebug/rev/cfcc090d742b|incorrectly detected the condition of a FAT entry that straddles the sector boundary]], and thus did not load the second FAT sector required in that case. This randomly popped up during bootloaded testing of lCDebugX and the extname.eld. |
| |
| |
| ==== extname.eld ==== |
| |
| This ELD provides filename extension warnings and guessing for the EXT and Y commands. The known extensions exactly match those that will be guessed. They are .ELD and .XLD for the EXT command, and .SLD for the Y command. |
| |
| This ELD is more complicated than path.eld in that it needs to parse the pathname in the same way as the EXT and Y commands do, including the expansion of the configuration path keywords. Furthermore, if the extension being guessed doesn't match any file, and no path keyword was used, the ELD will next try to guess the extension with the ::scripts:: path prepended, also matching how these commands handle a missing file. |
| |
| |
| ==== linfo.eld ==== |
| |
| This ELD displays some information on files and processes loaded using the L command. |
| |
| The command handler will detect L commands. When detected, it displays the program load name and sets up both a command inject handler to be run when the L command returns to the cmd3 command loop, as well as a puts multi-purpose handler. |
| |
| The puts handler passes along any messages, but is used to detect output from the L command. Messages about hooking the DPMI entry are allowlisted. Any other message output is assumed to indicate an error in the L command. |
| |
| After a successful L command or on an LINFO PROBE command, the ELD will probe the file referenced by the N/K program load name buffer. It will display its file size, whether it is an MZ executable with header, and if so then the header size and image size. It will also display the PSP segment and memory block size. |
| |
| |
| ==== Discard help messages in residently installed ELDs ==== |
| |
| Most ELDs come with help messages. When the ELD can also be installed residently, frequently the help message would balloon the length of the resident data block without need. This has been fixed by moving the install code behind the data section and conditionally shortening the data block when installing. |
| |
| The history.eld already had some code in place to do just the same. The set.eld actually retains uninitialised buffers so long that the conditional shortening code in its install is not used. For a lot of ELDs however, this change brought an optimisation of their resident ELD data block sizes. |
| |
| |
| ==== dosdir.eld ==== |
| |
| The dosdir ELD was changed [[https://hg.pushbx.org/ecm/ldebug/rev/62d7b1476cff|to expand its ELD data block to the maximum permissible size]] for use as a sort buffer. This allows it to operate even if the auxiliary buffer is in use. If it is not in use, then whichever buffer is larger is used. |
| |
| The ELD also gained the SORTDEBUG keyword which [[https://hg.pushbx.org/ecm/ldebug/rev/7ef71061fd02|will display the buffer sizes and which one would be chosen]] if the ELD had been run without the debugging keyword. This handling can be excluded at build time with a _DEBUG=0 build option. |
| |
| [[https://hg.pushbx.org/ecm/ldebug/rev/9116e67b2e66|The dosdir.eld also gained]] the ''found'' flag byte from the bootdir.eld, which it uses so that dot and dotdot entries are not only excluded from display but also do not count as "files found" to prevent the "File not found" message from being displayed. |
| |
| |
| ==== bootdir.eld ==== |
| |
| This ELD is a build option of dosdir.eld which will make it work (only) when bootloaded, using the debugger's FAT FS support. The auxiliary buffer can only be partially used as a sort buffer then, the first sector (for FAT16 and FAT32) or the first two sectors (for FAT12) must be reserved for use as FAT and directory sector buffers. Fortunately, the dosdir.eld change to allow use of the ELD data block translated directly. |
| |
| Most of the directory scanning is re-used from list.eld, with a re-initialisation when looking for the sorted files in order. The scanning is very wasteful, particularly for the sorted files. The subdirectory in which the search occurs is re-detected for every sorted file. And the entire directory is searched until the end, also for each sorted file. |
| |
| Subsequent changes were added. One is [[https://hg.pushbx.org/ecm/ldebug/rev/9f2736712c61|to move the setting]] of the ''found'' flag byte into the ''populate_finddata'' function. This serves to exclude matching dot and dotdot entries. |
| |
| The final change yet is for sorted files [[https://hg.pushbx.org/ecm/ldebug/rev/3b4950212eb0|to append a slash to the directory path name]] if it doesn't end in one. For instance, if a directory named "ldp" is present in the root directory, and the root directory is scanned using a command like ''ext bootdir.eld * sort'' then the sorted re-scan would scan for "ldp" which is misparsed as a partition specification without a pathname. Appending the slash, the re-scan will be for "/ldp" instead which has the expected result. |
| |
| |
| ==== ELD strict mode reloc only disables reloc-abs warnings ==== |
| |
| [[blog:pushbx:2023:1022_late_mid_october_work_on_extensions_for_ldebug#eld_architecture|The eldstrict mode]] utilises new NASM 2.16.02 warnings to detect undeclared relocations. Previously, the mode would disable the new errors entirely in the ''reloc'' and ''reloc2'' mmacros. Now, they only disable the ''reloc-abs'' errors and retain the remaining ''reloc-rel'' errors. If there is need for using relative section-crossing relocations, macros to allow them can be added later. For now, this hardens the build of eldstrict-enabled ELDs. |
| |
| {{tag>ldebug eld amis wwwecm tsr keephook}} |
| |
| |
| ~~DISCUSSION~~ |
| |