Hi Michael, and thank you very much for noticing this incompatibility! I wonder how many such undocumented things remain to fix... Indeed, incompatibility is a bigger problem for us than bugs.

I was looking at why Solitaire Suite doesn't work with FreeDOS per a recent Bugzilla entry. It instead fails with a QuickBASIC BRUN45 or invalid opcode error.

Turns out that BRUN45 expects int 21h, function 4Ah, to return the resized segment (the entry ES value) in AX on successful return. FreeDOS, naturally, leaves AX values to their entry value upon success.

I must note that not only MS-DOS, but also DR-DOS does this! Just wonder how did they learn that?!


This behavior is not documented in RBIL or MS-DOS Encyclopedia. However, I ran a simple test program under the Win2K DOS box and AX does change to the ES/resize segment after the INT 21h function 4Ah call. Then I forced the AX value to ES/segment value under the debugger and Solitaire Suite started up.

This is *nowhere* documented indeed. So, call it a pearl ;-)

The consequence of BRUN45 depending on AX holding a resized segment can cause it to load programs at invalid segment addresses with the expected poor results. Occasionally it even works.

This may affect a fairly large number of programs. It certainly affects Solitaire Suite.

It affects all non-statically linked programs built by Quick Basic.

I suppose this post should go to kernel list, as well, but I did that recently for the 32RTM bug and don't want to annoy the thrifty bandwidth-savers by overdoing it. Besides, is there anybody who reads kernel who doesn't read devel?

I used to be such a man but now I subscribe to all the 3 lists (because I knew you'd do that! ;-)


Anyway, please find a new kernel binary and patch collection at my well-known kernel page (don't you have a bookmark for it already? ;-) that is http://linux.tu-varna.acad.bg/~lig/freedos/kernel/

Here's the corresponding unstable kernel branch patch chunk:

--- cvs/kernel/kernel/inthndlr.c 2004-07-25 12:55:58.000000000 +0200
+++ src/kernel/kernel/inthndlr.c 2004-08-30 10:33:46.000000000 +0200
@@ -1003,6 +986,7 @@
panic("after 4a: MCB chain corrupted");
goto error_exit;
}
+ lr.AX = lr.ES; /* Undocumented MS-DOS behaviour expected by BRUN45! */
break;


       /* Load and Execute Program */

Thanks once more, and... keep up the good work! ;-)

Regards,
Lucho


------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click _______________________________________________ Freedos-kernel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to