-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, On Jan 14, 2008, at 03:23, Peter Bex wrote:
On Sun, Jan 13, 2008 at 06:40:27PM -0500, Michael wrote:I added the following statement: printf("Getting prop at node: %i ofname = %s, size = %lu, returned size = %i\n", node, ofname, sizeof(prop), OF_getprop(node, ofname, &prop, sizeof(prop))); It prints: Getting prop at node: -267800264 ofname = height, size = 4, returned size = 4 Getting prop at node: -267800264 ofname = linebytes, size = 4, returned size = 4 Getting prop at node: -267800264 ofname = depth, size = 4, returned size = -1 I then added some printfs to openfirm.c:OF_getprop, but now it keeps givingme 'Memory Address not Aligned' so I guess something got broken whilelinking. I'm going to recompile from scratch tomorrow, to see if that makes it work again.So it fails to read the depth property but doesn't have any problem with the others. Very odd. There goes the maybe-we're-on-the-wrong- node theory. You don't use any funny compiler options, do you?Not that I know of. I can check again tonight. Maybe important: I'm crosscompiling from NetBSD/macppc 4.0. Another important point is that the kernel I got from the daily build dir on FTP has the same effect, so I doubt that it's anything weird I'm doing with the build.
Ok, I had to ask - I build my sparc64 kernels natively or crossbuild on macppc and FreeBSD/i386 ;) Hmm, there seems to be something crazy going on in the firmware, I dimly remember a similar problem and I /think/ I got around it by shuffling OF_getprop() calls around.
A few things to try:- - call OF_getproplen on the depth property, see if it returns something sane. If not we might be able to use that for a workaround. - - shuffle of_to_uint32_prop() blocks around in sparc64/autoconf.c / copyprops(), see if it keeps failing on 'depth' or moves to something else. For our purposes the order in which we read the properties doesn't really matter but it might trigger some weirdness in your firmware.
have fun Michael -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) iQEVAwUBR4tnDMpnzkX8Yg2nAQIBNAgAvKnvPbMfZvbbKIecDC+BNyaydi7mNT9e tsam7W6kQ7//Cng5QPLIhM6YSoQuHVj/F77BEGwV3W0HnejtXwi+TZpWqmZ+nbX+ myWS96qygDC9/vvIK4XhvEKQmvXPJGVNRtg1AfE3W08zBzZwcH9vjTbQ27jpYl78 eHFpz+wWzScWvpM3NAztwpclL6eDs2451xNY6kLJ6dvOPBboEiH1vWfIbI/5/YCe L3Uk+8Ak4GCoJg0HM0XP+ZIYp18Zbr8UL4UrhW35DhX+BkHJ1y9HOCJrPnwjrNHQ RQ1zXOVtkumRYMS7AhZgFLXxsxwh2+xoMaYzjmYJ1syEMMB9txPUUQ== =XanW -----END PGP SIGNATURE-----