>From 79265ffab56281416edc48b3daf825a1e00ee5fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Rebe?= Date: Tue, 24 Dec 2013 02:39:54 +0100 Subject: [PATCH] fix PPC OpenHackWare for Linux 2.6 --- pc-bios/ohw.diff | 67 ++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 55 insertions(+), 12 deletions(-) diff --git a/pc-bios/ohw.diff b/pc-bios/ohw.diff index c6b6623..4f1680b 100644 --- a/pc-bios/ohw.diff +++ b/pc-bios/ohw.diff @@ -1,3 +1,19 @@ +Make it link at al. + + - Rene Rebe + +--- OpenHackWare-release-0.4/src/main.ld 2005-03-31 09:23:33.000000000 +0200 ++++ OpenHackWare-release-0.4-hacked/src/main.ld 2008-05-06 11:23:29.000000000 +0200 +@@ -49,7 +49,7 @@ + _sdata_end = . ; + . = ALIGN(4) ; + _ro_start = . ; +- .rodata : { *(.rodata) } > bios ++ .rodata : { *(.rodata*) } > bios + _ro_end = . ; + . = ALIGN(4) ; + _RTAS_start = .; + diff -wruN --exclude '*~' --exclude '*.o' --exclude '*.bin' --exclude '*.out' --exclude mkdiff OpenHackWare-release-0.4.org/src/bios.h OpenHackWare-release-0.4/src/bios.h --- OpenHackWare-release-0.4.org/src/bios.h 2005-04-06 23:20:22.000000000 +0200 +++ OpenHackWare-release-0.4/src/bios.h 2005-07-07 01:10:20.000000000 +0200 @@ -748,24 +764,14 @@ diff -wruN --exclude '*~' --exclude '*.o' --exclude '*.bin' --exclude '*.out' -- { /* Hack taken 'as-is' from PearPC */ unsigned char info[] = { -@@ -1596,7 +1627,9 @@ - OF_node_put(OF_env, brom); +@@ -1596,6 +1627,7 @@ OF_node_put(OF_env, rom); } -+#if 0 /* From here, hardcoded hacks to get a Mac-like machine */ -+ /* XXX: Core99 does not seem to like this NVRAM tree */ ++ /* XXX: Not yet perfect, but Linux 2.6 does oops on boot on Core99 without NVRAM node */ /* "/address@hidden" node */ { OF_regprop_t regs; -@@ -1617,6 +1650,7 @@ - OF_prop_int_new(OF_env, chs, "nvram", OF_pack_handle(OF_env, nvr)); - OF_node_put(OF_env, nvr); - } -+#endif - /* "/pseudo-hid" : hid emulation as Apple does */ - { - OF_node_t *hid; @@ -1663,7 +1697,27 @@ } OF_node_put(OF_env, hid); @@ -1841,3 +1847,40 @@ diff -wruN --exclude '*~' --exclude '*.o' --exclude '*.bin' --exclude '*.out' -- case ARCH_MAC99: /* We are supposed to have 3 host bridges: * - the uninorth AGP bridge at 0xF0000000 + + +The 2.6 Linux kernel checks for 1, as I do not have the IEEE spec on +my desk I can only guess it should return 1 on success, not the +string length. + + - Rene Rebe + +--- OpenHackWare-release-0.4/src/of.c 2005-04-06 23:17:26.000000000 +0200 ++++ OpenHackWare-release-0.4-hacked/src/of.c 2008-05-06 14:50:48.000000000 +0200 +@@ -3841,7 +4061,7 @@ + OF_DPRINTF("Return property name [%s]\n", next->name); + OF_sts(next_name, (void *)(next->name)); + OF_DUMP_STRING(OF_env, next_name); +- pushd(OF_env, strlen(next->name) + 1); ++ pushd(OF_env, 1); /* ReneR: Linux 2.6 flatten_device_tree */ + } + } + } + + +In qemu r3309 j_mayer did some "Quickly hack PowerPC BIOS able to boot +on CDROM again.", as I did not feel like disassemble to find out this +worked for me for now. + + - Rene Rebe + +--- OpenHackWare-release-0.4/src/bloc.c 2005-04-06 23:21:00.000000000 +0200 ++++ OpenHackWare-release-0.4-hacked/src/bloc.c 2008-05-06 14:20:10.000000000 +0200 +@@ -1021,7 +1038,7 @@ + status = ide_port_read(bd, 0x07); + if (status != 0x08) { + ERROR("ATAPI TEST_UNIT_READY : status %0x != 0x08\n", status); +- return -1; ++ /*return -1;*/ /* fails to boot from cdrom? */ + } + for (i = 0; i < 3; i++) { -- 1.8.4