reg and assigned-addresses
properties of a device node.
bootme, try
boot hd:17,bootme
For an image served by a tftp server, try
boot enet:0
Hold down the option key during machine boot to get a list
of bootable partitions.
/memory@0 device node.
dev /memory@0 .propertiesYou'll see a range of available memory regions, and if you consider the negative (the claimed memory regions), one of them will overlap with the memory claimed by the elf binary. And this prevents you from reloading the elf binary. So release the conflicting memory region. For example, if the region starts at 0x30054 with a length of 0xa000 bytes, execute
30054 a000 release-memI automate this call, and release immediately before calling the client exit function. But to successfully execute, I found that I had to call the client interpreter entry point, and pass the Forth code which releases the memory. For example:
struct {
const char *service;
int nargs;
int nret;
const char *forth;
int result;
} args;
args.service = "interpret";
args.nargs = 1;
args.nret = 1;
args.forth = "30054 a000 release-mem";
args.result = -1;
(*prom_entry)( &args );
I do not know the consequences of executing a release-mem
on the memory of an actively executing process. I suspect that it
would be appropriate to first set the memory management callbacks so
that open firmware transfers memory management to the client.
option-command-o-f at power-on.
n at power-on.
c at power-on.
option-command-p-r at power-on.
command-power). Continue
to press the keys until you hear a tone. What you do next
requires experimentation. On the next reboot I held down
option-command-o-f and managed to recover
my open firmware, at which point I reset the nvram to its
default values (I had put a bad value into it, which gave
me a dead PowerBook, and Apple's tech support was of no help).
Thanks go to Ethan Benson.
To easily define an elf note section, try adding the following lines to an assembler file:
.section ".note" .align 2 .note_section_header: .long 8 /* note name length (including null byte) */ .long 24 /* note descriptor length */ .long 0x1275 /* note type */ .string "PowerPC" /* note name */ .note_descriptor: .long 0x0 /* real-mode */ .long 0xffffffff /* real-base */ .long 0xffffffff /* real-size */ .long 0xffffffff /* virt-base */ .long 0xffffffff /* virt-size */ .long 0x00030000 /* load-base */Be warned that the linker's default settings or the linker script may cause the linker to discard the note section.
Some implementations may also require an elf note program header, which contains the note section. Use a linker script to define the elf note program header. A partial example:
PHDRS {
kernel_phdr PT_LOAD;
note_phdr PT_NOTE;
}
SECTIONS {
.text . : { *(.text .rodata) } : kernel_phdr
.data . : { *(.data .sdata .sdata2) } : kernel_phdr
.bss . : { *(.bss) } : kernel_phdr
.note : { *(.note) } : note_phdr
}
And I haven't tested any of this to verify that it works with hardware,
since I have a PowerBook that ignores it. But perhaps it ignores
the note info because I implemented it incorrectly.
I have tested with the psim simulator, which reads and tries to enforce
the .note section I added to one of my assembler files.
I linked with the linker's default link script, for the target
powerpc-unknown-eabi. So I'm positive that it works.
. = ALIGN(4K) + (. & (4K - 1));instead of
. = ALIGN(4K)
An example linker script which generates a binary compatible with Open Firmware, and which has multiple elf program headers.
sifting
To search for a command, execute sifting command