tag:blogger.com,1999:blog-6454200798774615510.post5329895237445517790..comments2023-10-25T08:54:24.597-07:00Comments on FreeBSD + PPC = GSoC 2008: odd discoveryvi0http://www.blogger.com/profile/03338074674997819446noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-6454200798774615510.post-34490649885457906292008-08-19T17:51:00.000-07:002008-08-19T17:51:00.000-07:00Yaeah! That worked! I'll make a blog entry... Than...Yaeah! That worked! I'll make a blog entry... Thanks!vi0https://www.blogger.com/profile/03338074674997819446noreply@blogger.comtag:blogger.com,1999:blog-6454200798774615510.post-85206859426461943062008-08-19T17:39:00.000-07:002008-08-19T17:39:00.000-07:00That is likely because OF_getprop is called early ...That is likely because OF_getprop is called early on in the process before OF_buf has been allocated. At this point in the boot process it is safe to call out to openfirmware without using OF_buf.<BR/><BR/>I'd put a check in if OF_buff is not null use it otherwise use buf. After the call to openfirmware if OF_buf is not NULL copy it's contents to buf.Andrewhttps://www.blogger.com/profile/09556598535347144447noreply@blogger.comtag:blogger.com,1999:blog-6454200798774615510.post-48505547058939158472008-08-19T17:21:00.000-07:002008-08-19T17:21:00.000-07:00I did so, at the beginning I've added the OF_buf a...I did so, at the beginning I've added the OF_buf and copied it afterwards. But then, it crashes immediately, it doesn't even make it to single character of copyrights... I added OF_buf to most of the OF functions, to each one that in NetBSD's openfirm.c has it. If I don't use OF_buf in OF_getprop(), and comment out the decr_init(), it makes it do subsystem 38000000, just like I wrote on the blog... At the moment, apart from that, I'm stuck on the mtspr sprg0, that hangs in openfirmware(), in OF_getprop()...vi0https://www.blogger.com/profile/03338074674997819446noreply@blogger.comtag:blogger.com,1999:blog-6454200798774615510.post-9058469355456131362008-08-19T15:45:00.000-07:002008-08-19T15:45:00.000-07:00That is likely because args.buf points to a virtua...That is likely because args.buf points to a virtual address.<BR/><BR/>You could try and use OF_buf rather than buf then copy the result from OF_buf to buf after openfirmware returns. For an example of this look at OF_read.<BR/><BR/>args.propname should not need to be copied to OF_buf as it is (as far as I can tell) always a const char * and so it's address is valid.<BR/><BR/>While there you will also need to add ofw_stack to OF_child and OF_parent as they are used later on in decr_init.Andrewhttps://www.blogger.com/profile/09556598535347144447noreply@blogger.comtag:blogger.com,1999:blog-6454200798774615510.post-31985239298127781802008-08-19T06:10:00.000-07:002008-08-19T06:10:00.000-07:00OF_peer() is returning, and it enters OF_getprop()...OF_peer() is returning, and it enters OF_getprop() after that. Then it crashes, even with the code from NetBSD.vi0https://www.blogger.com/profile/03338074674997819446noreply@blogger.comtag:blogger.com,1999:blog-6454200798774615510.post-60351428765843249002008-08-17T18:52:00.000-07:002008-08-17T18:52:00.000-07:00Have you checked OF_peer is returning and the cras...Have you checked OF_peer is returning and the crash is happening in another of the OF_ functions?Andrewhttps://www.blogger.com/profile/09556598535347144447noreply@blogger.com