[OpenBIOS] [PATCH] Add resolutions via the command-line

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Fri Sep 23 16:09:59 CEST 2016

On 21/09/16 22:53, Benjamin Herrenschmidt wrote:

> On Wed, 2016-09-21 at 14:26 -0400, G 3 wrote:
>> Nodes like chose, aliases, openprom are of class IOService. options  
>> is of class IODTNVRAM. It looks like this class has problems. I'm  
>> thinking since Alexander Graf did work in the mac_nvram.c file, he  
>> might know what is wrong.
> What is wrong is purely that MacOS X limits how you do things on that
> node. Have a look at the OS X kernel source :-) The implementation of
> the support libraries to run NDRVs is all there (module
> IOGraphicsFamily iirc).
>>  I found another way to access the options  
>> node in Mac OS X. Use this command: ioreg -c IODTNVRAM. It stops at  
>> the options node and prints this error message: "ioreg: error: can't  
>> obtain properties" in QEMU. On a real Power Mac the command prints  
>> all the properties of the options node just fine.
> Correct, part of the problem is that I think we don't emulate the NVRAM
> in a format that OS X understands, a problem for another day.
>> I don't know about using binary. The way we do it now seems just fine.
> ASCII parsing in a driver sucks.
>> I just need to figure out how to write to the /chosen node from the  
>> QEMU command line. I found a function called OpenBIOS_set_var() in  
>> openbios_firmware_abi.h, but it would require an address to write to.  
>> So where do I find the address of the /chosen node....
> No, you don't. Do as I said. Have OpenBIOS construct the list of
> resolutions and put it in the node of the device itself.

Yeah. My take would be to add a "modes" property to the VGA device which
is a set of encode-int triplets of (width, height, depth) respectively.

Even better, does QEMU provide any preset resolutions via EDID? I'd much
rather get OpenBIOS's VGA to read those and put them in the "modes"
device property, including adding in any custom resolution provided on
the command line via -g wxhxd.



More information about the OpenBIOS mailing list