[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] Modifying compiler output to suit Tiny13 bootloader
From: |
David Carr |
Subject: |
[avr-gcc-list] Modifying compiler output to suit Tiny13 bootloader |
Date: |
Sun, 25 Oct 2009 17:29:04 -0400 |
User-agent: |
Thunderbird 2.0.0.23 (X11/20090817) |
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] Modifying compiler output to suit Tiny13 bootloader,
David Carr <=