Search the web
Sign In
New User? Sign Up
gbadev
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
ctr0, crtbegin, GCC   Message List  
Reply | Forward Message #8112 of 15019 |
Re: [gbadev] ctr0, crtbegin, GCC

Rebecca Lovelace wrote:
> Next question, where can I get the correct copy of crtbegin.o? It's not in
> my distribution, I tried DL-ing the c and c++ versions just in case and it
> was in neither.

You can probably get it in DevKitAdvance.

> What does crtbegin.o do? What was it compiled from?

I believe it is used for C++ constructor setup, etc.

> Finally, what is the story with crt0.s? It seems to set things up and
> branch to your C code, so is it required in all GCC projects?

I've added another FAQ below.

http://www.devrs.com/gba/files/gbadevfaqs.php#StartUp

Q: What are crt0.S/lnkscript (GCC) and start.s (SDT/ADS) used for in a project?
A: crt0.S and start.s (sometimes start.asm) both have similar functions.
-They are mainly designed to execute assembly code that occurs before
-user compiled code is executed; usually for initialization purposes.
-(Sometimes these files will contain other assembly code as well like
-interrupt support, etc.) The most common usage is to set uninitialized
-global variable RAM to 0 and to copy initialized global variables from
-ROM to RAM. A bare minimum crt0.S or start.s file must at least contain
-a branch to the start of compiled code, even if it contains nothing else.
-(The S of crt0.s is often capitalized because the GCC docs
-mention that it must be this way if you ever wish to run the GCC
-preprocessor on this file.)
-
-lnkscript is a linker script used by GCC that tells the linker where to
-put various sections (.text/.data/.rodata/.iwram/etc..) in the GBA
-memory map. Often a particular crt0.s and lnkscript may be designed
-to work together so they are often distributed together. Some GCC
-compilers (i.e. DevKitAdvance) may include a default lnkscript
-compiled into the compiler itself which will be used if the user
-doesn't specify a lnkscript file.

Jeff



Fri Nov 2, 2001 1:32 pm

jfrohwei
Offline Offline
Send Email Send Email

Forward
Message #8112 of 15019 |
Expand Messages Author Sort by Date

I know this is kind of a newbie set of questions, but I've been digging around the FAQs, docs, archives, and I can't find the answers. I downloaded the GCC...
Rebecca Lovelace
rebecca.lovelace@...
Send Email
Oct 31, 2001
5:41 pm

... You can probably get it in DevKitAdvance. ... I believe it is used for C++ constructor setup, etc. ... I've added another FAQ below. ...
Jeff Frohwein
jfrohwei
Offline Send Email
Nov 2, 2001
1:34 pm

can someone help me, i am trying to do a vblank interrupt in c++ using jeff frohwein's crt0.s and linkerscript. i read dovoto's tutorial #5 and tried to get...
kingnikus@...
kingnikus
Offline Send Email
Nov 15, 2001
10:04 pm

Make sure you're compiling your interrupt function with -marm, not - mthumb. And after handling an interrupt, set the flag for that interrupt in the IF...
DekuTree64@...
dekutree65
Offline Send Email
Nov 15, 2001
10:33 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help