🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #41848

Config gcc for embedded M68K - help please

#41848
From: Mike Morgan
Date: Tue, 06 Feb 1996 00:00
33 lines
1806 bytes
Hi,

I am very keen to use gcc for a project at work. However, I must configure
it to cross compile from DOS/Windows to M68K. This is okay but what I am
really having trouble with is figuring out how to tell the compiler that
it is compiling for an embedded system running in EPROM.

So far, I have done this by including some asm statements in my main 
function to set up the supervisor stack pointer and set some required
registers (the board is a 68307? with lots of memory mapped configuration
registers for things like bus width and timings).

At the moment, I have to tell the linker to start execution 14 bytes beyond 
the start of main to bypass the initialisation call to _main and go straight 
into setting the init registers. This is a crap method, but if I allow _main
to be called the program hangs on booting.

Now the documentation mentions crt0.o (object file) and crt0.s (assembler).
I have to write my own assembler startup and assemble it to crt0.o. However,
I do not know how to lay the code out, what functions names to use...

Does anybody have an example of a crt0.s file that I could look at. Also,
am I leaving anything out. I do know that I have to copy the initialised data 
section from EPROM to RAM and I think! this goes in crt0.s.

Any help would be greatly appreciated. Thanks

Mike.

mike@mjmorgan.demon.co.uk
--
Mike Morgan
mike@mjmorgan.demon.co.uk
Technical Details
Message-ID: <823642508.3563@mjmorgan.demon.co.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,161cdb2b2b7a0579,start
X-Google-Attributes: gid11318c,public
From: mike@mjmorgan.demon.co.uk (Mike Morgan)
Subject: Config gcc for embedded M68K - help please
Date: 1996/02/06
Message-ID: <823642508.3563@mjmorgan.demon.co.uk>
X-Deja-AN: 138227168
x-nntp-posting-host: mjmorgan.demon.co.uk
newsgroups: gnu.gcc.help