[OpenBIOS] Probing the PCI bus for Option ROMs.

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Tue Apr 3 22:17:37 CEST 2018


On 02/04/18 21:51, Jd Lyons wrote:

> Joe, if it would be something that interests you, and you have the time, 
> we could work on adding proper PCI Probing to Openbios.
> 
> As it stands the Qemu_VGA is a pci device, and Qemu loads an Option rom, 
> but it’s the VGA Bios and Opennbios doesn’t probe for option roms. 
>   Openbios has the Fcode for the Qemu-Vga device and there is a NDRV 
> that gets loaded from a file.
> 
> What we really need is to make a proper FCode Rom image with the NDRV 
> for the Qemu_VGA device, we could make a hybrid Bios/Fcode rom and not 
> have to change the code in Qemu at all, I don’t think.
> 
> Here are some instructions on setting up and building Openbios on OS X 
> Intel.
> 
> There is an effective tutorial on the openbios site. If you run OSX, you 
> nee to install the fcode utils and use the awos cross compiler linked 
> to: http://www.mediafire.com/download/wy5xg ... pilers.zip 
> <http://www.mediafire.com/download/wy5xgj2hwjp8k4k/AWOS_Cross-Compilers.zip>
> 
> This is my script to build the OpenBIOS binary:
> PATH=:/usr/local/ppcelf/ppcelf/bin:/users/hsp/src/fcode-utils-devel/toke:$PATH
> export PATH
> cd openbios
> CROSS_COMPILE=ppc-elf- ./config/scripts/switch-arch ppc
> #(remove -Werror from CFLAGS in Makefile.target in top directory)
> make
> 
> Best,
> Cat_7
> 
> I forget the file that has the Forth for the Qemu_VGA device, Mark?

You can find the QEMU VGA driver in drivers/vga.fs.

Note that the NDRV is deliberately served from QEMU via the hypervisor 
fw_cfg interface so that it is possible for QEMU to serve just the FCode 
option ROM by default, rather than having to embed the full Mac driver.

Getting OpenBIOS/QEMU to read a proper FCode ROM goes something like this:

1) Get OpenBIOS's compiled QEMU,VGA.bin FCode image added to QEMU

2) For certain machines (PPC/SPARC64) in QEMU replace the default PC 
option ROM with the FCode Option ROM

3) Hack vga_config_cb() to map the option ROM via the BAR (6) instead of 
directly executing the embedded FCode binary via byte-load


ATB,

Mark.



More information about the OpenBIOS mailing list