This shows you the differences between two versions of the page.
— |
blog:pushbx:2022:1121_ldebug_e_inicomp_review_and_a_change [2022-11-21 18:35:31 +0100 Nov Mon] (current) ecm created |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== lDebug /E, inicomp review and a change ====== | ||
+ | |||
+ | **2022-11-19** | ||
+ | |||
+ | This week I added another switch to lDebug to support using it for offline patching of iniload files (such as the debugger' | ||
+ | |||
+ | ===== ===== | ||
+ | |||
+ | Without the /E switch or its associated DCO6 option '' | ||
+ | |||
+ | Now patching a binary does not require using a run command, so the stack is not used by running the program. However, patch.sld uses the stack as temporary storage to hold its search sequences. It uses the debugger' | ||
+ | |||
+ | So the /E switch will enable using the last 512 bytes of the PSP memory block for the stack, setting up '' | ||
+ | |||
+ | A .big image is essentially similar to a .com format flat executable, that is it is a flat binary without headers and it should be loaded to the PSP segment' | ||
+ | |||
+ | |||
+ | ===== inicomp' | ||
+ | |||
+ | The compressed inicomp .big file's .exe mode entrypoint will use the stack it is passed to determine how much memory it has for decompression. And if the image .exe auto stack option is enabled, inicomp will pass the stack verbatim to its decompressed payload. | ||
+ | |||
+ | That briefly confused me today because how will the outer iniload know how much memory to assign to the stack? | ||
+ | |||
+ | Of course, this is already handled properly by the mak.sh script: It will use the tellsize and decompsize to determine the minsize. The decompsize is either detected using the test program build, or setup to equal the size of the compressed plus uncompressed image. | ||
+ | |||
+ | The minsize is used to determine the minimum allocation (exeMinAlloc) of the compressed executable' | ||
+ | |||
+ | |||
+ | ===== inicomp' | ||
+ | |||
+ | During today' | ||
+ | |||
+ | The zero entrypoint is not used by default: The application mode sets up the MZ header entrypoint as -16:256 + 64, and the kernel mode has its entrypoint as 0:32. The device driver entrypoint is referenced by the device header which lives at the beginning of the image. | ||
+ | |||
+ | This change allows loading pddebug.big using '' | ||
+ | |||
+ | {{tag> | ||
+ | |||
+ | |||
+ | ~~DISCUSSION~~ | ||