From: Brian P. <br...@sg...> - 2003-03-19 05:30:01
|
Hi (I don't know if this actually made it to the list, so I am sending it again. If it did just ignore this message) I am writing a boot manager named FreeLoader. Since it is a boot manager I have to write some 16-bit code to init protected mode so Mingw32 compiled code can run. I link it to an executable .exe file and the run "objcopy -O binary" to generate the flat binary file. This works great under all versions of gcc that I have tested (DJGPP, Linux gcc) except for Mingw32. The problem is that it seems to be fixing up the 16-bit addresses incorrectly. For example, in the latest FreeLoader code from cvs I have a 16-bit function called switch_to_prot(). In the map file it lists this function (correctly) as 0x832f. In the resulting binary file (after the objcopy) when I step through it with bochs it is actually calling 0x832d, which is the wrong address. Can anyone tell me how to go about fixing this in my code or can anyone here fix it in Mingw32? One other problem I have is that when I write functions with large amounts of local variables the compiler generates code to call a function named _alloca(). Is there some sort of compiler flag to turn this off? Thanks Brian |