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
Kernel+Meta: Allow graphical environment on ISA-PC and microvm machine types #15259
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
supercomputer7
force-pushed
the
bochs-vga-isa
branch
8 times, most recently
from
September 17, 2022 03:06
979d3bc
to
6bb9f03
Compare
ISA IDE controllers don't support Bus-master DMA as this feature is only available for PCI IDE controllers. Therefore, don't try to use DMA mode for such hardware.
We use a ScopeGuard to ensure we always set a console of some sort if we exit early from the initialization sequence in the GraphicsManagement code. We do so to ensure we can boot into text mode console in an ISA-PC machine type, because earlier we failed with an assertion due to not setting any console for VirtualConsole to use.
We should aim to reliably determine if PCI hardware exists or not, and we should consider the ACPI MCFG table in that test. Although it is unusual to see an hardware setup where the PCI host bridge does not respond to x86 IO instructions, it is expected to happen at least on the QEMU microvm machine type as the host bridge only responds to memory mapped IO requests. Therefore, we first test if ACPI is enabled, and we try to use it to fetch the MCFG table. Later on we could also add FDT parsing as part of the PCI IO test which would be useful for the QEMU microvm machine type.
supercomputer7
force-pushed
the
bochs-vga-isa
branch
from
September 20, 2022 17:54
6bb9f03
to
c02111b
Compare
I've sent a patch to QEMU to try to introduce support of getting the physical address of the framebuffer from the Bochs VBE registers: |
linusg
suggested changes
Sep 20, 2022
This device is supposed to be used in microvm and ISA-PC machine types, and we assume that if we are able to probe for the QEMU BGA version of 0xB0C5, then we have an existing ISA Bochs VGA adapter to utilize. To ensure we don't instantiate the driver for non isa-vga devices, we try to ensure that PCI is disabled because hardware IO test probe failed so we can be sure that we use this special handling code only in the QEMU microvm and ISA-PC machine types. Unfortunately, this means that if for some reason the isa-vga device is attached for the i440FX or Q35 machine types, we simply are not able to drive the device in such setups at all. To determine the amount of VRAM being available, we read VBE register at offset 0xA. That register holds the amount of VRAM divided by 64K, so we need to multiply the value in our code to use the actual VRAM size value again. The isa-vga device requires us to hardcode the framebuffer physical address to 0xE0000000, and that address is not expected to change in the future as many other projects rely on the isa-vga framebuffer to be present at that physical memory address.
With this device being added, we can now boot into graphics mode on these platforms too. For ISA-PC machine this is basically the only viable option to use, but in the future, we should remove this device for the microvm machine type as it should allow us to determine better options and detect them by using a given device tree blob.
supercomputer7
force-pushed
the
bochs-vga-isa
branch
from
September 20, 2022 18:03
c02111b
to
0194a46
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Relies on #15173.