Just a few things I noticed while hacking away at Haiku on PowerPC:
The following OpenFirmware commands aren't implemented:
erase-screen toggle-cursor
The following paths are missing essential information:
cpu node -> clock-frequency cpu node -> timebase-frequency cpu node -> bus-frequency
Example:
cd / cd cpus cd PowerPC,750@0 .properties
These properties are present on real PowerPC hardware, but are set to 0 (or missing in the case of bus-frequency) on the qemu OpenBIOS.
Thoughts?
Thanks! -- Alex
On Mon, 18 Jul 2011 23:39:00 -0500, Alexander von Gluck wrote:
Just a few things I noticed while hacking away at Haiku on PowerPC:
The following OpenFirmware commands aren't implemented:
erase-screen toggle-cursor
It does seem like these are implemented after looking at the sources. However we receive the following error when they are used:
undefined defer word toggle-cursor undefined defer word erase-screen
Here is the example usage: http://dev.haiku-os.org/browser/haiku/trunk/src/system/boot/platform/openfir... http://dev.haiku-os.org/browser/haiku/trunk/src/system/boot/platform/openfir...
(this all works 100% on real hardware)
The following paths are missing essential information:
cpu node -> clock-frequency cpu node -> timebase-frequency cpu node -> bus-frequency
Example:
cd / cd cpus cd PowerPC,750@0 .properties
I was a little off in this, the only one *really* missing is the bus-frequency. We can work around the 0 values.
I threw together a patch at the url below to make OpenBIOS a little more OpenFirmware like under qemu:
I'm not sure on how to use the fw_cfg_* portions so I just set it to 0 for the moment.
Thanks! -- Alex
Hi Alex,
Am 19.07.2011 um 16:12 schrieb Alexander von Gluck:
On Mon, 18 Jul 2011 23:39:00 -0500, Alexander von Gluck wrote:
Just a few things I noticed while hacking away at Haiku on PowerPC:
The following OpenFirmware commands aren't implemented:
erase-screen toggle-cursor
It does seem like these are implemented after looking at the sources. However we receive the following error when they are used:
undefined defer word toggle-cursor undefined defer word erase-screen
I didn't get those when I last tried, it just hung. Where do you see these errors? Please share details on what versions and command line you use. Thanks!
Here is the example usage: http://dev.haiku-os.org/browser/haiku/trunk/src/system/boot/platform/openfir... http://dev.haiku-os.org/browser/haiku/trunk/src/system/boot/platform/openfir...
(this all works 100% on real hardware)
The following paths are missing essential information:
cpu node -> clock-frequency cpu node -> timebase-frequency cpu node -> bus-frequency
Example:
cd / cd cpus cd PowerPC,750@0 .properties
I was a little off in this, the only one *really* missing is the bus- frequency. We can work around the 0 values.
I threw together a patch at the url below to make OpenBIOS a little more OpenFirmware like under qemu:
I'm not sure on how to use the fw_cfg_* portions so I just set it to 0 for the moment.
Without having looked at the URL yet (please prefer posting here for offline-reading), the general idea is that QEMU supplies information and it is read in the BIOS via fw_cfg.
Andreas
On Tue, 19 Jul 2011 22:56:50 +0200, Andreas Färber wrote:
Am 19.07.2011 um 16:12 schrieb Alexander von Gluck:
On Mon, 18 Jul 2011 23:39:00 -0500, Alexander von Gluck wrote:
Just a few things I noticed while hacking away at Haiku on PowerPC:
The following OpenFirmware commands aren't implemented:
erase-screen toggle-cursor
It does seem like these are implemented after looking at the sources. However we receive the following error when they are used:
undefined defer word toggle-cursor undefined defer word erase-screen
I didn't get those when I last tried, it just hung. Where do you see these errors? Please share details on what versions and command line you use. Thanks!
If you skip doing the new page table...
Index: src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp =================================================================== --- src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp (revision 42449) +++ src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp (working copy) @@ -696,7 +696,8 @@ size_t suggestedTableSize = suggested_page_table_size(total); dprintf("suggested page table size = %" B_PRIuSIZE "\n", suggestedTableSize); - if (tableSize < suggestedTableSize) { + //if (tableSize < suggestedTableSize) { + if (0) { // nah, we need a new one! dprintf("need new page table, size = %" B_PRIuSIZE "!\n", suggestedTableSize);
and apply this to your OpenBIOS build...
Index: arch/ppc/qemu/init.c =================================================================== --- arch/ppc/qemu/init.c (revision 1045) +++ arch/ppc/qemu/init.c (working copy) @@ -260,6 +260,12 @@ push_str("clock-frequency"); fword("property");
+ //PUSH(fw_cfg_read_i32(FW_CFG_PPC_BUSFREQ)); + PUSH(0); + fword("encode-int"); + push_str("bus-frequency"); + fword("property"); + push_str("running"); fword("encode-string"); push_str("state");
You can get all the way to the graphical splash screen for Haiku :)
You will have to press return 3 times in the boot loader menu to load the kernel.
qemu-system-ppc -cdrom generated/haiku-boot-cd-ppc.iso -hda generated/haiku.image -boot d -cpu G3 -m 512 -nographic or qemu-system-ppc -cdrom generated/haiku-boot-cd-ppc.iso -hda generated/haiku.image -boot d -cpu G3 -m 512
Thanks! -- Alex
On 2011-Jul-19 10:12 , Alexander von Gluck wrote:
The following OpenFirmware commands aren't implemented:
erase-screen toggle-cursor
It does seem like these are implemented after looking at the sources. However we receive the following error when they are used:
undefined defer word toggle-cursor undefined defer word erase-screen
That usually means your Video driver didn't initialize them. The words are defined as "defer" words, so they don't point to anything useful until a display driver comes by and initializes them. This allows one piece of code to be generic and callable from the ok prompt, while to unsightly innards are buried in the specific video driver that this system has loaded.
It sounds like your display driver didn't initialize them.
Am 19.07.2011 um 23:06 schrieb Tarl Neustaedter:
On 2011-Jul-19 10:12 , Alexander von Gluck wrote:
The following OpenFirmware commands aren't implemented:
erase-screen toggle-cursor
It does seem like these are implemented after looking at the sources. However we receive the following error when they are used:
undefined defer word toggle-cursor undefined defer word erase-screen
That usually means your Video driver didn't initialize them. The words are defined as "defer" words, so they don't point to anything useful until a display driver comes by and initializes them. This allows one piece of code to be generic and callable from the ok prompt, while to unsightly innards are buried in the specific video driver that this system has loaded.
It sounds like your display driver didn't initialize them.
Just to verify, your == OpenBIOS' display driver? Or should the OS do something?
Andreas
On 2011-Jul-19 18:14 , Andreas Färber wrote:
It sounds like your display driver didn't initialize them.
Just to verify, your == OpenBIOS' display driver? Or should the OS do something?
Correct. Either FCode from a card or some kind of builtin driver that Openbios knows to attach to a PCI node.
On Tue, 19 Jul 2011 18:16:27 -0400, Tarl Neustaedter wrote:
On 2011-Jul-19 18:14 , Andreas Färber wrote:
It sounds like your display driver didn't initialize them.
Just to verify, your == OpenBIOS' display driver? Or should the OS do something?
Correct. Either FCode from a card or some kind of builtin driver that Openbios knows to attach to a PCI node.
This doesn't seem right, these commands work on OpenFirmware as-is. Their goal is to clear the text OpenBIOS console and toggle the cursor.
Example:
Type: toggle-cursor at the OpenFirmware prompt on any mac and the cursor will disappear / reappear. erase-screen and the OpenFirmware screen will erase.
Thanks! -- Alex
On 2011-Jul-19 18:50 , Alexander von Gluck wrote:
It sounds like your display driver didn't initialize them.
Just to verify, your == OpenBIOS' display driver? Or should the OS do something?
Correct. Either FCode from a card or some kind of builtin driver that Openbios knows to attach to a PCI node.
This doesn't seem right, these commands work on OpenFirmware as-is. Their goal is to clear the text OpenBIOS console and toggle the cursor.
Example:
Type: toggle-cursor at the OpenFirmware prompt on any mac and the cursor will disappear / reappear. erase-screen and the OpenFirmware screen will erase.
Correct. It sounds like the video driver in your environment isn't initializing, so these defer words aren't getting set up. The IEEE 1275 specification indicates these are required to be initialized as part of the terminal emulator package, which is the piece of code which knows how to translate from text to bits on a screen.
There is a bunch more about this under the fb8-* words in the specification, particularly see the fb8-install method.
On Tue, 19 Jul 2011 19:06:05 -0400, Tarl Neustaedter wrote:
On 2011-Jul-19 18:50 , Alexander von Gluck wrote:
It sounds like your display driver didn't initialize them.
Just to verify, your == OpenBIOS' display driver? Or should the OS do something?
Correct. Either FCode from a card or some kind of builtin driver that Openbios knows to attach to a PCI node.
This doesn't seem right, these commands work on OpenFirmware as-is. Their goal is to clear the text OpenBIOS console and toggle the cursor.
Example:
Type: toggle-cursor at the OpenFirmware prompt on any mac and the cursor will disappear / reappear. erase-screen and the OpenFirmware screen will erase.
Correct. It sounds like the video driver in your environment isn't initializing, so these defer words aren't getting set up. The IEEE 1275 specification indicates these are required to be initialized as part of the terminal emulator package, which is the piece of code which knows how to translate from text to bits on a screen.
There is a bunch more about this under the fb8-* words in the specification, particularly see the fb8-install method.
Thanks for the information. Do you know of a fb8-install method + arguments that would work on qemu and real hardware?
Here is the situation: Our boot menu works on the Apple OpenFirmware implementation as-is without fb8-install. (and erase-screen, etc work) Out boot menu needs fb8-install on OpenBIOS to function (which is the correct way from what I gather in the OpenFirmware specs)
Calling fb8-install alone on the Apple hardware (PowerMac 3,5 4.2.5f1) seems to cause the screen to lock up an no longer update. Calling fb8-install alone on OpenBIOS does overlay erase-screen, etc... however they don't do anything (see attached)
Thoughts?
Thanks! -- Alex
On 2011-Jul-20 10:58 , Alexander von Gluck wrote:
Thanks for the information. Do you know of a fb8-install method + arguments that would work on qemu and real hardware?
Unfortunately, I'm not familiar with QEMU itself - my interest in OpenBIOS is that I work on OpenBoot (another IEEE 1275 implementation) at Sun/Oracle.
Here is the situation: Our boot menu works on the Apple OpenFirmware implementation as-is without fb8-install. (and erase-screen, etc work)
That sounds right. fb8-install is supposed to be called by the video driver once things are set up, to define what parameters can be used. That something the display driver writes, not you.
Out boot menu needs fb8-install on OpenBIOS to function (which is the correct way from what I gather in the OpenFirmware specs)
More properly, it sounds like you need a system where the video driver has called fb8-install. The point is that your boot menu needs a bunch of display-specific methods and whatever video driver QEMU is using doesn't seem to have them.
Calling fb8-install alone on the Apple hardware (PowerMac 3,5 4.2.5f1) seems to cause the screen to lock up an no longer update.
Oh, yeah. Don't do that. Apple probably does something different. fb8-install is supposed to be the last step after the video driver has set everything up, and they probably install things in some other way. fb8-install is probably clobbering whatever they did.
Calling fb8-install alone on OpenBIOS does overlay erase-screen, etc... however they don't do anything (see attached)
Right. The problem wasn't you failing to call fb8-install, it's display driver support for all the video functions you are calling. I pointed you at fb8-install simply to get you in the right area - all the other fb8-* functions also have to be defined and have to be backed up by a display driver that implements them.