@pixeldoc How is it going with gdb?
Meanwhile I hacked a new way to create an elf file with symbols from the sub files!
Here we go:
stubs_2_elf.S.text
.org 0
.align 2
.globl _start
// stubs_2_elf.S
// (c) 2008 chr
// GPL v3+
// create elf file from a binary blob
// and mix with symbols from stubs files
// compile with:
// arm-linux-gnu-gcc -Wl,-N,-Ttext,0xff810000 -nostdlib stubs_2_elf.S -o rom.elf
// cheat around gdb ignoring absolute symbols
here = .
#define offs 0xff810000
#define NSTUB(name, addr) name = here + addr - offs
#define NHSTUB NSTUB
#define __STUBS_ASM__H__
#include "stubs_entry.S"
#include "stubs_entry_2.S"
// test test ...
NSTUB(Jump, 0xff81000c)
NSTUB(Whatever, 0xff810164)
// include rom dump
_start:
.text
blob_start:
.incbin "PRIMARY.BIN"
blob_end:
usage:
* put this file in the platform/camera/firmware directory, where are the sub_entry*.S files are
* edit stubs_asm.h, put this lines at the top:
#ifndef __STUBS_ASM__H__
#define __STUBS_ASM__H__
and this at the end
#endif
* change 0xff810000to the rom start address
* I presume, PRIMARY.BIN is the camera's rom dump or a link to it
* Compile and link with:
arm-linux-gnu-gcc -Wl,-N,-Ttext,0xff810000 -nostdlib stubs_2_elf.S -o rom.elf
Now an objdump -d looks like his:
Disassembly of section .text:
ff810000 <_start>:
ff810000: ea000001 b ff81000c <Jump>
ff810004: 6e6f6167 powvsez f6, f7, f7
ff810008: 796f7369 stmvcdb pc!, {r0, r3, r5, r6, r8, r9, ip, sp, lr}^
ff81000c <Jump>:
ff81000c: e59f1150 ldr r1, [pc, #336] ; ff810164 <Whatever>
ff810010: e3a00000 mov r0, #0 ; 0x0
ff810014: e5810000 str r0, [r1]
ff810018: e3a01078 mov r1, #120 ; 0x78
ff81001c: ee011f10 mcr 15, 0, r1, cr1, cr0, {0}
ff810020: e3a01000 mov r1, #0 ; 0x0
ff810024: ee071f9a mcr 15, 0, r1, cr7, cr10, {4}
However, my disassemble.pl script makes a better output, also we don't have string references.
But this is file is cool stuff for the gdb/qemu stuff!
Apropos mcr/mrc ... I also found out, why qemu becomes crasy on some of these: there's no TCM support, yet
A basic support for the LED's was quite easy, let's see what we can do for the missing arm coprocessor stuff.
--
edit: usage