On Mon, 19 Jul 2004, Arkady V.Belousov wrote: > 19-éÀÌ-2004 22:36 Arkady V.Belousov wrote to > [EMAIL PROTECTED]: > > BO>> Essentially for Turbo C the compiler helpers are extracted from the c > BO>> compiler RTL to be absolutely sure we only link those and nothing else from > BO>> that library. These are automatically linked and called "far", which is > BO>> correct because init_text and _text are in different segments. This is why > BO>> those routines have to have a fixed segment and that's only easily > BO>> accomplished in low RAM. > AVB> I have the trouble: when I move _TEXT after HMA_TEXT and include into > AVB> TGROUP (to minimize usage of low memory), BC's kernel behaves wrongly. Do > AVB> you mean, that joining _TEXT with HMA_TEXT causes BC to generate near calls > AVB> to far routines? Hm. I should try: what happen if (for non-Watcom) move > AVB> _TEXT after HMA_TEXT_END and define for it new group (say, TGROUP2)? > > Unfortunately, this one also doesn't works. :( Probably, becuase > somewhere it not included into resident code, when computed size of this > code by substracting HMA_TEXT_END-HMA_TEXT_START. This is what you mean that > placing _TEXT into low memory "only easily accomplished"?
If you try to do that the problem is INIT_TEXT. Because the segment and group are different from _TEXT the compiler generates a far call to _TEXT, say, call 0010:1234. Exeflat or the UPX stub relocate that to call 0070:1234. Now if you move _TEXT to the the same segment as HMA_TEXT the compiler generates call "0110:1234" or something like that which is relocated to 0170:1234. But the code there is moved by the kernel, to, say, ffff:1234, without adjusting those far calls. Code gone, replaced by data, call it and crash. Only with patchobj tricks and stubs you may be able to avoid the low code (as was done with OW before ke2033 or so). Or by merging init and hma text into one segment but then the code by TC is >64K together (surely for FAT32). In the end, IMHO, it's just not worth the effort (just use Watcom instead!). Bart ------------------------------------------------------- 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_idG21&alloc_id040&op=click _______________________________________________ Freedos-kernel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-kernel