avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Modifying compiler output to suit Tiny13 bootloader


From: David Carr
Subject: Re: [avr-gcc-list] Modifying compiler output to suit Tiny13 bootloader
Date: Sun, 25 Oct 2009 17:46:47 -0400
User-agent: Thunderbird 2.0.0.23 (X11/20090817)

Turns out that the linker scripts are in /usr/lib/ldscripts on my system. One question down, two to go.

-DC

David Carr wrote:
Hi all,

I've been writing a bootloader for the Tiny13 for the past few days. At this point, the bootloader can download, program, and execute simple programs written in assembly. Now I'd like to add support for programs compiled with avr-gcc.

I wrote a very simple C program and looked at the assembly output produced by avr-gcc. The first line is:

00000000 <__vectors>:
  0:   10 c0           rjmp    .+32            ; 0x22 <__ctors_end>

My bootloader lives in the last 192 bytes of flash, so I'd like to replace this instruction (at address 0) with an rjmp to that location. Where/how does this line get generated? I assume its deep in the architecture specific start up code somewhere.

Secondly, what assumptions does the compiler make about the state of the machine/registers on boot? It seems there is some initialization going on in the __ctors_end section, such as zeroing r1.

Lastly, where do the linker scripts live now?
The avr-libc webpage mentions /usr/avr/lib, but I only have a bunch files ending in .o there. No files ending in .x. Am I doing something silly?

I really appreciate any help you can give me. Understanding the internals of gcc is a formidable challenge for me.
-David Carr


_______________________________________________
AVR-GCC-list mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list





reply via email to

[Prev in Thread] Current Thread [Next in Thread]