Hello,
I'm trying to port fdt unflattening from SLOF to OpenBIOS but need some help with understanding and implementing equivalent forth words, The SLOF fdt.fs uses set-unit which is defined in
https://github.com/aik/SLOF/blob/master/slof/fs/node.fs
: set-space get-node dup >r node>space ! true r> node>space? ! ; : set-address my-#address-cells 1 ?DO get-node node>space i cells + ! LOOP ; : set-unit set-space set-address ;
These set the unit address manipulating the fields of the node struct as far as I understand.
But I don't know how to do the same in OpenBIOS. OpenBIOS implements the word that returns these values that set-unit is supposed to change in
https://github.com/openbios/openbios/blob/master/forth/device/package.fs#L19...
as
: my-unit ( -- phys.lo ... phys.hi ) ?my-self >in.my-unit my-#acells tuck /l* + swap 0 ?do /l - dup l@ swap loop drop ;
but I don't understand how these are stored in OpenBIOS and how to change them. Could somone who understands forth or know OpenBIOS more suggest an implementation of set-unit for OpenBIOS please?
We'll also need set-node which sets active-package I think so suggestions for that are also welcome.
Thank you, BALATON Zoltan