This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: m68k custom startup - help, I am stuck
- To: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Subject: Re: m68k custom startup - help, I am stuck
- From: joel at OARcorp dot com
- Date: Sun, 16 Aug 1998 09:36:39 -0500 (CDT)
- cc: Tomaz Stih <tomaz dot stih at triglif dot com>, egcs at cygnus dot com
On Sat, 15 Aug 1998, Joern Rennecke wrote:
> > Last six days I've spend over very trivial matter and I am really
> > starting to lose my ability to think reasonably. I am writing startup
> > code for my gcc compiled program for m68000 on custom made
> > board so that I could compile motorola gdb stub.
>
> If i read this correctly, you are putting your stack into bss,
> your return address on the stack, and then you clear the bss,
> including the return address. So you return to address 0.
I think you read it right. The following code certainly seems to put the
stack area in the bss.
/* put supervisor stack in BSS section in RAM */
.bss
.comm vResetSStack, SSTACKSIZE
I am on cold medicine but did not notice where the sp was actually set. I
can say that the equivalent of this code in rtems and libgloss is inline
and usually just disables interrupts, zeroes the bss, sets the sp, and
then performs a subroutine to main. Doing this as subroutines with the
stack in BSS and then zeroing the bss is bad form. You should inline the
zeroing of the bss, then set the stack pointer, then do the other
operations.