I have recently put together a basic implementation of a vgabios for use with displays that are initialized by coreboot.
The idea is pretty simple - coreboot initializes the vga hardware and maps a framebuffer into an address in system memory. Then SeaVGABIOS implements the various legacy vga bios functions, but all it does with them is translate them to framebuffer updates. SeaVGABIOS doesn't try to initialize the display, change modes, or modify the vga registers.
This might be useful for those wishing to run fewer third-party blobs, for those where a vgabios isn't available at all, and for those wanting a faster boot (I've found proprietary vga bioses to be very slow).
I've run some basic tests on this version of SeaVGABIOS on my hardware. However, I don't have one of the boards where coreboot supports native vga init. It would be great if someone with the hardware (looks like stout, x60, and maybe others) could run tests.
To build this version of SeaVGABIOS, checkout the testing code from:
https://github.com/KevinOConnor/seabios/tree/testing
Then run "make menuconfig", turn on building for coreboot (CONFIG_COREBOOT), serial debugging (CONFIG_DEBUG_SERIAL), and enable the coreboot vgabios build (CONFIG_VGA_COREBOOT). The resulting vgabios will be in "out/vgabios.bin" - this file should be placed in CBFS in the file "vgaroms/vgabios.bin". Then launch coreboot with seabios as the payload (one can use the repo above to build seabios also, or use the normal coreboot method of building seabios). Ideally, the seabios menu should appear on the screen and basic OS boot loaders will work. But if not, the debugging info should help track down any problems.
-Kevin
On Wed, 12 Feb 2014 12:58:11 -0500 Kevin O'Connor kevin@koconnor.net wrote:
I have recently put together a basic implementation of a vgabios for use with displays that are initialized by coreboot.
Sorry, I've a huge mail backlog.
To build this version of SeaVGABIOS, checkout the testing code from:
I've tested it like that: * I've added it to my branch where I rebased the lenovo x60 native GPU init patches left, and the rest that I want and that isn't in coreboot yet. * by default it boots under grub as a payload, so I added seabios in payloads/seabios in cbfs, so my cbfs looks like that:
cmos_layout.bin 0x0 cmos_layout 1828 cmos.default 0x780 cmos_default 256 fallback/romstage 0x8c0 stage 52356 fallback/coreboot_ram 0xd580 stage 82524 fallback/payload 0x21840 payload 296852 etc/grub.cfg 0x6a040 raw 2885 config 0x6abc0 raw 4870 payloads/seabios 0x6bf00 payload 105960 vgaroms/sgabios.bin 0x85d40 raw 24064 etc/ps2-keyboard-spinup 0x8bb80 raw 8
Then It booted in grub as usual, which used the framebuffer inited by coreboot, so at that point I did: set root=cbfsdisk chainloader /payloads/seabios # the command started with chain I don't remember its name well, but it's something like that clear # we'll see why later boot
Then seabios started, and I saw the press F12 on the screen which overwrote the previous already-there and not-cleared grub stuff (that's why I used clear before). Since I had etc/ps2-keyboard-spinup, the keyboard worked and the AHCI disk was listed after pressing F12 Then I told it to boot on it, and it loaded the older grub that was in it The version should be that one from parabola (a 100% free software GNU/Linux distribution based on arch):
libre/grub 1:2.02.beta2-1.1 [installed]
That displayed me a prompt, since I didn't setup a grub.cfg, and I could interact with it too.
The coreboot branch I used can be obtained that way: git clone git://gitorious.org/gnutoo-for-coreboot/coreboot.git coreboot-x60 git checkout origin/production+v7_untested -b production+v7
I'll try to boot some live-usb soon.
Thanks a lot!!! I wanted that feature so badly that I looked at it and started trying to do that more than 6 months ago, but then I got no time anymore to work on that.
PS: note that this branch broke the 3D acceleration, I should try to fix it when time permits.
Denis.
On Sun, Feb 16, 2014 at 07:30:30PM +0100, Denis 'GNUtoo' Carikli wrote:
Then seabios started, and I saw the press F12 on the screen which overwrote the previous already-there and not-cleared grub stuff (that's why I used clear before).
Yeah, the clearing can probably be fixed up in the vgabios (see below). There's also no cursor, which can probably be enhanced as well.
Since I had etc/ps2-keyboard-spinup, the keyboard worked and the AHCI disk was listed after pressing F12
I'm surprised you need ps2-keyboard-spinup if you chain load seabios.
Then I told it to boot on it, and it loaded the older grub that was in it The version should be that one from parabola (a 100% free software GNU/Linux distribution based on arch):
libre/grub 1:2.02.beta2-1.1 [installed]
That displayed me a prompt, since I didn't setup a grub.cfg, and I could interact with it too.
Thats great! Thanks for testing.
-Kevin
--- a/vgasrc/cbvga.c +++ b/vgasrc/cbvga.c @@ -162,8 +162,8 @@ cbvga_setup(void) SET_VGA(CBmode.height, ylines); SET_VGA(CBmode.depth, bpp);
- // Setup BDA - vga_set_mode(CBMODENUM, MF_NOCLEARMEM); + // Setup BDA and clear screen. + vga_set_mode(CBMODENUM, 0);
return 0; }
On Sun, 16 Feb 2014 14:51:47 -0500 Kevin O'Connor kevin@koconnor.net wrote:
There's also no cursor, which can probably be enhanced as well.
Yes, I tested more, with seabios directly as a payload, for giving my old Lenovo x60 to someone and spending less time right now to explain him how to configure well grub to be used as a payload. And I saw the cursor issue, that's the most annoying issue because the grub( ran in BIOS platform mode ) that is loaded from disk doesn't show a cursor when editing the menu contents with 'e'
I'm surprised you need ps2-keyboard-spinup if you chain load seabios.
I'll retest soon.
--- a/vgasrc/cbvga.c +++ b/vgasrc/cbvga.c @@ -162,8 +162,8 @@ cbvga_setup(void) SET_VGA(CBmode.height, ylines); SET_VGA(CBmode.depth, bpp);
- // Setup BDA
- vga_set_mode(CBMODENUM, MF_NOCLEARMEM);
// Setup BDA and clear screen.
vga_set_mode(CBMODENUM, 0);
return 0;
}
Thanks a lot, I'll try that as soon as possible, but it's like 23:30 now here, so it'll be for another day.
Denis.
Denis 'GNUtoo' Carikli wrote:
I've tested it like that:
- I've added it to my branch where I rebased the lenovo x60 native GPU init patches left, and the rest that I want and that isn't in coreboot yet.
The commits from your branch which you pushed with me as author and which four other developers reviewed and finally submitted, without spotting bugs present in some commits and with talking to me, will be reverted because they're nowhere near ready for inclusion in the repository.
There is a lot more work required for us to have a maintainable implementation of native graphics init for i945 platforms.
We'll get there eventually, but the code that many people consider "works" is an incredibly fragile proof of concept at very best.
//Peter
On Sunday, February 16, 2014 11:42:57 PM Peter Stuge wrote:
Denis 'GNUtoo' Carikli wrote:
[...]
The commits from your branch which you pushed with me as author and which four other developers reviewed and finally submitted, without spotting bugs present in some commits and with talking to me, will be reverted because they're nowhere near ready for inclusion in the repository.
Well, the patches to revert those commits have been up on gerrit for over a month. Why you chose to not merge them is beyond me.
Alex
Hi,
I've run some basic tests on this version of SeaVGABIOS on my hardware. However, I don't have one of the boards where coreboot supports native vga init. It would be great if someone with the hardware (looks like stout, x60, and maybe others) could run tests.
qemu has native vga init support too.
You probably want boot your VM without vgabios in the pci rom bar though, otherwise seabios will load and run it:
qemu -device VGA,romfile=
cheers, Gerd
On Mon, Feb 17, 2014 at 11:31:29AM +0100, Gerd Hoffmann wrote:
Hi,
I've run some basic tests on this version of SeaVGABIOS on my hardware. However, I don't have one of the boards where coreboot supports native vga init. It would be great if someone with the hardware (looks like stout, x60, and maybe others) could run tests.
qemu has native vga init support too.
You mean with vga pass-through? Is there value in supporting a vgabios for qemu in this situation?
-Kevin
You probably want boot your VM without vgabios in the pci rom bar though, otherwise seabios will load and run it:
qemu -device VGA,romfile=
cheers, Gerd
On Mo, 2014-02-17 at 10:28 -0500, Kevin O'Connor wrote:
On Mon, Feb 17, 2014 at 11:31:29AM +0100, Gerd Hoffmann wrote:
Hi,
I've run some basic tests on this version of SeaVGABIOS on my hardware. However, I don't have one of the boards where coreboot supports native vga init. It would be great if someone with the hardware (looks like stout, x60, and maybe others) could run tests.
qemu has native vga init support too.
You mean with vga pass-through?
No. I mean coreboot has drivers for the qemu emulated vga cards, so there is a coreboot framebuffer when running coreboot as qemu firmware. i.e. you can test this in qemu.
cheers, Gerd