User Tools

Site Tools


blog:pushbx:2023:1022_late_mid_october_work_on_extensions_for_ldebug

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

blog:pushbx:2023:1022_late_mid_october_work_on_extensions_for_ldebug [2023-10-22 19:17:16 +0200 Oct Sun] (current)
ecm created
Line 1: Line 1:
 +====== Late mid October work on Extensions for lDebug ======
 +
 +**2023-10-22**
 +
 +This week mainly involved more work on lDebug and its ELDs.
 +
 +===== Changes not specific to ELDs =====
 +
 +  * Rework EXT/Y boot command architecture
 +  * Support ::scripts:: and ::config:: keywords [[https://hg.pushbx.org/ecm/ldebug/rev/4498f6b2a045|in EXT/Y boot commands]] and [[https://hg.pushbx.org/ecm/ldebug/rev/41e0eb6839d6|BOOT DIR command]]
 +  * Support [[https://hg.pushbx.org/ecm/ldebug/rev/986ff4d7e20e|fallback to ::scripts:: directory]] in EXT/Y boot commands
 +  * [[https://hg.pushbx.org/ecm/ldebug/rev/e958aa802400|Allow commas as separators]] in boot and DOS EXT/Y commands, quote them with doublequotes to specify filenames with commas in them
 +  * [[https://hg.pushbx.org/ecm/ldebug/rev/bf3fc3adb532|Add two blanks]] before the RH step indicator
 +  * [[https://hg.pushbx.org/ecm/ldebug/rev/98fceb3baf52|Drop duplicate structure definition]] of ''DIRENTRY'' in macros file
 +  * [[https://hg.pushbx.org/ecm/ldebug/rev/4855d908e8ce|Extract macros for file system and boot load structures]] to ''iniload.mac'' (some of these are bootloaded lDebug internal however)
 +  * [[https://hg.pushbx.org/ecm/ldebug/rev/f4573bba9261|Fix build]] of _EXTENSIONS=1 _PM=0 debugger
 +  * [[https://hg.pushbx.org/ecm/ldebug/rev/388f67730c53|Add more]] ''section_of_function'' checks
 +  * [[https://hg.pushbx.org/ecm/ldebug/rev/00fb9bf07319|Bugfix]], a reference to the application environment size accidentally used the device environment size (benign as these are the same size currently)
 +  * If using an internal environment block, [[https://hg.pushbx.org/ecm/ldebug/rev/6d414c9bdad9|free the original application environment block]]
 +  * [[https://hg.pushbx.org/ecm/ldebug/rev/5cb157ded99f|Add a new buffer]] for RN and RM commands to avoid using the auxiliary buffer
 +  * [[https://hg.pushbx.org/ecm/ldebug/rev/5e295727851e|Add backslash (and slash) to separators]] in ''expr.asm'' to support boot loaded mode partition specification as either ''hda5/'' or ''hda5\''
 +
 +==== Optimise init memory use ====
 +
 +Today I added [[https://hg.pushbx.org/ecm/ldebug/rev/9185c4648ec7|a change to the debugger's init]]. Rather than allocating enough memory for the biggest total size (24 KiB aux buffer + 8 KiB layout 3 gap + 63.9 KiB ext buffer) and relocating init high enough for all configurations initially, the init size reserved for aux buffer and ext buffer is reduced to nearly 8 KiB for each.
 +
 +That means if the specified final size (the "want" size) is larger, it may be necessary to grow the debugger allocation and relocate the init a second time. This, of course, can fail if there is not enough space to grow the allocation.
 +
 +This error condition is only possible if either the /A= or /X= switch is specified or layout 3 is used, though. There being a new error condition is a disadvantage, but the initial debugger allocation grew to over 200 KiB with a full aux buffer and ext segment which is not acceptable for small devices like the HP 95LX.
 +
 +During development of this change I accidentally always relocated init to just behind the original init, which blew up with /A=MAX /X=MAX. In truth, this relocation target is the **minimal** relocation target to avoid an overlapping move. However, if it doesn't suffice then a higher target needs to be used.
 +
 +
 +===== ELD infrastructure =====
 +
 +  * EXT/Y command filename parse and file open functions were reworked and are now exported for use by ELDs
 +  * Boot directory scan functions are usable by ELDs
 +  * A single [[https://hg.pushbx.org/ecm/ldebug/rev/8adc97e14b82|near call transfer]] is exposed to ELDs, allowing them to hook into first code section callbacks
 +  * [[https://hg.pushbx.org/ecm/ldebug/rev/e35e95c4d94a|DOS call functions exported]] for use by ELDs, with [[https://hg.pushbx.org/ecm/ldebug/rev/3f4a276dc371|a trivial]] ''_doscall'' if _PM=0
 +  * [[https://hg.pushbx.org/ecm/ldebug/rev/98d0bc4c98b9|Changed interrupt call ext function]] to return the ''es'' value in the otherwise unused returned parameter
 +  * [[https://hg.pushbx.org/ecm/ldebug/rev/a8fe0f905cf7|Add code link to function]] closing the ext handle
 +  * Provide ''iniload.mac'' for boot structures
 +  * [[https://hg.pushbx.org/ecm/ldebug/rev/ce621b54fd02|Add data link]] to exec block command line pointer
 +  * [[https://hg.pushbx.org/ecm/ldebug/rev/e2ce71063754|Add code links with linked names differing from names used internally]] by the debugger (used for simple interface versioning scheme)
 +  * [[https://hg.pushbx.org/ecm/ldebug/rev/fea36c74676a|Link the config paths variables]]
 +
 +
 +===== ELD architecture =====
 +
 +  * [[https://hg.pushbx.org/ecm/ldebug/rev/8283ed8c787c|Update examples of code link dumping]] in ''eldcall.mac''
 +  * [[https://hg.pushbx.org/ecm/ldebug/rev/8e317aef00c0|Define extension header]], backwards-compatible to original ELD1 header (one of the reserved fields in the original header indicates where the extension header ends; zero indicates no extension header)
 +  * [[https://hg.pushbx.org/ecm/ldebug/rev/8e317aef00c0|Define description offset]] in extension header, allowing to point to an up to 128 Bytes ASCIZ description line
 +  * [[https://hg.pushbx.org/ecm/ldebug/rev/a4f294bf4bb2|Define help offset]] in extension header, allowing to point to an ASCIZ multi-line help
 +  * Allow to restore global system state [[https://hg.pushbx.org/ecm/ldebug/rev/cacac829a993|by hooking into the debugger command inject handler]]
 +  * Add ''required'' keyword to [[https://hg.pushbx.org/ecm/ldebug/rev/ab521d15ce69|uses of extcall]] that must not be changed to extcallcall
 +  * [[https://hg.pushbx.org/ecm/ldebug/rev/67e3d0554239|Add eldstrict mode in which every data relocation must be prefixed]] with a ''reloc'' or ''reloc2'' mmacro, utilising the new reloc warnings in NASM 2.16.02 to error out otherwise
 +  * [[https://hg.pushbx.org/ecm/ldebug/rev/b2fade5c7798|Add descriptions to all ELDs]]
 +  * [[https://hg.pushbx.org/ecm/ldebug/rev/564cb3eef66b|Reference in header]] the help for all ELDs with a help
 +
 +
 +===== Specific ELDs =====
 +
 +==== List ELD ====
 +
 +This ELD can operate on any accessible ELD files. The files to operate on are specified by a pathname pattern. The last component of the pattern may include wildcards.
 +
 +For DOS SFN search and bootloaded mode directory search, the asterisk is taken to fill the remainder of the field it occurs in. For example, "L*IST.ELD" will ignore the "IST" suffix in the name pattern and match just like "L???????.ELD". DOS LFN search may behave differently, but I do not consider this a defect in the debugger.
 +
 +There are three blocks of information that the list ELD can display:
 +
 +  * ELD filename and description line (if any)
 +  * ELD format magic, ELD instance name, and ELD header initial memory use indicators
 +  * ELD help (if any)
 +
 +The second block is enabled by a trailing "VERBOSE" keyword. The third block likewise by a "HELP" keyword. The first block is displayed unconditionally.
 +
 +It was a lot of work to support DOS and bootloaded directory search, including an inject handler to restore global state (DOS SFN search DTA, close DOS LFN search find handle). The boot directory search underwent two major revisions of the code links exported to ELDs.
 +
 +An optional code relocation is used to access the _PM=1 function ''intcall_ext_return_es'' to avoid including this function in _PM=0 builds of the debugger. The ELD checks its own code to insure the code link succeeded if it is needed.
 +
 +
 +==== KDISPLAY ELD ====
 +
 +This ELD displays the current contents of the N/K command buffers that are used by the L and W commands.
 +
 +
 +==== CONFIG ELD ====
 +
 +This ELD allows to show or set the config path and scripts path. These are the paths used by the EXT and Y commands to find the config path and scripts path: The config path is used by explicitly using a "::config::" prefix, and the scripts path can be used either with an explicit "::scripts::" prefix or if a single-file look up doesn't find a file for an EXT or Y command.
 +
 +
 +==== RN and RM command ELDs ====
 +
 +These ELDs now default to use their own internal ''fnsave'' buffers rather than using the auxiliary buffer. Using the auxiliary buffer is still possible in the sources but disabled by a build option.
 +
 +{{tag>ldebug eld}}
 +
 +
 +~~DISCUSSION~~
  
blog/pushbx/2023/1022_late_mid_october_work_on_extensions_for_ldebug.txt ยท Last modified: 2023-10-22 19:17:16 +0200 Oct Sun by ecm