User Tools

Site Tools


blog:pushbx:2026:1004_september_october_work_on_ident86_dosemu2_kernel_command_line

September October work on ident86, dosemu2 kernel command line

2026-10-04

lDebug (experimental)

  • doc: Update news-r11 manual section with dosemu2 PM XMS support, init bug that would patch the code1 part discarded for non-bootloaded mode, and data links to allow Extensions for lDebug to tell whether the build includes bootloaded mode support.

lDOS kernel

dosemu2

An old feature I intended to add, passing a kernel command line to the FreeDOS or RxDOS.3 load file, has now been implemented in a slightly different way than my original proposal. Stas instructed the Claude Code LLM to write the changes needed. I tested this yesterday and it was merged today. The command line is passed using an environment variable alike parameter to the dosemu executable, which must start with :FDCMDLINE= followed by the contents to pass to the load file.

Care must be taken not to include another variable starting with a colon after the command line variable. Also, passing along quote marks doesn't work in the expected way (but whitespace does). If no command line is passed, the load file can detect the absence of the stack space reservation and (likely) the "CL" signature marker.

ident86

  • A few time performance optimisations: Shorten wait times for writing data to debuggee memory and for disassembling the data, and slice the fullarray to start at lastdisassembly which was previously handled by continuing if the address was below lastdisassembly.
  • Initial commit of insbound.py and reading the IBL file in ident86.py. IBL stands for "Binary Instructions Boundaries List File". In the first revision, IBL0, it lists every instruction boundary in the .tls file, in order of the binary addresses. This allows a binary search to find the instruction boundary that is closest to a particular address. The entries reference the binary start address (within binary image file), .tls trace listing file seek offset, .tls line number, and the active base value for this machine code dump.
  • Add IBL1 format. This additionally stores the most recent set source file line of the .tls file corresponding to the machine code dump referenced by an instruction boundary entry. Dereferencing this pointer in the IBL entry allows to walk the file entries (including set source file, push source file, and pop source file) to quickly enumerate the active source file for a particular instruction. The IBL entries known from IBL0 grow from 16 bytes to 24 bytes for the IBL1 format.
  • Add the switch --run-insbound to call insbound.py from an ident86.py run. If an IBL filename is specified, it is passed along, otherwise the trace listing filename is modified to produce an IBL filename.
  • Use shlex.quote function to escape the parameters passed from ident86.py to insbound.py (this is likely to fail on MSWindows if not using a Unix-like shell).
  • Initially write the IBL file header size as zero, so cancelling an insbound.py command will not leave an apparently valid file.
  • Add the --no-run-insbound switch. This is in case the reverse switch becomes default enabled at some point, allowing to disable the insbound.py call.
  • Use hashlib MD5 for faster checksumming of the trace listing file. Before, with the byte-wise checksumming loop, processing an 8 MiB .tls file took about 2s. With this change, it takes about 0.08s.
  • Add the ident86.py switch --insbound-format to select a format to pass to insbound.py
  • Generate the IBL2 format, which also records the labels that would be detected by the current ident86.py label detection. (As that is subject to change, the IBL2 format likewise may change later. There is a sequential ID identifying the label format.)
  • Accept IBL2 format files in ident86.py, however the labels aren't used yet.
  • Fix the ibltotalentries calculation, it needs to subtract the header size to get the true amount of entries.
  • Fix the ident86.py beforedeque code. It should include the next line from the priorlinesdeque if the currently processed line includes only a machine code dump but no data or instructions in the listing line. Before, this only worked if there were no relocations in the machine code dump.
  • Lengthen the priorlinesdeque to hold up to 64 lines (up from 16 lines).
  • Speed up the --show-diff output of .tls listing lines greatly. The change is from more than 300s to less than 60s for the same output. This change re-uses the IBL0 format entries to determine the maximum .tls file seek offset to process for showing a diff in findsourceline. All IBL entries within the affected range, plus some more space included for hardening, are processed to find the maximum .tls offset that they reference. Then the main findsourceline loop detects when the maximum offset is exceeded and ends its loop at that point. This speeds up the --show-diff listing so much because previously the entire remainder of the .tls file had to be searched. This is due to the fact that .tls files are sorted by source text order and object file order, not the order of instructions or data in the binary file.
  • For the firstrun of finding an instruction in findsourceline, start at last Trace listing source line. This optimisation works even without an IBL file, but combines and is sped up by IBL1 files.
  • Fix, put the IBL2 sign (sequential ID) at offset 28. Offset 24 was also used for the end of the files table and beginning of the labels table in IBL2 format.
  • Use IBL2 sequential 0 format labels to speed up findsourceline a bit. The findsourceline loop can start at the prior label rather than the prior trace listing source line, needing less data to be processed. The lastlabeldup value is read from the IBL labels table, as prior occurrences of the same label won't be found by this scan. To have both sides agree what dup value a label has, it is important that all three scanners agree: The scanner in insbound.py, the one in findsourceline to find a .tls line, and the one in findsourceline to find a corresponding .nas/.asm source text line.
  • Check the IBL2 format's sequential ID for mismatch, to determine whether to overwrite an IBL file. This avoids the need to manually run insbound.py with its --force switch or to delete the existing IBL file to upgrade to a different IBL2 subformat.
You could leave a comment if you were logged in.
blog/pushbx/2026/1004_september_october_work_on_ident86_dosemu2_kernel_command_line.txt · Last modified: by ecm