2010/3/23 Tarl Neustaedter Tarl.Neustaedter@sun.com:
It looks like all the keywords are known to the OpenBIOS, but I can't input the test string: " /options" ['] find-device catch if 2drop true else current-device device-end then swap l!
The above executed at the command line will get you in trouble - it's expecting arguments on the stack you don't have.
Yes, thanks. Probably would have noticed stack underflow if I were able to execute the command as-is. My point was the limit of the command line length.
" /options" ['] find-device catch
This finds the "/options" node in the device tree and makes it the active device context. The top argument on the stack will tell you whether find-device caused a problem (aborted).
if 2drop true else current-device device-end then
The above says to drop two arguments from the stack (hopefully the string "/options") if find-device aborted, otherwise get the phandle of "/options" and put it on the stack. The device-end destroys the device context of /options. I'm not sure why this code does this, a simpler way would have been to simply call find-package, which doesn't set your device context in the first place.
Maybe the earlier versions of OBP didn't have find-package or it was buggy?