j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
On Sat Mar 8 2014, Mark Cave-Ayland wrote:
I think the best solution is going to be to move the default device name from forth/device/tree.fs into the individual per-architecture arch/*/tree.fs files and then customise the PPC one as appropriate.
Is it possible to set/override the value in forth/device/tree.fs in the ppc/qemu/init.c file somehow? If so then it would be easier and we already have an is_apple() function there so this can be done only for Apple emulation. Is the init code run when the tree is already set up? What should it do to replace the name property? A assume it would call some forth code to do this but I don't know how to do this properly. Any ideas?
Regards, BALATON Zoltan
On 08/03/14 18:58, BALATON Zoltan wrote:
Is it possible to set/override the value in forth/device/tree.fs in the ppc/qemu/init.c file somehow? If so then it would be easier and we already have an is_apple() function there so this can be done only for Apple emulation. Is the init code run when the tree is already set up? What should it do to replace the name property? A assume it would call some forth code to do this but I don't know how to do this properly. Any ideas?
It is possible by simply recreating a property with the same name but a different value; however from painful experience I've spent days debugging something that was caused by a property in the default tree unexpectedly appearing in an architecture tree. If the property hadn't been present then the client would simply have faulted at that point making the culprit obvious.
So I'd be all for reducing the cross-architecture tree down to the bare minimum to avoid unexpected surprises like this.
ATB,
Mark.
On 2014-Mar-8, 16:29 , Mark Cave-Ayland wrote:
What should it do to replace the name property? A assume it would call some forth code to do this but I don't know how to do this properly. Any ideas?
It is possible by simply recreating a property with the same name but a different value; [...]
Careful with that. On Sun Openboot, the proper procedure is to delete the property and then create a new property. It seems that when you simply create a property on top of a previous property of the same name, it doesn't re-allocate the storage. So overwriting a string property with a longer string will trash either your heap or your device tree. I don't know if OpenFirmware/OpenBios fixed that tradition.