[OpenBIOS] testing Mac OS X boot on latest trunk (revision 1085) + divide by zero patch

Andreas Tobler andreast at fgznet.ch
Sun Feb 3 18:50:48 CET 2013


On 01.02.13 21:38, Programmingkid wrote:
>> On 13.01.13 16:43, Mark Cave-Ayland wrote:
>>>
>>  On 12/01/13 16:05, Amadeusz Sławiński wrote:
>>
>>>
>>  
>>
>>>>
>>  I used the latest proposed divide by zero patch
>>
>>>>
>>>>
>>  So it seems like it is almost there.
>>
>>>>
>>>>
>>  Seems like it still can't load kernel when run with boot cd:,\\:tbxi
>>
>>>>
>>  Mac OS X 10.0
>>
>>>> http://asmblr.net/scrot/2013-01-12-155737_1366x768_scrot.png
>>>>
>>>>
>>  Mac OS X 10.2
>>
>>>> http://asmblr.net/scrot/2013-01-12-155642_1366x768_scrot.png
>>>>
>>>>
>>  Mac OS X 10.4
>>
>>>> http://asmblr.net/scrot/2013-01-12-155935_1366x768_scrot.png
>>>>
>>>>
>>>>
>>  However when I specify partition to use it loads:
>>
>>>>
>>  Mac OS X 10.0 (boot cd:9,\\:tbxi)
>>
>>>> http://asmblr.net/scrot/2013-01-12-163133_1366x768_scrot.png
>>>>
>>>>
>>  Mac OS X 10.2 (boot cd:9,\\:tbxi)
>>
>>>> http://asmblr.net/scrot/2013-01-12-163300_1366x768_scrot.png
>>>>
>>>>
>>  Mac OS X 10.4 (boot cd:3,\\:tbxi)
>>
>>>> http://asmblr.net/scrot/2013-01-12-163419_1366x768_scrot.png
>>>
>>  
>>
>>>
>>  This should now be fixed in SVN trunk.
>>
>>>
>>  
>>
>>>
>>  I believe I have now committed all outstanding patches based upon 
>>
>>>
>>  William's main GSOC patchset, and performed a QEMU CDROM boot test 
>>
>>>
>>  across all of SPARC32, SPARC64 and PPC to confirm that I haven't 
>>
>>>
>>  introduced any regressions across any of my test images. Thank you 
>>
>>>
>>  everyone for your help, patience and testing.
>>
>>>
>>  
>>
>>>
>>  Interestingly enough, commits 1081 and 1082 appear to have fixed the key 
>>
>>>
>>  issues with OpenBIOS's PPC MMU code and as a result, the following 
>>
>>>
>>  kernels will now at least boot from ISO images in QEMU:
>>
>>>
>>  
>>
>>>
>>  Darwin
>>
>>>
>>  FreeBSD
>>
>>>
>>  NetBSD
>>
>>>
>>  HelenOS
>>
>>>
>>  Fedora Linux
>>
>>>
>>  SuSE Linux
>>
>>>
>>  
>>
>>>
>>  I think the remainder of the bugs during kernel initialisation are 
>>
>>>
>>  related to either missing/erroneous properties in the OpenBIOS device 
>>
>>>
>>  tree, or bugs in QEMU's device emulation/Mac hardware model. This will 
>>
>>>
>>  likely require some assistance from the QEMU people to fix.
>>
>>
>> I can confirm the statement from Mark regarding FreeBSD. So far I can
>> boot but I fail due to the fact that some interrupt-parents are not
>> populated. Namely for via-cuda and for ata-1/2/3. Adding these lets the
>> boot continue until I hang somewhere in a cpu_idle routine. Still
>> investigating.
>>
>> One thing the qemu people might clarify, is -M mac99 ok to use? Or what
>> would be the preferred Mac model and which cpu?
>> My trials go with mac99 and -cpu G4 on the 32-bit qemu.
>>
>> I think once I solved the spinning in the cpu_idle routine I'm near
>> completing the boot.
>>
>> Thank you all for this effort!
>>
>> Andreas
>>
> 
> Would you have a patch for this interrupt-parent property? 

Well, attached the hacky part I have. Hacky especially because of this
'7' vs. '4'. It is not really clear what I did. At least I could boot
until I get into an endless loop with cpu_spin... with FreeBSD ppc.

Andreas



-------------- next part --------------
Index: drivers/macio.c
===================================================================
--- drivers/macio.c	(revision 1096)
+++ drivers/macio.c	(working copy)
@@ -189,11 +189,23 @@
             target_node = find_dev("/pci/mac-io/escc/ch-b");
             set_int_property(target_node, "interrupt-parent", dnode);
 
+	    target_node = find_dev("/pci/mac-io/ata-1");
+            set_int_property(target_node, "interrupt-parent", dnode);
+
+	    target_node = find_dev("/pci/mac-io/ata-2");
+            set_int_property(target_node, "interrupt-parent", dnode);
+
+	    target_node = find_dev("/pci/mac-io/ata-3");
+            set_int_property(target_node, "interrupt-parent", dnode);
+
+	    target_node = find_dev("/pci/mac-io/via-cuda");
+            set_int_property(target_node, "interrupt-parent", dnode);
+
             target_node = find_dev("/pci");
             set_int_property(target_node, "interrupt-parent", dnode);
 
             interrupt_map = (u32 *)get_property(target_node, "interrupt-map", &len);
-            for (i = 0; i < 4; i++) {
+            for (i = 0; i < 7; i++) {
                 interrupt_map[(i * 7) + PCI_INT_MAP_PIC_HANDLE] = (u32)dnode;
             }
             set_property(target_node, "interrupt-map", (char *)interrupt_map, len);
Index: drivers/pci.c
===================================================================
--- drivers/pci.c	(revision 1096)
+++ drivers/pci.c	(working copy)
@@ -375,7 +375,7 @@
  */
 #if defined(CONFIG_PPC)
 	phandle_t dev = get_cur_dev();
-	u32 props[7 * 4];
+	u32 props[7 * 7];
 	int i;
 
 #if defined(CONFIG_PPC)
@@ -384,7 +384,7 @@
 		return;
 #endif
 
-	for (i = 0; i < (7*4); i+=7) {
+	for (i = 0; i < (7*7); i+=7) {
 		props[i+PCI_INT_MAP_PCI0] = 0;
 		props[i+PCI_INT_MAP_PCI1] = 0;
 		props[i+PCI_INT_MAP_PCI2] = 0;
@@ -393,7 +393,7 @@
 		props[i+PCI_INT_MAP_PIC_INT] = arch->irqs[i / 7];
 		props[i+PCI_INT_MAP_PIC_POL] = 3;
 	}
-	set_property(dev, "interrupt-map", (char *)props, 7 * 4 * sizeof(props[0]));
+	set_property(dev, "interrupt-map", (char *)props, 7 * 7 * sizeof(props[0]));
 
 	props[PCI_INT_MAP_PCI0] = 0;
 	props[PCI_INT_MAP_PCI1] = 0;


More information about the OpenBIOS mailing list