User Tools

Site Tools


blog:pushbx:2025:0714_early_mid_july_work_on_ldos_lzexe_and_msdebug

Early mid July work on lDOS, LZEXE, and MSDebug

2025-07-13, 2025-07-14

This week + Monday some changes were added to the lDOS kernel's comloader (the MZ exe image embedded into the ldos.com file), to the LZEXE ecm fork, and to MSDebug (the ecm fork of MS-DOS's Debug).

lDOS

LZEXE

MSDebug

MSDebug using lzexe?

MSDebug's executable file only runs as a DOS application (not device driver nor kernel) and the program doesn't access its own executable file. Therefore, it is ideal for compression with LZEXE.

The 13_568 byte flat-format executable is enlarged by 64 bytes to 13_632 bytes when using comtoexe with its /2 switch. This then can be compressed using the LZX0 format to 11_004 bytes (80.72% of the uncompressed file left).

Aside from compression, using only comtoexe /2 is ideal for MSDebug because for 64 bytes added, it can safely be attempted to load it into a small memory block (eg UMB) without the danger of running out of memory. This was achieved intentionally by adding the SP check to MSDebug's init code where it would be found by comtoexe. (The SP check is still needed otherwise because the int 21h function 4Ah call isn't checked for errors, so the memory block better be at least this large already.)

The only downside to using comtoexe /2 is that the program can no longer be run as a flat-format executable by DOS versions that do not support the MZ exe header. However, these versions already aren't really supported, and should at best emit an informative error message.

The downsides to compressing are as usual: Longer startup load time and virtual inability to patch the binary on disk.

You could leave a comment if you were logged in.
blog/pushbx/2025/0714_early_mid_july_work_on_ldos_lzexe_and_msdebug.txt · Last modified: by ecm