Table of Contents
Late March push for revised lDOS kernel
2025-03-30
This week I worked on verifying and improving the lDOS kernel some. Particularly the use of segregs to address either DOSGROUP (DOS data), DOSCODEGROUP (DOS code), or DOSENTRYGROUP (a few variables in the entry section that's stuck in the Low Memory Area).
tractest/listvars.pl
The listvars.pl script can check assumptions on many memory accesses, by reading a .tls (trace listing) file. The script recognises section changes (annotated by convlist.pl that outputs a .tls file), maps sections to groups (read from a WarpLink extended map file), records the sections in which labels are declared, and can check that assumptions (read from assume directives in the sources) match the sections used for accessing certain variables.
- If filtering the .tls file using
--filter-section=display all tls source file lines. This allows TracList or the like to still associate a certain line with the corresponding source listing. - Allow checking near immediate branches when the target is matched with trailing blanks. Strip the blanks.
- Add switch to list accesses, for now only those with square brackets.
- List accesses from a line commented with eg "access with es".
- Move the filter output into the second loop, leaving the first loop only to collect labels.
- Match bracketed access with text after the variable before the closing bracket.
- Keep track of assumptions (read from assume directives, CONTEXT mmacros, or DOSASSUME mmacros).
- Bugfix to pick up the label used after the PROCEDURE mmacro, rather than the mmacro keyword.
- Check assumptions against segregs used for variable accesses, and allow listing only mismatches.
- Always set CS assume, even if error displayed.
- Add option to list multiple uses of the same label.
- Add option to list multiple uses only if differing in which section is used.
- Recognise the I_am and I_am_nobits mmacros as declaring labels.
- Do not treat LEA instructions as variable accesses.
- Support alternative sections indicated by comments in the source code. These are carried into every label info entry.
- Add switch to list when an assume directive is expected after write of a segreg (currently MOV or POP) but doesn't occur.
- Hackish extension to allow two expect assume in flight.
- Remember expectation across empty lines.
- Recognise PSP in assume directive as nothing.
- Ignore an expect if it matches an already in flight expect.
- Keep track of push segreg before pop segreg to tell what assumption should be matched.
- Keep track of MOV from segreg to r16 before a MOV to segreg from the same r16, to tell what assumption should be matched.
- Check assume match after a get_ds_ or get_es_ function call (recognising "dosdata" or "dosbiodata" for DOSGROUP, "dosentry" for DOSENTRYGROUP, and "doscode" and "biocode" for DOSCODEGROUP).
- Recognise "getdosdata" calls as setting AX to the DOSGROUP segment.
- Handle case of a segment override on a separate line before an explicit bracketed memory access (used in DSK$INIT).
wwwecm scripts
Add msdos4 repo's doc subdirectory to update-doc-wwwecm script.
lDOS kernel
- Add assume directives to lDOS .asm new source files.
- Avoid some re-uses of the same labels in different object files.
- Bugfix a call to Clear_IDs from SYSINIT section, needs a near transfer.
- Fix tag mismatch crash sites not to call DOSINIT in the wrong section, rather add an entrypoint named TAGCRASHDOS that outputs a proper message indicating the system halt.
- Protect the first UMCB if adding an UMB that starts right above it. (Mentioned on the FreeDOS kernel tracker, re-using the same test to show that it doesn't check for out of memory conditions.)
- Word-align two byte variables read together.
- Merge control flow for checking for an empty UMCB linking to an UMB, so that the first UMCB protection logic needn't be duplicated.
- Add COMPAT= options for protecting first UMCB vs enlarging the Low Memory Area. No-op as yet.
- Implement enlarging the LMA.
- Display a message if the LMA is enlarged.
- Avoid re-using some label names. List generated by
listvars.pl src/BIOS/msbiow.map src/BIOS/msbio.tls –list-multi –list-multi-section-mismatch-only - Avoid re-using some more label names. Includes name1 which matched the NAME1 in the Swappable Data Area. (Generating the list for this required the listvars.pl change to recognise I_am mmacros as declaring labels.)
- Fix assume directives in exec.nas
- Fix more assume directives, and add the alternative section named STACKSCODE.
- Fix wrong segment addressing accesses found by listvars.pl
- In mshard.nas (int 13h patch for AT ROM-BIOS sector read) use an alternative section for cleaner assume directives.
- Fix new kernel access errors after prior changes.
- Fix assume directives again. Do push ss in one spot rather than push ds. (In fact it is assumed that DS equals SS here, for the far call.)
- Fix msstack.nas expecting CS assumption to be SYSINITGROUP rather than STACKSCODE. This code runs in STACKSCODE segment, not as part of SYSINIT.
- Update lDOS version to 2025 March.
