I want to place vga related code in the vga.fs file, but it just doesn't compile. Here are some of the errors I see:
Error: File /Users/john/Desktop/openbios/drivers/vga.fs, Line 234. (Output Position = 1166). Word find-device is not in dictionary. Error: File /Users/john/Desktop/openbios/drivers/vga.fs, Line 235. (Output Position = 1179). Word active-package is not in dictionary.
Is there a way to fix this error?
On 2016-Oct-9 20:57 , Programmingkid wrote:
I want to place vga related code in the vga.fs file, but it just doesn't compile. Here are some of the errors I see:
Error: File /Users/john/Desktop/openbios/drivers/vga.fs, Line 234. (Output Position = 1166). Word find-device is not in dictionary. Error: File /Users/john/Desktop/openbios/drivers/vga.fs, Line 235. (Output Position = 1179). Word active-package is not in dictionary.
Is there a way to fix this error?
Those are words in the Forth dictionary, not available to FCode. A hack way to get at them would be to add:
" find-device" execute
That's considered the moral equivalent of a goto. FCode (which is what you find in device drivers), should not be calling find-device or active-package. If you are calling them from FCode, you're generally doing something wrong - there should never be a reason to access these methods from device-specific drivers. In the 1275 spec, you'll notice the find-device method doesn't have the "F" indicating it's an FCode.
On Oct 9, 2016, at 9:30 PM, Tarl Neustaedter wrote:
On 2016-Oct-9 20:57 , Programmingkid wrote:
I want to place vga related code in the vga.fs file, but it just doesn't compile. Here are some of the errors I see:
Error: File /Users/john/Desktop/openbios/drivers/vga.fs, Line 234. (Output Position = 1166). Word find-device is not in dictionary. Error: File /Users/john/Desktop/openbios/drivers/vga.fs, Line 235. (Output Position = 1179). Word active-package is not in dictionary.
Is there a way to fix this error?
Those are words in the Forth dictionary, not available to FCode. A hack way to get at them would be to add:
" find-device" execute
That's considered the moral equivalent of a goto. FCode (which is what you find in device drivers), should not be calling find-device or active-package. If you are calling them from FCode, you're generally doing something wrong - there should never be a reason to access these methods from device-specific drivers. In the 1275 spec, you'll notice the find-device method doesn't have the "F" indicating it's an FCode.
Thank you very much for your comment. If you have seen my patch, what would you suggest I do in order to access properties from nodes? I was told the patch is required to place its code in drivers/vga.fs.
On 2016-Oct-9 23:00 , G 3 wrote:
Thank you very much for your comment. If you have seen my patch, what would you suggest I do in order to access properties from nodes? I was told the patch is required to place its code in drivers/vga.fs.
The problem is that the "add-resolutions" method as it's set up, because it changes device context with find-device, should not be part of the vga fcode. Code in the vga fcode should not change out of the vga vocabulary.
I suspect you can't put the add-resolutions code in the openbios startup code itself, because the vga node won't exist before the fcode runs. That kind of problem is why I originally suggested that the proper location for this property was in /chosen, not in the vga node. The /chosen node should exist at openbios startup, and you should be able to do the add-resolutions stuff there, as long as you don't insist on putting stuff in the vga device node.
If you really want it in the vga node, what I'd suggest trying is:
[ Note, don't know if it will work in openbios, it's the way we did it in Openboot before I retired from Oracle]
" /options" find-package if ( phandle ) " resolutions" rot get-package-property if ( -- ) abort" Did not find resolutions property" else ( prop-addr prop-len ) \ At this point you have the property then else ( -- ) abort" Did not find /options node". then
The above presumes that find-package in openbios will recognize the initial "/", and search for the node in question in the device tree rather than inside the /packages node.