Compiling, Programming Information...

Hey again. I'm still vaguely interested in this Saturn programming thing, and I've been reading up on C++, GCC, and Make (I'm pretty new at this).

But, I don't quite understand the need for an extra compiler. SGL and SBL libraries, sure, but is there a reason the KPIT compiler is recommended?

I recall that GCC can compile code for the SH2 processors, and that someone was working on integrating the SGL library into Dev-C++, but had some problems. Is there a reason why it doesn't work? I've downloaded the MinGW set of ported tools so I can have access to Make and GCC, and I know from looking through the tutorials that GCC is used in Saturn development to some extent, but I don't understand the distinction between the use of the KPIT compiler and of GCC. Are they the same thing, or KPIT a variant?

And...what is COFF? Antime's page said it has something to do with Sega's libraries (they are compatible with COFF), but I don't know what COFF is. My only guess is from reading GCC debugging docs which say that COFF is a type of output format, but that doesn't make any sense at all.

Sorry if these questions are a little too obvious...
 
Well, I did some more research and I managed to answer one of those questions.

I figured out that KPIT is actually a cross-compiler designed to output code runnable on an SH2, is that right?

I also figured out that GCC does not natively output code for any of the supported platforms, but only if it has an available customized cross-compiler version of itself installed.

I also pretty much figured out that I am going to be unable to build my own cross-compiler environment using MinGW and Windows, considering my inexperience at compiling huge projects and the fact that I bet compiling GCC under Windows in a non-Unix environment is even more of a nightmare.

So, this is why I need KPIT, right? Because it's a version of GCC configured to generate SH2 code that my GCC can't, right?

And, that just leaves the "What is COFF" question, if anyone's got any ideas.
 
KPIT Cummins Infosystems Ltd. is actually an Indian consultancy business who have decided to create and make available for free cross-development toolchains for Renasas' SuperH and H8 microcontrollers. GNUSH is the name of their SuperH toolchain. (It is not configured for SH2 in particular, but can be used with any of the supported SuperH CPUs.)

COFF is an older output object file format which is still widely in use because it is simpler than the newer, more powerful ELF format. The precompiled Saturn libraries are only available in COFF format, so if you intend to use them your life will be slightly easier if you use a toolchain configured to use COFF, instead of converting the objects using eg. objcopy. Other than that, the choice of format to use is fairly arbitrary.

Even though the final Saturn binaries will be "pure" binaries without any included symbolic information, an object file format is still needed in the build stage to allow objects to be linked together, relocated etc.
 
Thanks for the info. Right now I registered at KPIT's site, but I'm kinda waiting for the login information. ...I'm kinda wondering about attempting to either try the older Cygnus compiler or try to make my own cross-compiler (at least attempt it), since I registered early this morning and received nothing after that.
 
I received some information and starting accessing their site. Everything seems really good, but I've got another question or two. Sorry if this is a little annoying...

1. I know this is kinda obvious, but...I'm guess that I'm programming for the SH-2? What I mean to say is, if I can visualize how the Saturn will execute my code, the SH-2 is going to be doing the executing, right?

2. What exactly will their debugger help me do? I imagine it helps track SH-2 code, but it's not really any good for working with a real Saturn's different chips, so it can't quite help there, right?

3. Should Saturn programming use C++ or just C? I've read in the Wikipedia entries Antime posted that original COFF doesn't support full C++ debugging, but that apparently variants have been made since then that support it.

Sorry if I should already know this...
 
Originally posted by Omni@Wed, 2005-01-05 @ 07:17 PM

1. I know this is kinda obvious, but...I'm guess that I'm programming for the SH-2? What I mean to say is, if I can visualize how the Saturn will execute my code, the SH-2 is going to be doing the executing, right?
Yes, and more specifically the master SH2.

2. What exactly will their debugger help me do? I imagine it helps track SH-2 code, but it's not really any good for working with a real Saturn's different chips, so it can't quite help there, right?
If you were to make a debugging stub and some other "glue" you could use GDB to debug your code running on a real Saturn (using the Commlink), with source level debugging and everything else you could want from a debugger. Other than that, it's not too much use. AFAIK GDB contains an SH simulator which you can use to test some code, but naturally not anything machine-dependent.

3. Should Saturn programming use C++ or just C? I've read in the Wikipedia entries Antime posted that original COFF doesn't support full C++ debugging, but that apparently variants have been made since then that support it.

Use whatever you want and can get working.
 
Back
Top