I now doubt that the Borland 386 bug is really a Borland or 386 bug. I've found out that the zeroing of the code that calls Kernel() in FreeDOSmain() is done by DosMemFree() at the time free() is called from DoInstall(), because a wong segment is passed to free(). This wrong segment is returned by DosMemAlloc() when called by allocmem() from DoInstall(). So I think that the bug is in DosMemAlloc() and happens only in LAST_FIT mode, which is set just before calling it (through allocmem) in DoInstall().
I now tested a Watcom-built kernel, and the bug is there too, but it just wipes an earlier section of code in FreeDOSmain (the wiped code section happens to be just a bit before the "else" clause), which has already been executed at the time the wiping occurs. Actually, the initial wiping is done by DosMemAlloc() itself when it constructs the MCB. DosMemFree() writes the zeroes there later. So, I'm now sure that the bug is really in DosMemAlloc() and occurs only in LAST_FIT mode. But I can't say exactly where in DosMemAlloc() it is, since I don't understand this function yet.
So, we're almost there ;-)
Lucho
------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Freedos-kernel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-kernel