User Tools

Site Tools


blog:pushbx:2026:0811_early_august_work_on_lbacache_bugs

Early August work on LBAcache & bugs

2026-08-09

Most of the work this week was on converting Eric Auer's LBAcache to provide and use an Alternate Multiplex Interrupt Specification (AMIS) multiplexer. (The use is in uncache, the transient part that works with previously installed instances rather than installing a new one.) The advantages are as follows:

  • Cooperates with other TSRs by providing an IBM Interrupt Sharing Protocol (IISP) header, and an interrupt list for the AMIS interface.
  • Decouples the hardcoded variable and entry layout required for prior versions.
  • Allows detecting resident instances without the error-prone memory scan.
  • Using the advanced deinstallation method the uninstaller can take advantage of other IISP headers and AMIS interrupt lists.
  • Multiple resident instances can now uninstall cleanly using a single STOP command.

The disadvantages are:

  • Need to hook interrupt 2Dh.
  • Several paragraphs of memory spent for the multiplexer-specific data structures and code handlers. (Due to the optimisations of the resident part, the updated LBAcache including the multiplexer still uses less memory (table @ 1050h) than Eric's last version (table @ 117Ch).)

I found that testing LBAcache works best with buffers=1 in ldos.ini, or by adding append buffers=1 to the kernel command line. That way, DOS cannot buffer as much as it would usually, hence more reads go to LBAcache's handler.

patchini

The patldos.asm assembly language program's matching of progress type keywords was severely broken. The changeset message states:

patldos.asm: fix match of PRO mode keywords

Selecting "app" would indicate an error stating that "pp" was an invalid progress mode. The cause of this error was the stray mov dx,si (si is CHG after the call to comparecaps).

Next, the description would be matched unintentionally. This was due to not incrementing past it for the first .loopinnerpro iteration. Solved by moving inc di twice to that label.

Subsequent mode keywords wouldn't be matched because the code at .nextouterpro popped di once rather than twice.

Finally, .gotpro doesn't use the stacked di pointers any longer so discard them off the stack.

lDOS kernel

Bugtracker

Add new bugs recently found:

wwwecm scripts

LBAcache

ETA:

ETA:

Highlights

Eric's bugs

The veritable bugs in the old revision of Eric's LBAcache, mostly copying the entries from above that list the fixes:

  • The memory scanning uninstaller didn't free all memory if multiple instances of LBAcache were installed. The multiplexer uninstaller naturally finds the downlink from one LBAcache instance to another and uses it to uninstall everything, regardless the order of the scan results.
  • The memory scanning didn't find an LBAcache instance in a certain UMB on dosemu2, due to the segment addresses that it chose to scan, specifically with the PSP at segment C1AAh.
  • Fix so that XMS handle is freed on later installation errors.
  • Fix to actually call eject (13.46) with drive B: rather than calling it twice for drive A:
  • Close all process handles on successful installation before TSR using int 21h function 31h. Fixes the System File Table (SFT) leak if run with I/O redirection.
  • Fix MEMOIZE function to use the drive/unit number for hashing, rather than the LRU byte of the cache table entry.
  • Fix REMEMOIZE code to mask away the BINMASK from sector number in EAX, both to run the memo hash and to compare the resulting cache table entry to the requested sector.
  • Insure that there's enough stack space between the end of the tables and the stack used during TSR, so that DOS certainly won't corrupt the bonus table after the flush.
  • Free separate stack block on int 2Dh function 02h call (uninstall), if TUNS was used during installation.

ecm's bugs

Bugs that I introduced and later fixed during my work on LBAcache:

Optimisations

You could leave a comment if you were logged in.
blog/pushbx/2026/0811_early_august_work_on_lbacache_bugs.txt · Last modified: 2026-08-11 22:10:55 +0200 Aug Tue by ecm