Skip to content

int21: add missing break after AH=51/62 - #309

Merged
stsp merged 1 commit into
masterfrom
claude/project-thread-id2neo
Sep 26, 2026
Merged

stsp merged 1 commit into
masterfrom
claude/project-thread-id2neo

Conversation

@stsp

@stsp stsp commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Before: since 81ee617 (AH=8Ch), int 21h AH=51h/62h falls through into the new AH=8Ch case. With AL=2 it installs a SIGHUP handler from DS:DX and returns the previous handler offset in BX instead of the PSP; with any other AL it returns CF=1, AX=1.

After: AH=51h/62h return the current PSP and leave AX, flags and the signal state alone.

The Phar Lap 286 loader in the Crusader demo calls AH=62h with AL=2 left over from an earlier call. It got 0829h instead of its PSP 9CEEh, read the environment selector from the wrong segment and stopped with "Initialization failed -- error code 8". With the break it loads and runs.

How: one break; after irp->BX = cu_psp; in int21_syscall().

Commit 81ee617 put the AH=8C handler right after "Get PSP", so
AH=51/62 fell through into it. With AL=2 (_SIGHUP) that installed a
signal handler from DS:DX and returned the previous handler offset in
BX instead of the PSP; with any other AL it set CF and AX=1.

Phar Lap 286 loader (Crusader demo) calls AH=62 with AL=2 and got a
bogus PSP, failing with "Initialization failed -- error code 8".
@stsp
stsp marked this pull request as ready for review September 26, 2026 00:42
@stsp
stsp merged commit 1fa6f93 into master Sep 26, 2026
4 checks passed
@stsp
stsp deleted the claude/project-thread-id2neo branch September 26, 2026 09:05
@stsp

stsp commented Sep 26, 2026

Copy link
Copy Markdown
Member Author

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants