Salve!

Uploaded at http://linux.tu-varna.acad.bg/~lig/freedos/CVSPATCH.TXT is a set of patches allowing the kernel to build successfully with Borland C++. The Borland C++ versions I tested are 3.1, 4.0 (minimum size) and 5.2, but 4.5 will surely work too. The patches are mostly UWORD type casts, but there are a couple of occasions where the compiler warned about signed / unsigned comparison mismatch and they address this issue too. One patch (of "talloc.c") permits MSC to build SYS (needed as MSC lacks brk and sbrk library functions). The patch of "main.c" there improves the compiler and CPU version information shown in the signon message. I added "ALLFLAGS=-Ol -D_M_IX86=300" in my CONFIG.BC5 (CONFIG.BAT for BC) to allow for CPU recognition for the 16-bit Borland compilers (_M_IX86 is predefined in Watcom and in the 32-bit Borland compilers, but not in the 16-bit Borland compilers). At the same time this patch reduces the number of printf calls.

But there is a mystery that I couldn't solve! If the unneeded at first glance printf("4") at the start of FreeDOSmain is removed, the Borland kernel dumps an "invalid opcode" message after the install commands are processed (if any). This happens just when the kernel() function is entered. I don't know why this happens. These patches work for me and reduce the size of the compressed kernel by ~2.3 KB compared to Watcom (but increase the resident kernel size by ~3 KB). However the crash without the printf("4") worries me, so if someone has any ideas on the reason for this, you're welcome. Something very strange happens. While I was testing, I found out that ANY printf ANYWHERE in FreeDOSmain before the last kernel() call line fixes things, but before I fixed the signon message, if the size of the string printed by it was too short, either the same invalid opcode crash occured, or HIMEM64 reported that some Int 2F functions were missing (in German ;-)

So, now it works but probably the problem is just masked. (I wonder how many other such problems can be masked even in the Watcom version?!) Of course, the Watcom version is surely better but when you MUST stuff the kernel in the BIOS ROM or in a diskette, a 2.3 KB size saving is really very welcome (plus the 1.3 KB saving from aPack ;-) And Borland C++ 5.2 is still used by Datalight for their ROM-DOS, so albeit inferior to Watcom, it can't be ignored, can it? The more so as I'm sure it'll follow the fate of Turbo C 2.01 and Turbo C++ 1.0 - will become a part of their museum some day, which means FREE! (Did someone expect that Turbo C[++] could be free 10 years ago? ;-)

Lucho


------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Freedos-kernel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to