This shows you the differences between two versions of the page.
— |
blog:pushbx:2022:1126_ldebug_debug_x_2.00_nasm_lz4_depacker_for_vgapride [2022-11-26 22:11:38 +0100 Nov Sat] (current) ecm created |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== lDebug, Debug/X 2.00, NASM, LZ4 depacker for VGAPride ====== | ||
+ | |||
+ | **2022-11-25** | ||
+ | |||
+ | Recently I fixed a few bugs in lDebug and added two new address keywords. Other than that, the original Debug/X just jumped to version 2.00. | ||
+ | |||
+ | |||
+ | ===== The bugs ===== | ||
+ | |||
+ | The first bug was that leading blanks in commands read from the /C= switch or from the kernel command line were included verbatim instead of trimmed. This had the effect of indenting these commands oddly. (At first I believed this was due to lCDebug' | ||
+ | |||
+ | The second bug was that in order to specify a double-slash to the BOOT PROTOCOL= command, which is to indicate not to search for an additional file, it was necessary to enable command line support and specify a non-empty command line. The use of the '' | ||
+ | |||
+ | |||
+ | ===== The taken keywords ===== | ||
+ | |||
+ | During debugging of the double-slash problem I had to step into the BOOT command. In the various command, protocol, and protocol flags loops I repeatedly had to skip to the target of a conditional branch that did not yet jump, in order to skip past the numerous iterations of the loop. | ||
+ | |||
+ | This gave me the idea for a new command to do just that: '' | ||
+ | |||
+ | I at first considered adding the new command as just that, a command. However, I thought of how one may want to set additional breakpoints, | ||
+ | |||
+ | Next, I thought you may want to set a permanent breakpoint to one of the taken addresses as well. So the handling of those keywords moved up into '' | ||
+ | |||
+ | Yet again, I noticed that '' | ||
+ | |||
+ | Along the way I decided to do two forms of each of the two keywords: The short forms '' | ||
+ | |||
+ | Aside from all things mentioned so far, I also noticed that I can abuse the '' | ||
+ | |||
+ | Finally, the implementation of the taken keywords copies and re-uses parts of the pp commands to scan the possible prefixes and instruction at the current '' | ||
+ | |||
+ | |||
+ | ===== Debug/X version 2.00 ===== | ||
+ | |||
+ | The original Debug/X project, which I tend to still call FreeDOS Debug, recently jumped to the version number 2.00. The primary changes are support for the special-purpose DebugB (bootable) and DebugR (Protected Mode Ring 0) variants. DebugR is supposed to debug JEMM or HDPMI, and there are framing programs now included with JEMM as well as a repo called Deb386 which will use a DebugR image. | ||
+ | |||
+ | Other than the new Protected Mode support, three files for the different entrypoints were extracted from the main assembly source file. These are for 86 Mode, ring 0 Protected Mode, and DPMI Protected Mode. | ||
+ | |||
+ | The workings of these entrypoints was also changed. The '' | ||
+ | |||
+ | |||
+ | ===== R86M fault handlers ===== | ||
+ | |||
+ | I'm unsure when this was introduced, but Debug/X now also supports catching interrupts 7, 0Ch, and 0Dh in Real or Virtual 86 Mode. The stack fault and general protection fault handlers are intended for 286+ machines running in R86M, in which exceptions will call these interrupt handlers. Debug/ | ||
+ | |||
+ | The three new interrupt handlers, including the IRQ checks and the debugger exception handling, as well as the /M switch, are now available in lDebug as well. However, all of those are made conditional at build time and disabled by default. | ||
+ | |||
+ | One more change in lDebug is that the serial interrupt handler will do an In-Service Register check similar to the interrupt 0Ch handler' | ||
+ | |||
+ | |||
+ | ===== Another change in lDebug ===== | ||
+ | |||
+ | The isvariable structure format is now explained better in the comments of expr.asm and debug.mac, which among additions also fixes a comment that wrongly claimed the ivName field would point to an ASCIZ string. In truth, the length of that string is determined solely by a length field in the structure, and there are no terminators. | ||
+ | |||
+ | Additionally, | ||
+ | |||
+ | |||
+ | ===== NASM updates ===== | ||
+ | |||
+ | In recent weeks NASM received a lot of updates. I can proudly say that the version 2.16 release candidate 10 fixes all the major bugs that I reported in the last two years. It is tested to work by assembling lDebug with its defaults. The fixes include the '' | ||
+ | |||
+ | |||
+ | ===== VGAPride LZ4 depacker replacement ===== | ||
+ | |||
+ | Finally, I went and built Foone' | ||
+ | |||
+ | It turns out that they used an old version of the '' | ||
+ | |||
+ | As part of the preparations, | ||
+ | |||
+ | Finally, a magic change was to not loop past the first frame upon finishing decompressing it. This is needed because VGAPride' | ||
+ | |||
+ | The only downside to my depacker is that it is slower than the prior implementation. On a pcjs machine the decompression of each plane, with about 32 KiB of decompressed data each, takes about 1 second. It is much faster with the other depacker, although still perceptible. | ||
+ | |||
+ | |||
+ | {{tag> | ||
+ | |||
+ | |||
+ | ~~DISCUSSION~~ | ||