mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:57:46 +00:00
Kernel: Add kernel command line flag to disable VirtIO support
This command line flag can be used to disable VirtIO support on certain configurations (native windows) where interfacing with virtio devices can cause qemu to freeze.
This commit is contained in:
parent
7dc95721ee
commit
aaf3d26dae
4 changed files with 12 additions and 0 deletions
|
@ -170,6 +170,11 @@ UNMAP_AFTER_INIT bool CommandLine::disable_uhci_controller() const
|
|||
return contains("disable_uhci_controller");
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT bool CommandLine::disable_virtio() const
|
||||
{
|
||||
return contains("disable_virtio");
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT AHCIResetMode CommandLine::ahci_reset_mode() const
|
||||
{
|
||||
const auto ahci_reset_mode = lookup("ahci_reset_mode").value_or("controller");
|
||||
|
|
|
@ -87,6 +87,7 @@ public:
|
|||
[[nodiscard]] bool disable_physical_storage() const;
|
||||
[[nodiscard]] bool disable_ps2_controller() const;
|
||||
[[nodiscard]] bool disable_uhci_controller() const;
|
||||
[[nodiscard]] bool disable_virtio() const;
|
||||
[[nodiscard]] AHCIResetMode ahci_reset_mode() const;
|
||||
[[nodiscard]] String userspace_init() const;
|
||||
[[nodiscard]] Vector<String> userspace_init_args() const;
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <Kernel/CommandLine.h>
|
||||
#include <Kernel/VirtIO/VirtIO.h>
|
||||
#include <Kernel/VirtIO/VirtIOConsole.h>
|
||||
#include <Kernel/VirtIO/VirtIORNG.h>
|
||||
|
@ -32,6 +33,8 @@ namespace Kernel {
|
|||
|
||||
void VirtIO::detect()
|
||||
{
|
||||
if (kernel_command_line().disable_virtio())
|
||||
return;
|
||||
PCI::enumerate([&](const PCI::Address& address, PCI::ID id) {
|
||||
if (address.is_null() || id.is_null())
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue