2025-03-09
As mentioned, last week I didn't get to write a proper blog post. So this one's about two weeks' worth of changes.
Fix the error handling in realloc_ems_handle. EMS doesn't set an error code in BL, and do not modify the indirect pages variable in case of error.
Two changes to the test file program:
Align stack_top to a paragraph boundary. This doesn't modify the binary because it already happened to be aligned due to the stack size of 512 bytes.
Close the input file after reading all of it, but before creating the destination file. This would allow to specify the same file as both input and output, even with a sharer loaded. (But don't do that, on errors the file will be truncated.)
Detect the write_entrypoint_list mmacro like a DW directive, to handle its data as word data items. This was useful during lDOS development to compare two different revisions of the kernel, both of which were assembled using NASM. (A condition in msbio2.nas wasn't evaluated as intended because the ddataseg.nas include was missing. This led to a change between the binaries before and after this changeset.)
Add lkernpl.asm to load a single-file kernel at 00600h (like fdkernpl.asm) but pass along an lCFG block (like drkernpl.asm). Eventually all three of the *kernpl.asm files may be merged into one file, with the three existing filenames including this common file with appropriate options. However, this is of lower priority and can be done at a later time.
Add a variable called build_kernpl_module to allow using the new lkernpl.asm source file rather than drkernpl.asm.
I developed the bigtest application as a test program for determining how much of the Low Memory Area is available to allocate to a single process memory block. I submitted the program and several results to the retrocomputing stackexchange site as a question and answer.
Of note is that bigtest.exe sets up an execution environment compatible to the debugger's Extension for lDebug architecture. It can and does in fact use an unmodified copy of dm.eld from the debugger to carry out the memory dump display.
retf 2
boot protocol ldos; append …
in what the last clause is parsed as a comment after the protocol specification. The fix is still correct however.Relocating the DOS-internal UPBs and DPBs twice each is to simplify the changes needed. The early, first allocation of both in INITUPB and INITDPB depends on allocating from the first free block so that the allocation can grow upwards whenever more blocks are needed. This would have to be changed to immediately allocate at the temporary location. The early relocations happen to be fairly easy; the DOS-internal DPBs aren't even referenced by any other data structures at the early relocation point.