linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Edelsohn <dje@watson.ibm.com>
To: Tom Rini <tmrini@ntplx.net>
Cc: Brad Midgley <brad@turbolinux.com>, linuxppc-dev@lists.linuxppc.org
Subject: Re: new OF: how can we use it?
Date: Thu, 27 May 1999 20:28:38 -0400	[thread overview]
Message-ID: <9905280028.AA27888@marc.watson.ibm.com> (raw)
In-Reply-To: Message from Tom Rini <tmrini@ntplx.net> of "Thu, 27 May 1999 15:39:49 EDT." <Pine.LNX.4.05.9905271537330.30048-100000@pc.wackyland.com>


	I presume that vger's mknote does all of the following, but the
special details that CHRP requires are:

A standard ELF-format PowerPC program
	e_ident = \7FELF (first byte is hex 7F)
	e_ident[EI_CLASS] = 1
	e_type = 2
	e_machine = 20 (PowerPC)
	e_version = 1
	e_flags = 0

A "note" section which looks like:

	.section .note
	.align 4
	/* length of PowerPC string */
	.long 8
	/* length of note descriptor */
	.long 24
	/* code for PowerPC open firmware */
	.long 0x1275
	/* PowerPC string */
	.asciz "PowerPC"
	/* real-mode true=-1 false=0 */
	.long -1
	/* real base of OF (do not care / use defaults = -1) */
	.long -1
	/* real size of OF (do not care / use defaults = -1) */
	.long -1
	/* virtual base of OF (ignored in real-mode) */
	.long -1
	/* virtual size of OF (ignored in real-mode) */
	.long -1
	/* load base of program (example real mode 0x4000) */
	.long 0x4000

One needs to ensure that the loaded program base does not specify a
location which overwrites Open Firmware itself.

	The ELF header must contain a PT_NOTE segment table entry pointing
to the note section as well as PT_LOAD segment table entries pointing to
the actual program image.  The GNU linker for PowerPC probably does not
create a PT_NOTE segment in the loader header although it does include the
.note section in the image.

	If all is correct, OF transfers control to the image entry point
with the five OF parameters including the OF client services entry point
in r5 (third parameter).

David

[[ This message was sent via the linuxppc-dev mailing list.  Replies are ]]
[[ not  forced  back  to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting.   ]]

      parent reply	other threads:[~1999-05-28  0:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-27 15:38 new OF: how can we use it? Brad Midgley
1999-05-27 19:39 ` Tom Rini
1999-05-27 23:28   ` Joel Klecker
1999-05-27 23:33     ` Tom Rini
1999-05-28  4:13       ` Troy Benjegerdes
1999-05-28  0:28   ` David Edelsohn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9905280028.AA27888@marc.watson.ibm.com \
    --to=dje@watson.ibm.com \
    --cc=brad@turbolinux.com \
    --cc=linuxppc-dev@lists.linuxppc.org \
    --cc=tmrini@ntplx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).