[OpenBIOS] next-property

Olivier Danet odanet at caramail.com
Fri Jan 3 23:32:20 CET 2014


On 03/01/2014 22:14, Mark Cave-Ayland wrote:
> On 03/01/14 20:33, Olivier Danet wrote:
>
>> On 03/01/2014 21:01, Mark Cave-Ayland wrote:
>>> On 03/01/14 19:16, Olivier Danet wrote:
>>>
>>> Hi Olivier,
>>>
>>>> You are right.
>>>> I tried on an Ultra 10 with OpenBoot 3.12.
>>>>
>>>> next-property returns nothing when the property is unknown and also 
>>>> when
>>>> the property is the last one.
>>>> This contradicts Sun own documentation "Writing FCode 3.x Programs".
>>>
>>> Hmmmm. Is there anything in the IEEE1275 errata about this?
>>>
>>>> Puzzled, I tried then on a Apple iBook G3 :
>>>> dev screen
>>>> " <something>" active-package next-property
>>>>
>>>> This laptop returns :
>>>> - true and a forth string when the property is not the last one
>>>> - true and "0 0" when the property is the last one
>>>> - false when the property does not exist.
>>>>
>>>> Anyway, whatever method is chosen (return nothing, return zero...),
>>>> OpenBIOS forth and/or C code ("opb_nextprop()") should be modifed to
>>>> avoid page faults.
>>>
>>> Yes indeed. The OpenBIOS Forth string to C string implementation
>>> returns NULL if the length is 0 which has caught me out a few times.
>>> The trick I've done, particularly in the filesystem drivers, is to do
>>> something like the following where required:
>>>
>>> if (str == NULL) {
>>> return "";
>>> }
>>>
>>> BTW you never answered about which version of NetBSD you were trying
>>> to boot?
>>>
>>>
>>> ATB,
>>>
>>> Mark.
>> I am using the latest, 6.1.2, installed from the full ISO image.
>> They changed quite a bit the video part in NetBSD 6, overhauled
>> the console and seem to have forked the TCX X11 driver to add hardware
>> acceleration.
>
> Oh that's interesting. Is there anything here that could be shared 
> with a potential CG6 driver of any sort?
>
> FWIW for testing you could also try my CG3 patchset here: 
> https://github.com/mcayland/qemu/tree/cg3-final but you'll probably 
> want to replace the QEMU,cgthree.bin ROM in QEMU with the one from 
> OpenBIOS SVN trunk.
>
I will try !

>> I managed yesterday to boot NetBSD and run X in 256 colours mode !
>
> Fantastic!
>
>> Changes so far :
>>
>> OpenBIOS :
>> - The "next-property" stuff. Called when starting the X server.
>> - "keyboard" property detail. Else keyboard input does not work.
>> - TCX properties modifications. For TCX/Dumb framebuffer selection.
>
> The latter is interesting; is it possible for the OS to detect the 
> framebuffer as a CG3/CG6 at all?
>
The modifications were necessary to prevent the dumb framebuffer from 
taking control of the console during
boot. It is almost a bug in NetBSD.
The 'name' property is used for identifying the device type : 
"SUNW,tcx", or "cgsix"...
I have never met a real CG3 !

>> QEMU :
>> - Old bug "!TC on DATA XFER" in esp.c driver
>
> I seem to remember Blue posted a potential patch for this, but I 
> wasn't able to find it again?
>
>> - TCX hardware acceleration stuff in tcx.c and sun4m.c (for memory
>> regions):
>> blitter, stippler, hardware cursor.
>
> Fascinating.
>
> As always, I'm happy to apply any OpenBIOS patches and to help get the 
> others into QEMU as required.
>
>
> ATB,
>
> Mark.
I will try the truecolor mode and check for regressions and post the 
diffs soon.

The acceleration parts of TCX used by NetBSD are really very simple, the 
actual hardware
is probably quite limited, much simpler than CG6.
The hardware cursor part is probably quite similar, as is the palette.

http://sourceware.mirrors.tds.net/pub/NetBSD/NetBSD-release-6/xsrc/external/mit/xf86-video-suncg6/dist/src/
http://sourceware.mirrors.tds.net/pub/NetBSD/NetBSD-release-6/xsrc/external/mit/xf86-video-suntcx/dist/src/
The Xsun sources which were published a while ago included the CG6 
driver, iirc.

Having a reasonably complete TCX driver is probably doable and 
interesting for Solaris (6/7/8/9 ???).

Olivier




More information about the OpenBIOS mailing list