Repository navigation
Define COMSPEC in the DOS environment block - #2506
Closed
maximilien-noal wants to merge 1 commit into
Closed
maximilien-noal wants to merge 1 commit into
maximilien-noal wants to merge 1 commit into
Conversation
Define COMSPEC=Z:\COMMAND.COM in the environment block when the host has not set it, so DOS programs see a valid command interpreter path. The larger environment block is allocated before program memory, so program load segments shift by 1-2 paragraphs. All affected goldens were regenerated through the catalogue workflow and reviewed: the diff is pure segment/offset renaming with identical instruction content. Also updated the two batch_if_errorlevel readability baselines (RegisterReads max 13 to 14: the new single-segment selector layout adds one ES = AX register read) and the int_service_calls oracle byte (0x016D to 0x016F: segment rename of the same result byte). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Changes
COMSPEC added in
DosProcessManagerconstructor:envVars["COMSPEC"] = "Z:\COMMAND.COM"(if not set).Consequence: env block grows ~23 bytes → allocated before program memory → load segment shifts +1-2 paragraphs. All goldens regenerated, reviewed: pure address/segment/offset renames, same instruction content.
Also updated alongside the golden regeneration:
batch_if_errorlevel_dispatches/batch_if_errorlevel_equals_dispatchesreadability baseline:RegisterReadsmax 13 → 14. Both COM programs now map to one segment (016E) via a selector node, andESbecomes data-driven (ES = AX), adding exactly one register read. Same instruction content, different address.int_service_callscatalogue oracle byte0x016D→0x016F: pure segment rename of the same result byte.Rationale behind Changes
Many DOS programs read
COMSPECfrom the environment block to locate the command interpreter (e.g.STARTin batch files, or programs that re-invokeCOMMAND.COM). Spice86 previously left it unset. Defining it asZ:\COMMAND.COMmakes the environment block behave like a standard DOS system with a valid command interpreter path.Suggested Testing Steps
Validation evidence (all run on this branch):
dotnet build src/Spice86.sln— Passed: 9 projects, 0 errors, 0 warnings.dotnet test tests/Spice86.Tests --no-build -- --filter-not-class '*SingleStepTest*'— Passed: 7871/7871, 0 failures. (SingleStepTest excluded per repository test rules; CI runs it on Linux.)--parallel none); second pass made zero golden changes. Writers re-disabled, rebuilt.016D→016E/016F, data segment0x3A8→0x3A9), no instruction content changes.Manual check: run any batch program using
STARTor a program that readsCOMSPECviaINT 21 AH=38hand confirm it now seesZ:\COMMAND.COM.