harper-m@mars.cis.ohio-state.edu (Matthew Hayden Harper) (03/09/90)
Help!! I have made a program which converts Sun3 C executable files into motorola hex records for my eprom programmer. I am doing this so I can execute C programs on a 68000/68010 board which I have made. The program uses my own startup code to load initialized data segments, and zero out bss (unitialized data segments). I have been successful in doing this with commodore amiga executable files, however there are a few bugs in their compiler so I don't really trust it. However, I have been successful in using the floating point libraries and all of their string and math functions. I then wrote a program which converts a Sun3 executable file (with my startup code linked in) into an amiga executable file. I then run it through my amiga executable to motorola hex records program and everything works until it hits a sscanf function or a ssprintf function, at which time the system bus errors and crashes. I looked at the dependincies of sscanf() and sprintf() in /usr/libc.a and apparantly these functions are linking with some type of buffering system in memory which itself requires malloc(). However, my program uses floating point and did not crash when floating point routines were used, but when I tried to sprintf() the values into a string, the system crashes. The libraries I have for the amiga are already compiled, so I don't have source for them, and I don't trust them enough to convert to sun object libraries because I have found some bugs in a few of the libraries. If anyone has the source for C libraries which doesn't use operating system calls, I would really appreciate it if you could mail them to me (particularly the souce for sscanf and sprintf functions which don't use operating system calls). Also if you know how to cause floating point libraries to be generated completely in software independent of the operating system and a coprocessor with either the cc sun compiler or the gcc sun compiler, I would like to know how to do it (I am currently using gcc with the -mc68000 and -msoft-float options and I am not sure if this is correct). -=- Matthew Harper