[Openec] Makefile.gcc

Frieder Ferlemann frieder.ferlemann at web.de
Thu Jul 26 17:34:37 EDT 2007


Hi,

I just added the file "Makefile.gcc".

This file allows to generate an executable of the openec
code for the host(!).

"make -f Makefile.gcc"
should generate it.


Of course this file does not do useful stuff (and as such
is on par with the code generated by SDCC for the kb3700)
Yet at least in one aspect it is better: it cannot do
harm to the EC!


So for the curious: you can load the code into a debugger
like f.e.

"ddd ./openec.gcc"

and then single-step through the code!)

The kb3700 specific registers of the code are mapped to
volatile variables. So if these variables are
(manually ...) poked to the values the kb3700 would see
then at least parts of the code can be checked
without touching the kb3700!



Now what the heck is this for?


While I'm not really sure this is immediately usefull
I want to give at least a few answers:

- it allows to test parts of the code without
  requiring a programming adapter and/or putting
  the XO at risk.

- SDCC and GCC will give a different set of warnings.

- debugging tools on the host tend to be more convenient.

- shows that the code for the kb3700 at least tries to
  be compiler independent.


Greetings,

Frieder


PS: while endianness of the SDCC/openec and X86/openec matches
    the length of int and long differs. Expect some glitches.
    (You like C? I don't.)



More information about the Openec mailing list