* Antwort: Re: VxWorks bootloader & PowerQUICC II, Booting the kernel
@ 2000-09-29 15:15 Ruedi.Hofer
2000-09-30 15:48 ` Dan Malek
0 siblings, 1 reply; 2+ messages in thread
From: Ruedi.Hofer @ 2000-09-29 15:15 UTC (permalink / raw)
To: dan; +Cc: linuxppc-embedded, kernel
[-- Attachment #1: Type: TEXT/PLAIN, Size: 2181 bytes --]
Hi Dan
Thank you for the correct link.
Unfortunately, all vxhack produces is a crash...
# ./vxhack zImage
Segmentation fault
#
My zImage looks like this:
# ppc_82xx-objdump -h zvmlinux
zvmlinux: file format elf32-powerpc
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 000041ac 00400000 00400000 00010000 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .rodata 00000470 004041b0 004041b0 000141b0 2**4
CONTENTS, ALLOC, LOAD, READONLY, DATA
2 .data 0000030c 00405000 00405000 00015000 2**2
CONTENTS, ALLOC, LOAD, DATA
3 .data.init 00000000 00406000 00406000 00016000 2**0
CONTENTS
4 .bss 00005274 00406000 00406000 00016000 2**2
ALLOC
5 image 0007110b 00000000 00000000 00016000 2**0
CONTENTS, READONLY
#
I built the tool in the follwoing way:
# gcc vxhack.c -g -o vxhack
#
The gdb tells me:
75 shp = (Elf32_Shdr *) dbuf;
76 sp = (char *)shp;
77 for (i=0; i<nsscns; i++) {
> 78 if (shp->sh_addr)
79 shp->sh_addr += 0x500000;
80 if (i == 5)
81 imagesize = shp->sh_size;
Program received signal SIGSEGV, Segmentation fault.
0x8048753 in main (argc=2, argv=0xbffff664) at vxhack.c:78
(gdb) print shp
$1 = (Elf32_Shdr *) 0x806b3a0
(gdb) graph display shp
(gdb) graph display *shp dependent on 1
(gdb)
Cannot access memory at address 0x806b3a0.
Disabling display 2 to avoid infinite recursion.
(gdb)
I tried to play around with vxhack.c but I didn't succeed...
Any ideas??
\Ruedi
dan@mvista•com on 28.09.2000 17:02:04
An: Ruedi.Hofer@ascom•ch @ MailGate
Kopie: linuxppc-embedded@lists•linuxppc.org @ MailGate, kernel@linux01•hasler.ascom.ch @ MailGate
Thema: Re: VxWorks bootloader & PowerQUICC II, Booting the kernel
Ruedi.Hofer@ascom•ch wrote:
> Unfortunately, this link doesn't work anymore! Do you mind sending
> a copy of this file directly to me?
Sorry, try ftp.mvista.com/pub/Area51/ppc-8xx/vxhack.c
-- Dan
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Antwort: Re: VxWorks bootloader & PowerQUICC II, Booting the kernel
2000-09-29 15:15 Antwort: Re: VxWorks bootloader & PowerQUICC II, Booting the kernel Ruedi.Hofer
@ 2000-09-30 15:48 ` Dan Malek
0 siblings, 0 replies; 2+ messages in thread
From: Dan Malek @ 2000-09-30 15:48 UTC (permalink / raw)
To: Ruedi.Hofer; +Cc: linuxppc-embedded, kernel
Ruedi.Hofer@ascom•ch wrote:
> The gdb tells me:
>
> 75 shp = (Elf32_Shdr *) dbuf;
> 76 sp = (char *)shp;
> 77 for (i=0; i<nsscns; i++) {
> > 78 if (shp->sh_addr)
> 79 shp->sh_addr += 0x500000;
> 80 if (i == 5)
> 81 imagesize = shp->sh_size;
>
> Program received signal SIGSEGV, Segmentation fault.
I don't know why this happened, but I discovered that line 80 should
be:
if (i== 6)
> I tried to play around with vxhack.c but I didn't succeed...
It's a pretty trivial program. All it does is update the vma/lma
in the headers and add the image size to the data section of the
file. A nice addition would be to locate the "image" by name instead
of just knowing the header number. When I originally wrote it, I
needed it _now_, and didn't care about what it looked like :-). Just
use it as an example of what needs to be done, not as the way to do it.
-- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-09-30 15:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-09-29 15:15 Antwort: Re: VxWorks bootloader & PowerQUICC II, Booting the kernel Ruedi.Hofer
2000-09-30 15:48 ` Dan Malek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox