User Tools

Site Tools


blog:pushbx:2026:0125_late_mid_january_work

Late mid January work

2026-01-25

This week a little work happened. The MCP and CLU also got alternative backronyms to describe what they do: Multiple Command Payload and Comspec Load Utility.

MCP/CLU

  • Try to enlarge CLU's environment if insertion of the COMSPEC variable fails. Due to a hack, this is likely only needed when the CLUMCPFLAG indicates that CLU shouldn't relocate its process. (The hack is that if the process is relocated, CLU will usually enlarge the environment block by 32 bytes to anticipate the insertion.)
  • Bugfix, when inserting the COMSPEC variable avoid an off-by-one error. The bx register already points behind the NUL of the pathname to insert, so bx - pathname gives the full length - the spurious +1 was under the assumption that bx pointed at the NUL. In practice this could truncate the environment or corrupt the name of the next environment variable.

lDebug

lDOS kernel

In the exec.nas source text file, add a comment on the MZ .exe image read loop. In particular, if the file is >= 512 bytes short for the given exePages size, the exec call errors out. exeExtraBytes is never read. Due to the choice of boundaries for the loop, a non-last read being 1 to 511 bytes short will always lead to the subsequent read to be at least 512 bytes short, so the desired invariant is upheld.

I suspected that there may be a bug in this loop because I reviewed it for the report to the repo of "the list", in which I suggested possible additions to the interrupt list.

Question on the PSP environment field for DOS extenders

In the forum, I asked what happens if a DOS extender changes the PSP environment word from a segment to a selector, and then an exec runs with a zero-value for the source environment. Two replies by tkchia indicate the DOS extender will simply handle the exec as well, so it can intercept attempts to run exec that would read from the PSP.

You could leave a comment if you were logged in.
blog/pushbx/2026/0125_late_mid_january_work.txt · Last modified: 2026-01-25 16:28:11 +0100 Jan Sun by ecm