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
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to