The loading error happened because Forth stack was in the middle of the kernel file being loaded. I moved it away.
Now, with an ELF kernel file as -hda:
2 > boot disk [sparc] Booting file 'disk' with parameters '<NULL>' Unknown filesystem type Loading image... segment 0 addr:0x0 file:0x2780e0 mem:0x2a3828 loading... clearing... clearing checksum... ok Loaded 2588896 bytes entry point is 0x4000 Jumping to entry point... halt, power off
Looking at /tmp/qemu.log we find that Linux mapped itself to 0xf0000000, called a few Openprom functions and because of the bad results decided to halt.
Now we need to implement the Openprom functions for browsing the device tree and others in romvec.c. For example, the sequence Linux uses to find root node properties is something like:
node = nextnode(0); // get handle for "/" ok = getprop(node, NULL, &str); // str should be the first property, for example "compatible"
How can I get this kind of handles from C?
It would be nice to get booting by loading boot sectors working so that instead of Linux we can try SILO.
_________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
OF support for Linux on PPC works by making a copy of the device tree when it first boots. From then on there are no direct calls made to OF, only to read values from the copy of the device tree. This will only work if the OS does not need to make any direct calls to the BIOS (which Linux doesn't). If Solaris needs to make calls then you are going to have to implement a mechanism to trap into the BIOS. See arch/ppc/kernel/prom.c.
Greg
On May 8, 2006, at 2:03 PM, Blue Swirl wrote:
The loading error happened because Forth stack was in the middle of the kernel file being loaded. I moved it away.
Now, with an ELF kernel file as -hda:
2 > boot disk [sparc] Booting file 'disk' with parameters '<NULL>' Unknown filesystem type Loading image... segment 0 addr:0x0 file:0x2780e0 mem:0x2a3828 loading... clearing... clearing checksum... ok Loaded 2588896 bytes entry point is 0x4000 Jumping to entry point... halt, power off
Looking at /tmp/qemu.log we find that Linux mapped itself to 0xf0000000, called a few Openprom functions and because of the bad results decided to halt.
Now we need to implement the Openprom functions for browsing the device tree and others in romvec.c. For example, the sequence Linux uses to find root node properties is something like:
node = nextnode(0); // get handle for "/" ok = getprop(node, NULL, &str); // str should be the first property, for example "compatible"
How can I get this kind of handles from C?
It would be nice to get booting by loading boot sectors working so that instead of Linux we can try SILO.
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
<openbios.patch-9.bz2>
OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you
OF support for Linux on PPC works by making a copy of the device tree when it first boots. From then on there are no direct calls made to OF, only to read values from the copy of the device tree. This will only work if the OS does not need to make any direct calls to the BIOS (which Linux doesn't). If Solaris needs to make calls then you are going to have to implement a mechanism to trap into the BIOS. See arch/ppc/kernel/prom.c.
Interesting idea, could be useful to fix the device order, for example.
_________________________________________________________________ FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
* Blue Swirl blueswir1@hotmail.com [060508 22:03]:
Jumping to entry point... halt, power off
Looking at /tmp/qemu.log we find that Linux mapped itself to 0xf0000000, called a few Openprom functions and because of the bad results decided to halt.
Now we need to implement the Openprom functions for browsing the device tree and others in romvec.c. For example, the sequence Linux uses to find root node properties is something like:
you probably need to pass a pointer to of_client_interface in some register to make things work.. you might need to save the context before doing so, check of_client_callback in arch/ppc/start.S
Stefan
- Blue Swirl blueswir1@hotmail.com [060508 22:03]:> Jumping to
entry point...> halt, power off> > Looking at /tmp/qemu.log we find that Linux mapped itself to 0xf0000000, > called a few Openprom functions and because of the bad results decided to > halt.> > Now we need to implement the Openprom functions for browsing the device
tree and others in romvec.c. For example, the sequence Linux uses
to find > root node properties is something like: you probably need to pass a pointer to of_client_interface in someregister to make things work.. you might need to save the context beforedoing so, check of_client_callback in arch/ppc/start.S
See http://playground.sun.com/1275/bindings/sparc/d14a/12751d1a.ps . Also note the the Sparc binding requires that all memory cells only have to be aligned on two-byte boundaries (i.e., not necessarily natural aligned)!
Segher
you probably need to pass a pointer to of_client_interface in some register to make things work.. you might need to save the context before doing so, check of_client_callback in arch/ppc/start.S
The client interface is not used in Sparc32, only the last 32-bit machines with PCI/NC machines had the interface. Qemu implements much older, but much more common Sun4m type and there the older romvec calling system was used instead.
On Sparc64 situation will be different, client interface is the default.
Anyway, I found out how to do the calls, for example this works: static int obp_nextnode(int node) { int peer;
PUSH(node); fword("peer"); peer = POP(); DPRINTF("obp_nextnode(%x) = %x\n", node, peer);
return peer; }
_________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/