From b87efb681c5b1a38969e2b548b5e413f5aa5995d Mon Sep 17 00:00:00 2001 From: "E. C. Masloch" Date: Wed, 28 Oct 2026 21:33:48 +0000 Subject: [PATCH 1/2] int 2Fh handler should set CY, ax=1 for unknown functions lDOS programs such as lDebug's init call int 2Fh function 1261h to query for the first UMCB. To ensure the function is supported, the caller enters the int 2Fh handler with CY (Carry Flag set) and only trusts the result if it is NC (Carry Flag clear) and AX is returned as none of 0FFFFh, 0, nor 1. The condition removed by this commit would handle unknown functions above 31h as if they were supported: Flags NC and AX not set to any error code value. This clashes with MS-DOS and lMS-DOS which will both set CY, AX = 1 for unsupported 12h subfunctions. Function 61h is supported by lMS-DOS but not by MS-DOS. Using this commit, the lDOS programs will detect that function 1261h is not supported. The other change is to set AX = 1 on the unknown function, which subfunctions below-or-equal 31h previously did not. The second reference indicates that MS-DOS v4 (and lMS-DOS) sets AX = 1 for subfunctions 30h and 31h. (DTab is defined in ms_table.nas and does not contain subfunctions past 47 = 2Fh.) Reference: https://hg.pushbx.org/ecm/ldebug/file/7c168a97c52e/source/init.asm#l5266 Reference: https://hg.pushbx.org/ecm/msdos4/file/3aeedd765a59/src/DOS/ms_code.nas#l655 --- kernel/inthndlr.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kernel/inthndlr.c b/kernel/inthndlr.c index ea45e240..5c73f0cf 100644 --- a/kernel/inthndlr.c +++ b/kernel/inthndlr.c @@ -3386,14 +3386,11 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs FAR *pr) #endif default: - if (r.AL <= 0x31) - { not_implemented: put_string("unimplemented internal dos function INT2F/12"); put_unsigned(r.AL, 16, 2); put_string("\n"); - goto error_carry; - } + goto error_invalid; } return; long_check: From 12f4f7dc4105cadabb4e94a75b47f07e7f26d2f3 Mon Sep 17 00:00:00 2001 From: "E. C. Masloch" Date: Wed, 28 Oct 2026 21:43:33 +0000 Subject: [PATCH 2/2] make unimplemented DOS int 2Fh function 12h subfn quieter --- kernel/inthndlr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/inthndlr.c b/kernel/inthndlr.c index 5c73f0cf..b6b7474e 100644 --- a/kernel/inthndlr.c +++ b/kernel/inthndlr.c @@ -3387,9 +3387,11 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs FAR *pr) default: not_implemented: +#ifdef DEBUG put_string("unimplemented internal dos function INT2F/12"); put_unsigned(r.AL, 16, 2); put_string("\n"); +#endif goto error_invalid; } return;