grub-devel
[Top][All Lists]
Advanced

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

PPC64


From: Manoel
Subject: PPC64
Date: Mon, 20 Oct 2008 17:18:21 -0200


I'm working in a project to use grub2 to boot some ppc machines(p6 , p5
and so on) and we had some difficulties with a grub modules problem.
Grub fails to load modules.

When debugging I noted that grub try to find the headerinfo modules
struc (which is identified by the magic number 0x676d696d) in the
address 0x2d000 (_end + gap aligned in 4k blocks).
but this address does not contains the headerinfo.

So i altered the source code such as the memory is searched to find the
magic number. It is then found at address 0x38f4c and then grub find
some modules (but fails after) has showed in attachment grub2.txt.

that address calculation led me to believe that I can tell where the
struct will be on memory based in its place in the binary.

I also noted that basemod ( indicates where the modules sections begin)
used by grub_mkelfimage is the same calculated by grub (_end + GAP). but
it seems to not store it on the necessary address.

using hexedit I could see that in the address 0xCC98 (in the file
generated by grub_mkelfimage) is stored the struct header info.

so in resume.

address where grub tries to find the header 0x2d000.
address where it is actually stored  0x38f4c.
address where it is in the generated file 0xCC98.

So my doubts are:
How this address calculation works?
How can I know where the struct will be in memory based in its address
in the binary?
It really works or only in some old OpenFirmare version?


I followed the wiki tutorial in the process.  

That is the exit of the command: "readelf -l" (binary + modules):

Elf file type is EXEC (Executable file)
Entry point 0x10000
There are 4 program headers, starting at offset 52

Program Headers:
 Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
 LOAD           0x0000b4 0x00010000 0x00010000 0x0cbe4 0x14098 RWE 0x10
 GNU_STACK      0x00cc98 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4
 LOAD           0x00cc98 0x0002d000 0x0002d000 0x5c1c8 0x5c1c8 RWE 0x4
 NOTE           0x068e60 0x00000000 0x00000000 0x0002c 0x00000 R   0x4


the exit of "readelf -a" is showed in attachment readelf.txt
 
´╗┐If you could help me, I will appreciate it. Thanks in advance!
Best regards.
Abranches, Manoel R.

Attachment: grub2.txt
Description: Text document

Attachment: readelf.txt
Description: Text document


reply via email to

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