Here's a recipe for accessing VESA graphics from OFW in VirtualBox.
Make a bootable USB stack with OFW, using pre-v4 syslinux (it might work with v4 syslinux but I haven't tried it).
Follow the instructions at http://www.pendrivelinux.com/boot-a-usb-flash-drive-in-virtualbox/ to make VirtualBox boot from the USB stick. Those instructions did not work exactly for me - the Create Virtual Machine - Virtual Hard Disk dialog could not find usb.vmdk . I solved that by using the Settings menu to replace the default IDE drive with usb.vmdk .
Your virtual machine must have at least 245M of memory.
Set up a piped serial port as described in section 3.9 of the VirtualBox manual.
Start the virtual machine. When the ok prompt comes up, type "com1 io" to send the console to the virtual serial port.
Type this:
ok hex 142 set-linear-mode
That should put the virtualbox emulator window into graphics mode
ok 142 vesa-lfb-adr 10000 ff0000 lfill
That should make part of the screen turn red.
On 5/24/2011 5:15 PM, Mitch Bradley wrote:
On 5/24/2011 4:10 PM, 胡松涛 wrote:
Hi,
When I learn http://www.openfirmware.org/1275/practice/#graphics I found that: I Can't get /pci/display ihandle under vbox,
That is because there is no suitable driver in the demo build.
VirtualBox emulates a linear frame buffer that is managed with VESA BIOS extensions. The demo build, when running under syslinux, has some words to access VESA BIOS functions - they are defined in cpu/x86/pc/biosload/callvbe.fth . You could use them to put the display into VESA linear framebuffer mode, then access the framebuffer with the functions in dev/video/common/rectangl.fth .
You would need to use a serial console for this, because as soon as you switched to VESA linear mode, you would lose the text-mode console display.
when I boot
up with usb-disk on my laptop, I can't get ihandle as well.
Again, the problem is the lack of a driver for the graphics card on your laptop. Modern PC graphics cards are very complex, and often undocumented.
If your laptop has a conventional BIOS that supports VESA, you could use the VESA technique outlined above to access its display in graphics mode. If it has an EFI BIOS, some other technique would be required.
but I can get /pci/vga ihandle under qemu. And it works fine with graphics.
qemu emulates an old Cirrus logic display controller for which OFW has a driver (the source code is in dev/video/cirrus.bth).
Which graphics methods are you using with /pci/vga ?
openfirmware mailing list openfirmware@openfirmware.info https://openfirmware.info/mailman/listinfo/openfirmware