-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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: Add support for QEMU ISA-PC & QEMU MicroVM machine types #12046
Conversation
I know this could be a questionable patch (because SerenityOS is not about supporting really really old stuff like ISA-only PCs), so I'll quote one of the commit messages here:
Another goal I have in the future is to support the QEMU |
1a816d7
to
aa1e88c
Compare
A "wild" idea that was suggested by @boricj on the discord server today is to write support for FDT (Flattened Device Tree) and use it together with the ISA-PC machine type (this could be supplied as boot module from the multiboot bootloader) to know which devices exist in such environment. This in theory provide great platform to expand for other architectures which rely on FDTs instead of ACPI. |
24fb849
to
0c9ea4b
Compare
Making this a draft as I tested this with #11368 and a couple of problems were discovered when I tried it together. |
bdcc410
to
dab958e
Compare
Ready for review again :) |
Apparently adding support to run the |
|
This change allow the user to request the kernel to not use any PCI resources/devices at all. Also, don't try to initialize devices that rely on PCI if disabled.
To declare that we don't have a PCI bus in the system we do two things: 1. Probe IO ports before enabling access - In case we are using the QEMU ISA-PC machine type, IO probing results in floating bus condition (returning 0xFF values), thus, we know we don't have PCI bus on the system. 2. Allow the user to specify to not use the PCI bus at all in the kernel commandline.
Reading from /proc/pci assumes we have PCI enabled and also enumerated. However, if PCI is disabled for some reason, we can't allow the user to read from it as there's no valuable data we can supply.
If there's no PCI bus, then it's safe to assume that the x86 machine we run on supports VGA text mode console output with an ISA VGA adapter. If this is the case, we just instantiate a ISAVGAAdapter object that assumes this situation and allows us to boot into VGA text mode console.
If there's no PCI bus, then it's safe to assume that we run on a x86 machine that has an ISA IDE controller in the system. In such case, we just instantiate a ISAIDEController object that assumes fixed locations of IDE IO ports.
The ISA-PC machine type provides no PCI bus support, no IOAPIC support and other modern PC features of our generation. This is mainly a good environment for testing abstractions in the kernel space, and can help with improving on them for the sake of porting the OS to other chipsets and CPU architectures.
The microvm machine type is a modern tool for kernel and firmware developers to test their software against features like FDTs, second IOAPIC, lack of legacy devices by default, the ability of using PCIe without using PCI x86 IO ports, etc. We can boot into such machine but we are limited in the functionality we support currently for this type of virtual machine.
3b93e42
to
6f6b816
Compare
Rebased to solve the merge conflict. |
This PR sets a goal to create basic abstractions in the kernel to allow us to boot SerenityOS on a pure ISA-PC machine type.