Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could we get rid of VGA BIOS binary? #4

Closed
merge opened this issue Jan 19, 2018 · 36 comments
Closed

Could we get rid of VGA BIOS binary? #4

merge opened this issue Jan 19, 2018 · 36 comments
Labels

Comments

@merge
Copy link
Owner

merge commented Jan 19, 2018

Is there a configuration for having Video pre-Linux (in SeaBIOS and bootloader from HDD) without the binary VGA BIOS rom extracted from the vendor image?

@merge merge changed the title Get rid of VGA BIOS binary Could we get rid of VGA BIOS binary? Jan 19, 2018
@merge merge added the question label Jan 19, 2018
@nemanjan00
Copy link

I did try to do this, but, with seabios, I do not get any image until linux takes over.

@merge
Copy link
Owner Author

merge commented Jan 29, 2018

We can't just remove the vga bios. Native graphics init doesn't seem to work either. Did you try that? It's not all that bad having this as binary because of good coreboot integration and it seems to be identical for all X230 models. I just like to have this question open.

It'd probably be a seperate project analyzing this vga bios.

@rectagonal
Copy link

rectagonal commented Mar 26, 2018

Dumb question as im relatively new to coreboot. (I did my first flash w/ this repo's build this weekend.) Is it possible to use native graphics int + SeaVGABios in lieu of the proprietary vendor vga rom?

@merge
Copy link
Owner Author

merge commented Mar 26, 2018

I guess it's always "native graphics init" or "run a VGA Bios binary". I didn't yet try to build a VGA bios using the seabios repo, and add that as "external" in coreboot. Do you want to try this?

Also, it's been quite some time since I tried native graphics init, but last thing I heard was, to have graphics in a bootloader or payload, and also to support Windows, we need that extracted VGA bios.

@rectagonal
Copy link

rectagonal commented Mar 26, 2018

I wasn't sure how external it actually was. Coreboot wiki makes it sound like it's in the main tree just under a non obvious option:

SeaBIOS can provide an option rom that implements legacy VGA BIOS compatibility for coreboot initialized GPUs. To use this feature select CONFIG_VGA_COREBOOT (in "make menuconfig" under "VGA ROM ---> VGA Hardware Type" select "coreboot linear framebuffer").
https://www.coreboot.org/SeaBIOS#Using_coreboot_VGA_support

I had planned on trying it unless someone told me it was a terrible idea, but it might be a few days before im ready to pop open the laptop again. I also don't know how I would test Windows compatibility. I mostly run NetBSD and sometimes dual boot Devuan.

EDIT: Would booting the Win 10 installer, without going through installation be a sufficient test?

@tlaurion
Copy link

tlaurion commented Apr 29, 2018

x230 doesn't need vga bios and can be initiated by native VGA init code. Here is the x230 coreboot building configuration used by Heads to boot it's linux payload. Use that config and modify to use SeaBIOS.

Ho. True that, maybe you're right. Maybe Seabios needs a VGA bios. Didn't try that.

@merge
Copy link
Owner Author

merge commented May 1, 2018 via email

@merge
Copy link
Owner Author

merge commented May 2, 2018

Thanks for the config link. Why do they have CONFIG_VGA_BIOS_FILE="pci8086,0166.rom" in their config? Is that a mistake?

@tlaurion
Copy link

tlaurion commented May 5, 2018

You can comment it out, since not used:

# CONFIG_VGA_BIOS is not set
CONFIG_MAINBOARD_HAS_NATIVE_VGA_INIT=y
# CONFIG_MAINBOARD_FORCE_NATIVE_VGA_INIT is not set
CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT=y

have you tested?

@Thrilleratplay
Copy link
Contributor

I can confirm. I just flashed coreboot using the last source and compiled libgfxinit. Here is a gist of the make file

@nemanjan00
Copy link

Is this config based off the one in repo?

There are quite a bit of changes...

@Thrilleratplay
Copy link
Contributor

@nemanjan00 It is. Other than adding in additional payloads, the changes are related to video related

@nemanjan00
Copy link

Ok. Thank you! Going to try it right now.

@nemanjan00
Copy link

Yeah, works!

@merge
Copy link
Owner Author

merge commented May 7, 2018

Thanks for testing this. We'll still use the blobs repo for microcode updates, but I'll test this soon and hope to be able to remove the vga file. great.

@merge
Copy link
Owner Author

merge commented May 7, 2018

Based on what @Thrilleratplay suggests I have the following config diff to the current one in our repo:

--- a/x230/92263853ad.config
+++ b/x230/1ecec5f979.config
@@ -76,6 +76,7 @@ CONFIG_VENDOR_LENOVO=y
 # CONFIG_VENDOR_LOWRISC is not set
 # CONFIG_VENDOR_MSI is not set
 # CONFIG_VENDOR_NVIDIA is not set
+# CONFIG_VENDOR_OCP is not set
 # CONFIG_VENDOR_PACKARDBELL is not set
 # CONFIG_VENDOR_PCENGINES is not set
 # CONFIG_VENDOR_PURISM is not set
@@ -84,6 +85,7 @@ CONFIG_VENDOR_LENOVO=y
 # CONFIG_VENDOR_SAPPHIRE is not set
 # CONFIG_VENDOR_SCALEWAY is not set
 # CONFIG_VENDOR_SIEMENS is not set
+# CONFIG_VENDOR_SIFIVE is not set
 # CONFIG_VENDOR_SUNW is not set
 # CONFIG_VENDOR_SUPERMICRO is not set
 # CONFIG_VENDOR_TECHNEXION is not set
@@ -104,7 +106,7 @@ CONFIG_PAYLOAD_CONFIGFILE=""
 CONFIG_VGA_BIOS_ID="8086,0166"
 # CONFIG_ONBOARD_VGA_IS_PRIMARY is not set
 CONFIG_DIMM_SPD_SIZE=256
-CONFIG_VGA_BIOS=y
+# CONFIG_VGA_BIOS is not set
 CONFIG_DCACHE_RAM_BASE=0xfefe0000
 CONFIG_DCACHE_RAM_SIZE=0x20000
 CONFIG_VGA_BIOS_FILE="pci8086,0166.rom"
@@ -185,7 +187,6 @@ CONFIG_SYSTEM_TYPE_LAPTOP=y
 # SoC
 #
 CONFIG_CPU_SPECIFIC_OPTIONS=y
-# CONFIG_S3_VGA_ROM_RUN is not set
 CONFIG_RAMTOP=0x200000
 CONFIG_HEAP_SIZE=0x4000
 CONFIG_RAMBASE=0x100000
@@ -296,6 +297,7 @@ CONFIG_USE_NATIVE_RAMINIT=y
 # CONFIG_NATIVE_RAMINIT_IGNORE_MAX_MEM_FUSES is not set
 # CONFIG_NATIVE_RAMINIT_IGNORE_XMP_MAX_DIMMS is not set
 CONFIG_SANDYBRIDGE_IVYBRIDGE_LVDS=y
+CONFIG_IF_NATIVE_VGA_INIT=y
 CONFIG_HPET_ADDRESS=0xfed00000
 CONFIG_HPET_MIN_TICKS=0x80
 CONFIG_MAX_PIRQ_LINKS=4
@@ -383,6 +385,7 @@ CONFIG_UDK_VERSION=2013
 # CONFIG_ARCH_ROMSTAGE_ARMV8_64 is not set
 # CONFIG_ARCH_RAMSTAGE_ARMV8_64 is not set
 CONFIG_ARCH_ARMV8_EXTENSION=0
+# CONFIG_ARM64_USE_ARCH_TIMER is not set
 # CONFIG_ARM64_A53_ERRATUM_843419 is not set
 # CONFIG_ARCH_MIPS is not set
 # CONFIG_ARCH_BOOTBLOCK_MIPS is not set
@@ -432,32 +435,28 @@ CONFIG_BOOTBLOCK_SIMPLE=y
 CONFIG_BOOTBLOCK_SOURCE="bootblock_simple.c"
 # CONFIG_COLLECT_TIMESTAMPS_NO_TSC is not set
 CONFIG_COLLECT_TIMESTAMPS_TSC=y
+# CONFIG_PAGING_IN_CACHE_AS_RAM is not set
+# CONFIG_IDT_IN_EVERY_STAGE is not set
 
 #
 # Devices
 #
 CONFIG_HAVE_VGA_TEXT_FRAMEBUFFER=y
+CONFIG_HAVE_LINEAR_FRAMEBUFFER=y
 CONFIG_MAINBOARD_HAS_NATIVE_VGA_INIT=y
 # CONFIG_MAINBOARD_FORCE_NATIVE_VGA_INIT is not set
 CONFIG_MAINBOARD_HAS_LIBGFXINIT=y
-# CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT is not set
+CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT=y
 # CONFIG_MAINBOARD_USE_LIBGFXINIT is not set
-CONFIG_VGA_ROM_RUN=y
+# CONFIG_VGA_ROM_RUN is not set
 # CONFIG_NO_GFX_INIT is not set
-# CONFIG_ALWAYS_LOAD_OPROM is not set
-# CONFIG_ON_DEVICE_ROM_LOAD is not set
-# CONFIG_PCI_OPTION_ROM_RUN_REALMODE is not set
-CONFIG_PCI_OPTION_ROM_RUN_YABEL=y
-# CONFIG_YABEL_PCI_ACCESS_OTHER_DEVICES is not set
-CONFIG_YABEL_VIRTMEM_LOCATION=0x1000000
-# CONFIG_YABEL_DIRECTHW is not set
 # CONFIG_MULTIPLE_VGA_ADAPTERS is not set
 
 #
 # Display
 #
-# CONFIG_FRAMEBUFFER_SET_VESA_MODE is not set
 CONFIG_VGA_TEXT_FRAMEBUFFER=y
+# CONFIG_GENERIC_LINEAR_FRAMEBUFFER is not set
 # CONFIG_SMBUS_HAS_AUX_CHANNELS is not set
 CONFIG_PCI=y
 CONFIG_MMCONF_SUPPORT=y
@@ -531,7 +530,7 @@ CONFIG_SMBIOS_PROVIDED_BY_MOBO=y
 # CONFIG_MAINBOARD_HAS_I2C_TPM_CR50 is not set
 # CONFIG_PLATFORM_USES_FSP2_0 is not set
 # CONFIG_INTEL_DDI is not set
-# CONFIG_INTEL_EDID is not set
+CONFIG_INTEL_EDID=y
 CONFIG_INTEL_INT15=y
 CONFIG_INTEL_GMA_ACPI=y
 # CONFIG_INTEL_GMA_SSC_ALTERNATE_REF is not set
@@ -660,7 +659,9 @@ CONFIG_SEABIOS_STABLE=y
 # CONFIG_SEABIOS_MASTER is not set
 # CONFIG_SEABIOS_REVISION is not set
 # CONFIG_SEABIOS_THREAD_OPTIONROMS is not set
+CONFIG_SEABIOS_VGA_COREBOOT=y
 CONFIG_SEABIOS_BOOTORDER_FILE=""
+CONFIG_PAYLOAD_VGABIOS_FILE="payloads/external/SeaBIOS/seabios/out/vgabios.bin"
 CONFIG_SEABIOS_DEBUG_LEVEL=-1
 
 #
@@ -695,12 +696,10 @@ CONFIG_HAVE_DEBUG_SMBUS=y
 # CONFIG_DEBUG_SMM_RELOCATION is not set
 # CONFIG_DEBUG_MALLOC is not set
 # CONFIG_DEBUG_ACPI is not set
-# CONFIG_X86EMU_DEBUG is not set
 # CONFIG_DEBUG_SPI_FLASH is not set
 # CONFIG_TRACE is not set
 # CONFIG_DEBUG_BOOT_STATE is not set
 # CONFIG_DEBUG_ADA_CODE is not set
-CONFIG_NO_EDID_FILL_FB=y
 # CONFIG_ENABLE_APIC_EXT_ID is not set
 CONFIG_WARNINGS_ARE_ERRORS=y
 # CONFIG_POWER_BUTTON_DEFAULT_ENABLE is not set

I don't have display in GRUB. SeaBIOS works though. The same goes for using CONFIG_MAINBOARD_USE_LIBGFXINIT instead of native vga init. sorry -.- Can you really confirm that you have display in your HDD's GRUB installation after SeaBIOS?

thanks

@nemanjan00
Copy link

nemanjan00 commented May 7, 2018

I do have display in GRUB. (even when using GRUB as payload)

This is my config:

.config:
https://gist.github.com/nemanjan00/14127cbaef7ed5c3e6b7410825526982

grub.cfg:
https://gist.github.com/nemanjan00/5ea1cf9e2e0bb4bcb33d1d25b758c299

@merge
Copy link
Owner Author

merge commented May 7, 2018

you use GRUB as coreboot payload. You have display there, just like SeaBIOS has, using native vga init. What I'm talking about is GRUB on disk (or Windows on disk, which wouldn't work either, I think).

Can you confirm having video in GRUB on disk?

@nemanjan00
Copy link

nemanjan00 commented May 7, 2018

I am 80% sure I did. I will try it again later.

You are using Grub 2.2?

Do you have graphics module?

Did you maybe set different graphics mode in grub.cfg?

@merge
Copy link
Owner Author

merge commented May 7, 2018

I use GRUB 2.0, a Debian stable default installation.

@merge
Copy link
Owner Author

merge commented May 16, 2018

As a reminder: my own tests reflect what is documented in the coreboot wiki: https://www.coreboot.org/Board:lenovo/x230#Proprietary_components.27_status

So if any of you see this change, the page would need an update too.

@merge
Copy link
Owner Author

merge commented May 17, 2018

FWIW, the Video BIOS is owned by Intel, and they have some information on it

but in order to improve the situation, we'd have to get a statement from Intel about being allowed to distribute this.

@nemanjan00
Copy link

I can confirm I have GRUB working without VGA BIOS binary.

@Thrilleratplay
Copy link
Contributor

I do as well using GRUB but I have only booted into Linux. Based on the how the Coreboot wikis for the x220 and x230 are worded, Windows or Windows bootloader may still require the VGA binary.

@merge
Copy link
Owner Author

merge commented May 18, 2018

Please post your coreboot config file. I've never found a configuration that worked, but I'd love to find one.

@nemanjan00
Copy link

@merge
Copy link
Owner Author

merge commented May 20, 2018

I can confirm that this does not work for me. I don't see my GRUB menu with that config -.- what could I am be doing wrong? Did you install GRUB after flashing maybe?

@Thrilleratplay
Copy link
Contributor

@merge If you using SeaBIOS, do you see the SeaBIOS output but not the GRUB menu?

I mostly use GRUB to handle the disk encryption and hide the menu. Use the basic console but did not disable the graphical console.

GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=1 vga=current"

# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
#GRUB_THEME="/path/to/gfxtheme"

These are the relevant lines from my grub config. If this does not provide enough information, I can post the whole thing in a gist.

@nemanjan00 Are you using console output or graphical output for GRUB?

@merge
Copy link
Owner Author

merge commented May 21, 2018

I see seabios, but not GRUB, yes. I use Debian's default installation, which is what I always want to have supported, so trying to change grub configs doesn't really help for now.

@nemanjan00
Copy link

Part of my grub.cfg I think you are asking about:

terminal_input console
terminal_output gfxterm

@merge
Copy link
Owner Author

merge commented May 22, 2018

thanks for your help! Indeed also Debian puts this in it's /etc/default/grub:

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

and when applying this (disabling the graphical terminal), seavgabios works, and shows my GRUB menu!

So where to go from here? Of course we want a more free version. I don't know if this handles booting for Windows though. Also, we'd have to document the GRUB config visibly if we want to use this.

I'd suggest maintaining a second configuration, and release 2 built images, one named "x230_coreboot_...._free.rom". Would this confuse people?

merge added a commit that referenced this issue May 22, 2018
…ntel's binary

To make a GRUB bootloader installation (on the HDD) work, the graphical
console has to be disabled in /etc/default/grub :

	GRUB_TERMINAL=console

Remember to apply the change using update-grub. The menu is displayed in
text mode.

This is also discussed in #4
@merge
Copy link
Owner Author

merge commented May 22, 2018

when configuring a linear "high resolution" framebuffer in coreboot, even the graphical GRUB console works. I don't see Linux' boot log afterwards though, so that's not yet a possible config. But still, we should find a way to add a text-based image, with a dependency on GRUB_TERMINAL=console.

@Thrilleratplay
Copy link
Contributor

Glad you were able to get GRUB working without the VGA binary, even with the graphical menu.

Not seeing the kernel boot messages is interesting. I do not see there either and thought it was because of the Nitrocaster mod in my x230. I noticed there have been updates in Coreboot lately that include the vbt.bin which may fix this. Although given how finicky the i915 can be, this is probably something that either a GRUB kernel parameter fix or will correct itself as libgfxinit matures

@nemanjan00
Copy link

nemanjan00 commented May 23, 2018 via email

@merge
Copy link
Owner Author

merge commented May 23, 2018

I simply don't see early kernel log messages, when using CONFIG_GENERIC_LINEAR_FRAMEBUFFER (which you don't have enabled in your posted config). Without this (in text mode), all is fine.

@merge
Copy link
Owner Author

merge commented Nov 23, 2018

going forward, there's #46 with the remaining problem I see

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants