Hi Michael!

Very nice analysis :-).

I hope you also like my kernel patch for it...

> While testing out a users bug report, I found a terribly obscure difference
> between the way MS-DOS kernel works and FreeDOS kernel works.  It shouldn't
> matter, but it does to QuickBASIC 4.x applications, at least for some using
> BRUN40.   I don't know the scope of how many QB applications are affected.
>
> Here's the situation, running under QB 4.0.  The code is found in
> BRUN40.EXE and duplicated in the application's executable files:

[... QuickBASIC frees a block, resizes another block to the max after
finding the max size with resize to -1 size, then frees the first
block again, which fails on FreeDOS as free invalidates the block ...]

I would suggest the following patch for kernel 2036 (stable) -->

--- kernel/memmgr.old   2006-08-18 10:22:33.000000000 +0200
+++ kernel/memmgr.c     2006-08-18 10:22:33.000000000 +0200
@@ -66,7 +66,12 @@
      /* join both MCBs */
      p->m_type = q->m_type;      /* possibly the next MCB is the last one 
*/
      p->m_size += q->m_size + 1; /* one for q's MCB itself */
+#if 0                          /* this disturbs QB 4.x  double-free... */
      q->m_type = 'K';            /* Invalidate the magic number */
+#else
+    q->m_type = MCB_NORMAL;    /* make QB 4.x happy... */
+    q->m_psp = FREE_PSP;       /* leave MCB as "valid but free" */
+#endif
    }

    return SUCCESS;

This patch does make Norberts Lauer P600 SPS (PLC) tool work
for me in DOSEMU, and it does not seem to break other things.

At least compiling the whole updated 2036 kernel under the
updated 2036 kernel itself worked just fine... Well, after I
removed the TSR instance of Quarterdeck MFT (now freeware)
from RAM, that is, otherwise NASM ran out of memory ;-).

You still have to use LOADFIX to run P600, because not only
P600 but also the overlays use exepack or similar code, and
the a20 exepack workaround does not work for overlays. Not 
worth a kernel-side extra workaround, if you ask me.

You can find updated zips with kernel source and binary on:
http://www.coli.uni-saarland.de/~eric/stuff/soft/by-others/
kernel2036-binary.zip (343k) and kernel2036-source.zip (435k)

Happy testing!

Eric

PS: Talking about tests, I got a report that FreeDOS 1.0
works quite well in VMWare but that you have to use the
NOALTBOOT option if you want to use EMM386 there - else
you get keyboard confusion. Would it be good to make the
NOALTBOOT option automatic? EMM386 already autodetects
VMWare to auto-exclude e800-ebff, so... :-)


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to