On Sun, 24 Apr 2005, Eric Auer wrote: > Things that I found: > - there is an I86 define which is triggered for most (all?) known > compilers and which activates some Turbo C / ... style syntax > in some places. See portab.h and grep for I86 in kernel/*. and > tell me WHY we have I86 at all.
it's an old define to distinguish between the Intel chip and the Motorola mc68k chip. I don't think anyone has managed to build an mc68k FreeDOS kernel during the last 10 years but at some point it was possible. At least for Pat. > > ; we have never seen MSVC to use anything but eax, ecx, edx, > > ; nor have we seen Borland C to use anything but eax, ebx, edx, > > ; so we only protect eax, ebx or ecx, edx to conserve stack space > > ; WATCOM only uses FS: and GS: (using -zff and -zgf) and never > > ; any high part of the 386 registers > > If any of those assumptions is wrong, you are toast. For example if > compilers do start to use more registers. Even worse, there are a > few places where the Protect/Restore macros are NOT used: www.agner.org/assem has a piece (PDF) about calling conventions. This document may provide some more info. http://www.agner.org/assem/calling_conventions.pdf (Arkady-friendly URL) MSVC and Borland 16bit generating compilers have been dead for 10 years+. Noone expects their register allocators to change. Still it's a somewhat bold statement of Lucho to make about MSVC and Borland but I trust he did his research thoroughly. > - int2f.asm saves/restores FS and GS to SI and DI if the compiler is > Watcom. This saves 4 bytes of stack but is a BAD IDEA because it > hardcodes the idea that Protect/Restore macros save ONLY FS and GS > if the compiler is Watcom. I checked the OpenWatcom source code for 386 optimizations in the i86 code generator a couple years ago. There's no use of e* registers at all. I'll promise to let you know if an enterprising developer changes this, but frankly, I think that the chance of a meteorite hitting your house tomorrow at 3:00am is higher. Bart ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Freedos-kernel mailing list Freedos-kernel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-kernel