Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
On Mon, May 19, 2014 at 08:23:25PM +0100, David Woodhouse wrote: > On Wed, 2014-04-16 at 12:37 -0400, Kevin O'Connor wrote: > > This is unfortunate. I can put a hack into seabios (not seavgabios) > > to use bigreal mode for int 1587 calls during option rom execution. > > But, it does raise the question of how many other callers expect the > > bios to not mess with the segment limits. (Though, to be honest, the > > only goal I have with coreboot native seavgabios is support for grub, > > lilo, syslinux, and maybe ntldr.) > > Was there a conclusion to this? Did you eventually convince yourself > that it could be *OK* for the video BIOS to trash the segment limits, > for a limited set of boot targets? Commit 6c68e7ad changed SeaBIOS to stay in bigreal mode for an int 1587 call that comes during option rom processing. The coreboot native vga init stuff (vgasrc/cbvga.c) is basically a demonstration of SeaVGABIOS for cases where a "real" vgabios is not available or not desirable. As above, my goal for cbvga was only modern OSes. -Kevin ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
On Wed, 2014-04-16 at 12:37 -0400, Kevin O'Connor wrote: > On Mon, Apr 14, 2014 at 02:22:51PM +0200, Gerd Hoffmann wrote: > > So you can try this: > > > > qemu -vga std > -bios /usr/share/coreboot.git/coreboot-i440fx-seabios.rom > > > > to see it live in action. > > > > Two problems spotted so far: > > > > (1) ipxe hangs at rom load time. > > can be worked around by adding '-net none' to the qemu cmd > line. > > I've reproduced this. It only fails for me with -enable-kvm. It was > (as I feared) the result of segment limits getting trashed from the > int 1587 call. (Presumably, qemu tcg doesn't fail because it doesn't > implement segment limits?) The (incorrect) patch below enables the > boot to proceed past the ipxe prompt. > > This is unfortunate. I can put a hack into seabios (not seavgabios) > to use bigreal mode for int 1587 calls during option rom execution. > But, it does raise the question of how many other callers expect the > bios to not mess with the segment limits. (Though, to be honest, the > only goal I have with coreboot native seavgabios is support for grub, > lilo, syslinux, and maybe ntldr.) Was there a conclusion to this? Did you eventually convince yourself that it could be *OK* for the video BIOS to trash the segment limits, for a limited set of boot targets? -- dwmw2 smime.p7s Description: S/MIME cryptographic signature ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
On 04/17/2014 01:41 AM, Gerd Hoffmann wrote: > On Mi, 2014-04-16 at 17:30 -0700, H. Peter Anvin wrote: >> Syslinux currently looks for a 640x480 mode unless MENU RESOLUTION is given. > > Do the vgabios interfaces allow for bytes_per_line being different from > x_res * bytes_per_pixel? If so seavgabios could allow setting 640x480 > on 800x600 ... > They do. However, it is also on my list to fix Syslinux to at least deal better with multiple resolutions. -hpa ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
It does. On the other hand, Syslinux really need to handle various resolutions better. Unto recently, though, 640x480 was universally available. On April 17, 2014 1:41:58 AM PDT, Gerd Hoffmann wrote: >On Mi, 2014-04-16 at 17:30 -0700, H. Peter Anvin wrote: >> Syslinux currently looks for a 640x480 mode unless MENU RESOLUTION is >given. > >Do the vgabios interfaces allow for bytes_per_line being different from >x_res * bytes_per_pixel? If so seavgabios could allow setting 640x480 >on 800x600 ... > >cheers, > Gerd -- Sent from my mobile phone. Please pardon brevity and lack of formatting. ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
On Mi, 2014-04-16 at 17:30 -0700, H. Peter Anvin wrote: > Syslinux currently looks for a 640x480 mode unless MENU RESOLUTION is given. Do the vgabios interfaces allow for bytes_per_line being different from x_res * bytes_per_pixel? If so seavgabios could allow setting 640x480 on 800x600 ... cheers, Gerd ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
Syslinux currently looks for a 640x480 mode unless MENU RESOLUTION is given. On April 16, 2014 5:12:21 PM PDT, Kevin O'Connor wrote: >On Wed, Apr 16, 2014 at 04:25:48PM -0700, H. Peter Anvin wrote: >> On 04/16/2014 04:21 PM, Kevin O'Connor wrote: >> > If I build SeaVGABIOS without vesa and run the Fedora 16 (or later) >> > installer in qemu I get a menu that is not centered and the bottom >> > line of the menu box isn't drawn. Also, when I hit up arrow or >down >> > arrow I can't see which menu item is highlighted. I'm really not >sure >> > if this is syslinux related though. (This wasn't an issue in >Fedora >> > 15 or earlier - though they always show up as black-and-white.) >See >> > the attached screenshot as an example. >> > >> >> I wonder if they simply specify a geometry that is too large for the >> text mode screen. I'll have to take a look at their config file. > >Thanks. The menu definitely looks weird even with a larger screen. >If I disable vesa and switch into a graphics mode (eg, 0x12) prior to >running syslinux I get a screenshot like the attached. (Same steps to >reproduce as in my previous email with the additional patch below to >force SeaBIOS to switch to mode 0x12.) > >To be clear, the biggest issue is not being able to see which item is >highlighted. > >[...] >> For the record, Syslinux in text mode will use only BIOS calls (no >> direct write to the screen) to allow things like serial port capture >and >> text-to-graphics conversion to work. > >Yes - modern bootloaders seem quite good about using the bios >interface. > >> Let me know if I can be of assistance. > >While you're here - what conditions does syslinux require in order to >use graphics mode? When we use the coreboot native vga SeaVGABIOS, it >does include vesa support and it will advertise exactly one vesa mode. >(For example, in our qemu tests it's mode 0x0140 that is 800x600 with >32bpp.) However, syslinux (at least on my fedora tests) doesn't seem >to want to go into graphics mode and instead uses its text mode. Are >we doing something wrong here, or is it just that a different >resolution is required? > >Thanks, >-Kevin > > >--- a/src/bootsplash.c >+++ b/src/bootsplash.c >@@ -45,6 +45,7 @@ enable_vga_console(void) > /* Enable VGA text mode */ > memset(&br, 0, sizeof(br)); > br.ax = 0x0003; >+br.ax = 0x0012; > call16_int10(&br); > > // Write to screen. -- Sent from my mobile phone. Please pardon brevity and lack of formatting. ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
On Wed, Apr 16, 2014 at 04:25:48PM -0700, H. Peter Anvin wrote: > On 04/16/2014 04:21 PM, Kevin O'Connor wrote: > > If I build SeaVGABIOS without vesa and run the Fedora 16 (or later) > > installer in qemu I get a menu that is not centered and the bottom > > line of the menu box isn't drawn. Also, when I hit up arrow or down > > arrow I can't see which menu item is highlighted. I'm really not sure > > if this is syslinux related though. (This wasn't an issue in Fedora > > 15 or earlier - though they always show up as black-and-white.) See > > the attached screenshot as an example. > > > > I wonder if they simply specify a geometry that is too large for the > text mode screen. I'll have to take a look at their config file. Thanks. The menu definitely looks weird even with a larger screen. If I disable vesa and switch into a graphics mode (eg, 0x12) prior to running syslinux I get a screenshot like the attached. (Same steps to reproduce as in my previous email with the additional patch below to force SeaBIOS to switch to mode 0x12.) To be clear, the biggest issue is not being able to see which item is highlighted. [...] > For the record, Syslinux in text mode will use only BIOS calls (no > direct write to the screen) to allow things like serial port capture and > text-to-graphics conversion to work. Yes - modern bootloaders seem quite good about using the bios interface. > Let me know if I can be of assistance. While you're here - what conditions does syslinux require in order to use graphics mode? When we use the coreboot native vga SeaVGABIOS, it does include vesa support and it will advertise exactly one vesa mode. (For example, in our qemu tests it's mode 0x0140 that is 800x600 with 32bpp.) However, syslinux (at least on my fedora tests) doesn't seem to want to go into graphics mode and instead uses its text mode. Are we doing something wrong here, or is it just that a different resolution is required? Thanks, -Kevin --- a/src/bootsplash.c +++ b/src/bootsplash.c @@ -45,6 +45,7 @@ enable_vga_console(void) /* Enable VGA text mode */ memset(&br, 0, sizeof(br)); br.ax = 0x0003; +br.ax = 0x0012; call16_int10(&br); // Write to screen. <>___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
H. Peter Anvin wrote: > Uh... seriously, robustness is a good thing, and it is not entirely > clear that this responsibility necessarily belongs in Coreboot. It's clear to me. The coreboot (all lowercase please) code for QEMU isn't neccessarily complete, and needs these kinds of improvements. > But especially if you are touching the command register anyway, SeaBIOS should perhaps not. That's not so clear to me however. :) //Peter ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
On 04/16/2014 03:47 PM, Kevin O'Connor wrote: > On Wed, Apr 16, 2014 at 06:56:57PM +0200, Gerd Hoffmann wrote: >> Emulating attributes would be great so you can actually navigate >> bootloader menus. > > I took a look a closer look at this. Some things I found: > > - it looks like the syslinux menu on recent Fedora versions doesn't > work correctly at all in text mode. This can be most easily seen by > disabling CONFIG_VGA_VBE on one of the standard qemu seavgabios > builds - without vbe syslinux wont go into graphics mode and the > same broken text menu is shown. So, this isn't a seavgabios issue > but a fedora and/or syslinux issue. > ?! I would love more details... > - I took a quick look at what happens with the ati vgabios on my > e350m1 if it is forced into a graphics mode (eg, mode 0x12). I see > similar results to what I see with coreboot native seavgabios. So, > it looks like most of our troubles are with the standard vgabios > interface in graphics vs text mode and not something specific to > seavgabios. The non-VESA graphics mode text interface is a bit "special"... and quite frankly broken on a lot of systems. I thought SeaBIOS was doing okay, so there might be a bug here... -hpa ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
On 04/16/2014 03:59 PM, Peter Stuge wrote: > Gerd Hoffmann wrote: >>> -pci_config_maskw(bdf, PCI_COMMAND, 0, PCI_COMMAND_MASTER); >>> +pci_config_maskw(bdf, PCI_COMMAND, 0, PCI_COMMAND_MASTER | >>> PCI_COMMAND_IO | PCI_COMMAND_MEMORY); >> >> I think that should go in. If we need it, we better make sure it >> is enabled instead of expecting someone else to do it. > > I think this reasoning is completely broken; what you are saying is > that SeaBIOS should in principle do the complete hardware init. > > It is IMO broken enough that SeaBIOS does so for QEMU - please don't > push that into SeaBIOS built for coreboot, but fix the actual > problem where it exists (in coreboot), instead of making a workaround > in SeaBIOS under the guise of "we need it so we must do it ourselves" > > It sounds like NIH syndrome. :\ > Uh... seriously, robustness is a good thing, and it is not entirely clear that this responsibility necessarily belongs in Coreboot. But especially if you are touching the command register anyway, the cost is literally zero to just do it. -hpa ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
On 04/16/2014 04:21 PM, Kevin O'Connor wrote: > On Wed, Apr 16, 2014 at 04:00:07PM -0700, H. Peter Anvin wrote: >> On 04/16/2014 03:47 PM, Kevin O'Connor wrote: >>> On Wed, Apr 16, 2014 at 06:56:57PM +0200, Gerd Hoffmann wrote: Emulating attributes would be great so you can actually navigate bootloader menus. >>> >>> I took a look a closer look at this. Some things I found: >>> >>> - it looks like the syslinux menu on recent Fedora versions doesn't >>> work correctly at all in text mode. This can be most easily seen by >>> disabling CONFIG_VGA_VBE on one of the standard qemu seavgabios >>> builds - without vbe syslinux wont go into graphics mode and the >>> same broken text menu is shown. So, this isn't a seavgabios issue >>> but a fedora and/or syslinux issue. >>> >> >> ?! I would love more details... > > If I build SeaVGABIOS without vesa and run the Fedora 16 (or later) > installer in qemu I get a menu that is not centered and the bottom > line of the menu box isn't drawn. Also, when I hit up arrow or down > arrow I can't see which menu item is highlighted. I'm really not sure > if this is syslinux related though. (This wasn't an issue in Fedora > 15 or earlier - though they always show up as black-and-white.) See > the attached screenshot as an example. > I wonder if they simply specify a geometry that is too large for the text mode screen. I'll have to take a look at their config file. > Steps to reproduce - grab latest seabios from > git://git.seabios.org/seabios.git , run "make menuconfig" and select > CONFIG_VGA_CIRRUS=y and CONFIG_VGA_VBE=n. Then run "make", then > "mkdir qemutest; cp out/bios.bin qemutest/; cp out/vgabios.bin > qemutest/vgabios-cirrus.bin". Then run qemu with: qemu-system-i386 -L > qemutest/ -m 512 -cdrom Fedora-19-x86_64-DVD.iso > >>> - I took a quick look at what happens with the ati vgabios on my >>> e350m1 if it is forced into a graphics mode (eg, mode 0x12). I see >>> similar results to what I see with coreboot native seavgabios. So, >>> it looks like most of our troubles are with the standard vgabios >>> interface in graphics vs text mode and not something specific to >>> seavgabios. > > That section of my email was not related to syslinux. As background, > we're looking into ways to run standard boot loaders with only a > graphical framebuffer by emulating text mode on top of a graphical > framebuffer. The section above was discussing how the vgabios > interprets certain calls differently depending on whether it is text > or graphics mode. That it does, indeed. For the record, Syslinux in text mode will use only BIOS calls (no direct write to the screen) to allow things like serial port capture and text-to-graphics conversion to work. Let me know if I can be of assistance. -hpa ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
Gerd Hoffmann wrote: > > -pci_config_maskw(bdf, PCI_COMMAND, 0, PCI_COMMAND_MASTER); > > +pci_config_maskw(bdf, PCI_COMMAND, 0, PCI_COMMAND_MASTER | > > PCI_COMMAND_IO | PCI_COMMAND_MEMORY); > > I think that should go in. If we need it, we better make sure it > is enabled instead of expecting someone else to do it. I think this reasoning is completely broken; what you are saying is that SeaBIOS should in principle do the complete hardware init. It is IMO broken enough that SeaBIOS does so for QEMU - please don't push that into SeaBIOS built for coreboot, but fix the actual problem where it exists (in coreboot), instead of making a workaround in SeaBIOS under the guise of "we need it so we must do it ourselves" It sounds like NIH syndrome. :\ //Peter ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
On Wed, Apr 16, 2014 at 04:00:07PM -0700, H. Peter Anvin wrote: > On 04/16/2014 03:47 PM, Kevin O'Connor wrote: > > On Wed, Apr 16, 2014 at 06:56:57PM +0200, Gerd Hoffmann wrote: > >> Emulating attributes would be great so you can actually navigate > >> bootloader menus. > > > > I took a look a closer look at this. Some things I found: > > > > - it looks like the syslinux menu on recent Fedora versions doesn't > > work correctly at all in text mode. This can be most easily seen by > > disabling CONFIG_VGA_VBE on one of the standard qemu seavgabios > > builds - without vbe syslinux wont go into graphics mode and the > > same broken text menu is shown. So, this isn't a seavgabios issue > > but a fedora and/or syslinux issue. > > > > ?! I would love more details... If I build SeaVGABIOS without vesa and run the Fedora 16 (or later) installer in qemu I get a menu that is not centered and the bottom line of the menu box isn't drawn. Also, when I hit up arrow or down arrow I can't see which menu item is highlighted. I'm really not sure if this is syslinux related though. (This wasn't an issue in Fedora 15 or earlier - though they always show up as black-and-white.) See the attached screenshot as an example. Steps to reproduce - grab latest seabios from git://git.seabios.org/seabios.git , run "make menuconfig" and select CONFIG_VGA_CIRRUS=y and CONFIG_VGA_VBE=n. Then run "make", then "mkdir qemutest; cp out/bios.bin qemutest/; cp out/vgabios.bin qemutest/vgabios-cirrus.bin". Then run qemu with: qemu-system-i386 -L qemutest/ -m 512 -cdrom Fedora-19-x86_64-DVD.iso > > - I took a quick look at what happens with the ati vgabios on my > > e350m1 if it is forced into a graphics mode (eg, mode 0x12). I see > > similar results to what I see with coreboot native seavgabios. So, > > it looks like most of our troubles are with the standard vgabios > > interface in graphics vs text mode and not something specific to > > seavgabios. That section of my email was not related to syslinux. As background, we're looking into ways to run standard boot loaders with only a graphical framebuffer by emulating text mode on top of a graphical framebuffer. The section above was discussing how the vgabios interprets certain calls differently depending on whether it is text or graphics mode. -Kevin <>___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
On Wed, Apr 16, 2014 at 06:56:57PM +0200, Gerd Hoffmann wrote: > Emulating attributes would be great so you can actually navigate > bootloader menus. I took a look a closer look at this. Some things I found: - it looks like the syslinux menu on recent Fedora versions doesn't work correctly at all in text mode. This can be most easily seen by disabling CONFIG_VGA_VBE on one of the standard qemu seavgabios builds - without vbe syslinux wont go into graphics mode and the same broken text menu is shown. So, this isn't a seavgabios issue but a fedora and/or syslinux issue. - I took a quick look at what happens with the ati vgabios on my e350m1 if it is forced into a graphics mode (eg, mode 0x12). I see similar results to what I see with coreboot native seavgabios. So, it looks like most of our troubles are with the standard vgabios interface in graphics vs text mode and not something specific to seavgabios. - The patch below seems to help a little with older Fedora versions using syslinux. The idea is to try and treat the attr in graphics mode more like a text mode attr. (The patch is broken for non native coreboot builds, but it demonstrates the idea.) Unfortunately, this patch doesn't help for the freedos menu - as that uses a different mechanism for setting the attributes (it fills areas of the screen with an attr and then separately writes text to the screen with the assumption that the existing text attr will remain in place). -Kevin --- a/vgasrc/vgafb.c +++ b/vgasrc/vgafb.c @@ -400,7 +400,7 @@ gfx_write_char(struct vgamode_s *vmode_g } else { int j; for (j = 0; j < 8; j++) -op.pixels[j] = (fontline & (0x80>>j)) ? ca.attr : 0x00; +op.pixels[j] = (fontline & (0x80>>j)) ? (ca.attr & 0x0f) : (ca.attr >> 4); } op.op = GO_WRITE8; handle_gfx_op(&op); ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
On Wed, Apr 16, 2014 at 06:56:57PM +0200, Gerd Hoffmann wrote: > And we don't have a cursor I've noticed meanwhile. That would be very > helpful for editing your linux cmd line in the boot loader. A blinking > cursor is probably a bit unrealistic (need timer interrupt etc), but > emulating a block cursor should be possible I think. I was thinking something similar - just xor the character cell underneath the cursor. The only tricky part is to make sure to undo the cursor manipulation during any scrolls or screen writes. I was also thinking about hooking the timer interrupt to support blinking, but like you, I concluded it wasn't worth the effort. -Kevin ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
On Wed, Apr 16, 2014 at 06:48:43PM +0200, Gerd Hoffmann wrote: > > Hi, > > > That said, CONFIG_ATA_DMA is > > very fragile and it may be worth just removing at some point. > > Why is it fragile? On PATA you're supposed to do all these weird controller specific stuff to make sure DMA works, to set what level of DMA to use, and to tell the drive that DMA will be used. The SeaBIOS code does none of that. This is why CONFIG_ATA_DMA is disabled by default. Now that I think about it though, the code is likely okay for SATA drives attached to SATA controllers that use ATA emulation. -Kevin ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
Hi, > But, it does raise the question of how many other callers expect the > bios to not mess with the segment limits. (Though, to be honest, the > only goal I have with coreboot native seavgabios is support for grub, > lilo, syslinux, and maybe ntldr.) Yes, it should be good enough for bootloaders. Emulating attributes would be great so you can actually navigate bootloader menus. And we don't have a cursor I've noticed meanwhile. That would be very helpful for editing your linux cmd line in the boot loader. A blinking cursor is probably a bit unrealistic (need timer interrupt etc), but emulating a block cursor should be possible I think. cheers, Gerd ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
Hi, > But, it does raise the question of how many other callers expect the > bios to not mess with the segment limits. (Though, to be honest, the > only goal I have with coreboot native seavgabios is support for grub, > lilo, syslinux, and maybe ntldr.) Yes, it should be good enough for bootloaders. Emulating attributes would be great so you can actually navigate bootloader menus. And we don't have a cursor I've noticed meanwhile. That would be very helpful for editing your linux cmd line in the boot loader. A blinking cursor is probably a bit unrealistic (need timer interrupt etc), but emulating a block cursor should be possible I think. cheers, Gerd ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
Hi, > That said, CONFIG_ATA_DMA is > very fragile and it may be worth just removing at some point. Why is it fragile? cheers, Gerd ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
On Mon, Apr 14, 2014 at 02:22:51PM +0200, Gerd Hoffmann wrote: > So you can try this: > > qemu -vga std -bios /usr/share/coreboot.git/coreboot-i440fx-seabios.rom > > to see it live in action. > > Two problems spotted so far: > > (1) ipxe hangs at rom load time. > can be worked around by adding '-net none' to the qemu cmd line. I've reproduced this. It only fails for me with -enable-kvm. It was (as I feared) the result of segment limits getting trashed from the int 1587 call. (Presumably, qemu tcg doesn't fail because it doesn't implement segment limits?) The (incorrect) patch below enables the boot to proceed past the ipxe prompt. This is unfortunate. I can put a hack into seabios (not seavgabios) to use bigreal mode for int 1587 calls during option rom execution. But, it does raise the question of how many other callers expect the bios to not mess with the segment limits. (Though, to be honest, the only goal I have with coreboot native seavgabios is support for grub, lilo, syslinux, and maybe ntldr.) -Kevin --- a/src/system.c +++ b/src/system.c @@ -115,11 +115,11 @@ handle_1587(struct bregs *regs) SET_FARVAR(gdt_seg, gdt_far[1], GDT_DATA | GDT_LIMIT((6*sizeof(u64))-1) | GDT_BASE(loc)); // Initialize CS descriptor -SET_FARVAR(gdt_seg, gdt_far[4], GDT_CODE | GDT_LIMIT(BUILD_BIOS_SIZE-1) +SET_FARVAR(gdt_seg, gdt_far[4], GDT_CODE | GDT_GRANLIMIT(0x) | GDT_BASE(BUILD_BIOS_ADDR)); // Initialize SS descriptor loc = (u32)MAKE_FLATPTR(GET_SEG(SS), 0); -SET_FARVAR(gdt_seg, gdt_far[5], GDT_DATA | GDT_LIMIT(0x0) +SET_FARVAR(gdt_seg, gdt_far[5], GDT_DATA | GDT_GRANLIMIT(0x) | GDT_BASE(loc)); u16 count = regs->cx; ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
On Wed, Apr 16, 2014 at 06:17:45PM +0200, Gerd Hoffmann wrote: > Hi, > > > --- a/src/hw/ata.c > > +++ b/src/hw/ata.c > > > -pci_config_maskw(bdf, PCI_COMMAND, 0, PCI_COMMAND_MASTER); > > +pci_config_maskw(bdf, PCI_COMMAND, 0, PCI_COMMAND_MASTER | > > PCI_COMMAND_IO | PCI_COMMAND_MEMORY); > > Ah. I think that should go in. If we need it, we better make sure it > is enabled instead of expecting someone else to do it. It's more > robust, even if it should not be needed in theory. > > That patch also makes CONFIG_ATA_DMA=y on CONFIG_QEMU=y builds work. On CONFIG_QEMU=y, pciinit.c turns those bits on, so it isn't needed in ata.c. On real hardware coreboot used to enable those bits, as I used to use CONFIG_ATA_DMA=y on my boards. (Recently, all my boards have AHCI, so I use that instead and I'm not sure I can retest on real hardware.) In any case, I guess there is no harm in doing the above. It's just odd that coreboot doesn't turn it on. That said, CONFIG_ATA_DMA is very fragile and it may be worth just removing at some point. -Kevin ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
Hi, > --- a/src/hw/ata.c > +++ b/src/hw/ata.c > -pci_config_maskw(bdf, PCI_COMMAND, 0, PCI_COMMAND_MASTER); > +pci_config_maskw(bdf, PCI_COMMAND, 0, PCI_COMMAND_MASTER | > PCI_COMMAND_IO | PCI_COMMAND_MEMORY); Ah. I think that should go in. If we need it, we better make sure it is enabled instead of expecting someone else to do it. It's more robust, even if it should not be needed in theory. That patch also makes CONFIG_ATA_DMA=y on CONFIG_QEMU=y builds work. cheers, Gerd ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
On Tue, Apr 15, 2014 at 07:52:47AM +0200, Gerd Hoffmann wrote: > Hi, > > > Oddly, I can't boot from a hard drive (-hda) when I use the > > coreboot/seabios I built though. It keeps failing at "Booting from > > Hard Disk...". > > I see that with my builds too, but only with -vga std (where coreboot > vgabios is used). Same bios image with -vga cirrus works fine. So it > seems this is triggered by the coreboot vgabios too. I tracked down the failures I was seeing - my coreboot builds had CONFIG_ATA_DMA enabled and that doesn't work with coreboot on qemu. For some reason, coreboot doesn't enable the memory or io bits in the pci config space. The seabios patch below fixes it for me, but I'm not sure if seabios is the right place to fix it. In any case, I think I'll just stop using CONFIG_ATA_DMA for my coreboot builds. -Kevin --- a/src/hw/ata.c +++ b/src/hw/ata.c @@ -950,7 +950,7 @@ init_pciata(struct pci_device *pci, u8 prog_if) u32 bar = pci_config_readl(bdf, PCI_BASE_ADDRESS_4); if (bar & PCI_BASE_ADDRESS_SPACE_IO) { master = bar & PCI_BASE_ADDRESS_IO_MASK; -pci_config_maskw(bdf, PCI_COMMAND, 0, PCI_COMMAND_MASTER); +pci_config_maskw(bdf, PCI_COMMAND, 0, PCI_COMMAND_MASTER | PCI_COMMAND_IO | PCI_COMMAND_MEMORY); } } ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
Hi, > Oddly, I can't boot from a hard drive (-hda) when I use the > coreboot/seabios I built though. It keeps failing at "Booting from > Hard Disk...". I see that with my builds too, but only with -vga std (where coreboot vgabios is used). Same bios image with -vga cirrus works fine. So it seems this is triggered by the coreboot vgabios too. > > (2) color attributes don't work correctly. Result is that you can't > > figure which line in your boot menu is highlighted. Visible in > > Fedora live isos (which use isolinux as boot loader) I think. > > This isn't surprising as the vgabios handling of attributes in text > mode is different from the handling in graphics mode. It may be > possible to tweak seavgabios so it tries to emulate the text mode > attr handling. Ok, so simply not implemented. cheers, Gerd ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
Hi, > Thanks. Looks like that set of options would have broken the build > even prior to the vga patch series. There was no reason to try though ;) > I can fix the compilation with > the patch below, but it wont actually permit the vgabios to use the > debug_io support. Reasonable. cheers, Gerd ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
On Mon, Apr 14, 2014 at 02:22:51PM +0200, Gerd Hoffmann wrote: > So you can try this: > > qemu -vga std -bios /usr/share/coreboot.git/coreboot-i440fx-seabios.rom > > to see it live in action. > > Two problems spotted so far: > > (1) ipxe hangs at rom load time. > can be worked around by adding '-net none' to the qemu cmd line. I didn't try your firmware, but I did try building coreboot and seabios from source. I can't reproduce this ipxe failure. (Though, I realize now that the seavgabios call to int 1587 may transition the cpu from bigreal mode to regular real mode and confuse ipxe.) Oddly, I can't boot from a hard drive (-hda) when I use the coreboot/seabios I built though. It keeps failing at "Booting from Hard Disk...". I'll have to look at this further. If you have any tips on the above let me know. (Otherwise, I'll see if I can work through the options you have in your repos.) > (2) color attributes don't work correctly. Result is that you can't > figure which line in your boot menu is highlighted. Visible in > Fedora live isos (which use isolinux as boot loader) I think. This isn't surprising as the vgabios handling of attributes in text mode is different from the handling in graphics mode. It may be possible to tweak seavgabios so it tries to emulate the text mode attr handling. -Kevin ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
On Mon, Apr 14, 2014 at 11:59:13AM +0200, Gerd Hoffmann wrote: > On Fr, 2014-04-11 at 11:31 -0400, Kevin O'Connor wrote: > > On Sun, Apr 06, 2014 at 06:59:53PM -0400, Kevin O'Connor wrote: > > > This patch series refactors the vgabios graphics mode framebuffer > > > manipulation code. It then adds in support for manipulating "direct" > > > framebuffers that modern vga modes use. > > > > > > This series (along with the followup patches for coreboot native vga > > > vgabios) is also available at: > > > > > > https://github.com/KevinOConnor/seabios/tree/testing > > > > FYI, I have pushed this patch series (as well as the follow up > > coreboot native vgabios series) to seabios master. > > Some configs fail to build, seems to be the logging: > > CONFIG_COREBOOT=y > CONFIG_QEMU_HARDWARE=y > CONFIG_VGA_COREBOOT=y > CONFIG_DEBUG_IO=y > > out/vgaccode16.o: In function `runningOnQEMU': > /home/kraxel/projects/seabios/src/fw/paravirt.h:18: undefined reference > to `PlatformRunningOn' > > Flipping CONFIG_DEBUG_IO to 'n' makes it build fine. Thanks. Looks like that set of options would have broken the build even prior to the vga patch series. I can fix the compilation with the patch below, but it wont actually permit the vgabios to use the debug_io support. (Getting the debug_io support to work with those options would be a pain - it would require linking in paravirt.c and making the qemu detection code work in 16bit mode or making the vgabios init run in 32bit mode.) -Kevin >From fe2cbf6d606e138055b00b0aac6162503a5fb38d Mon Sep 17 00:00:00 2001 Message-Id: From: Kevin O'Connor Date: Mon, 14 Apr 2014 10:46:34 -0400 Subject: [PATCH] vgabios: Define PlatformRunningOn to make compile happy. To: seabios@seabios.org With CONFIG_COREBOOT=y, CONFIG_QEMU_HARDWARE=y, CONFIG_VGA_COREBOOT=y, CONFIG_DEBUG_IO=y the compile would break because this variable was missing. Signed-off-by: Kevin O'Connor --- vgasrc/vgainit.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vgasrc/vgainit.c b/vgasrc/vgainit.c index 6d9a224..9d6dd1e 100644 --- a/vgasrc/vgainit.c +++ b/vgasrc/vgainit.c @@ -32,6 +32,9 @@ struct VideoSavePointer_s video_save_pointer_table VAR16; struct VideoParam_s video_param_table[29] VAR16; +// Type of emulator platform - for dprintf with certain compile options. +int PlatformRunningOn VAR16; + / * PCI Data -- 1.9.0 ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
On Fr, 2014-04-11 at 11:31 -0400, Kevin O'Connor wrote: > On Sun, Apr 06, 2014 at 06:59:53PM -0400, Kevin O'Connor wrote: > > This patch series refactors the vgabios graphics mode framebuffer > > manipulation code. It then adds in support for manipulating "direct" > > framebuffers that modern vga modes use. > > > > This series (along with the followup patches for coreboot native vga > > vgabios) is also available at: > > > > https://github.com/KevinOConnor/seabios/tree/testing > > FYI, I have pushed this patch series (as well as the follow up > coreboot native vgabios series) to seabios master. Updated the firmware builder to include this. If you wanna try things out in qemu install coreboot.git package from the firmware builder repo (http://www.kraxel.org/repos/). It's enabled for the stdvga: coreboot-i440fx-seabios.rom: 256 kB, bootblocksize 944, romsize 262144, offset 0x0 alignment: 64 bytes Name Offset Type Size cmos_layout.bin0x0cmos_layout 1160 pci1234,.rom 0x4c0 optionrom26112 fallback/romstage 0x6b00 stage17654 fallback/coreboot_ram 0xb040 stage57426 fallback/payload 0x19100payload 58083 config 0x27440raw 3391 (empty)0x281c0null 96792 So you can try this: qemu -vga std -bios /usr/share/coreboot.git/coreboot-i440fx-seabios.rom to see it live in action. Two problems spotted so far: (1) ipxe hangs at rom load time. can be worked around by adding '-net none' to the qemu cmd line. (2) color attributes don't work correctly. Result is that you can't figure which line in your boot menu is highlighted. Visible in Fedora live isos (which use isolinux as boot loader) I think. cheers, Gerd ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
On Fr, 2014-04-11 at 11:31 -0400, Kevin O'Connor wrote: > On Sun, Apr 06, 2014 at 06:59:53PM -0400, Kevin O'Connor wrote: > > This patch series refactors the vgabios graphics mode framebuffer > > manipulation code. It then adds in support for manipulating "direct" > > framebuffers that modern vga modes use. > > > > This series (along with the followup patches for coreboot native vga > > vgabios) is also available at: > > > > https://github.com/KevinOConnor/seabios/tree/testing > > FYI, I have pushed this patch series (as well as the follow up > coreboot native vgabios series) to seabios master. Some configs fail to build, seems to be the logging: CONFIG_COREBOOT=y CONFIG_QEMU_HARDWARE=y CONFIG_VGA_COREBOOT=y CONFIG_DEBUG_IO=y out/vgaccode16.o: In function `runningOnQEMU': /home/kraxel/projects/seabios/src/fw/paravirt.h:18: undefined reference to `PlatformRunningOn' Flipping CONFIG_DEBUG_IO to 'n' makes it build fine. cheers, Gerd ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH 0/7] vgabios improvements
On Sun, Apr 06, 2014 at 06:59:53PM -0400, Kevin O'Connor wrote: > This patch series refactors the vgabios graphics mode framebuffer > manipulation code. It then adds in support for manipulating "direct" > framebuffers that modern vga modes use. > > This series (along with the followup patches for coreboot native vga > vgabios) is also available at: > > https://github.com/KevinOConnor/seabios/tree/testing FYI, I have pushed this patch series (as well as the follow up coreboot native vgabios series) to seabios master. -Kevin ___ SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios