From 51e9fdebeacedb29844ebe47ce5109c1da0093ad Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Mon, 17 May 2021 20:56:27 +0300 Subject: [PATCH] Kernel: Add support for QEMU's emulated pci serial (-pci-serial option) --- Kernel/Devices/PCISerialDevice.h | 7 +++++-- Kernel/PCI/IDs.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Kernel/Devices/PCISerialDevice.h b/Kernel/Devices/PCISerialDevice.h index 61f1e32afb..f2f7206cba 100644 --- a/Kernel/Devices/PCISerialDevice.h +++ b/Kernel/Devices/PCISerialDevice.h @@ -31,8 +31,11 @@ private: SerialDevice::Baud baud_rate { SerialDevice::Baud::Baud38400 }; }; - static constexpr BoardDefinition board_definitions[1] = { - { { (u16)PCIVendorID::WCH, 0x3253 }, "WCH CH382 2S", 2, 0, 0xC0, 8, SerialDevice::Baud::Baud115200 } + static constexpr BoardDefinition board_definitions[4] = { + { { (u16)PCIVendorID::WCH, 0x3253 }, "WCH CH382 2S", 2, 0, 0xC0, 8, SerialDevice::Baud::Baud115200 }, + { { (u16)PCIVendorID::RedHat, 0x0002 }, "QEMU PCI 16550A", 1, 0, 0, 8, SerialDevice::Baud::Baud115200 }, + { { (u16)PCIVendorID::RedHat, 0x0003 }, "QEMU PCI Dual-port 16550A", 2, 0, 0, 8, SerialDevice::Baud::Baud115200 }, + { { (u16)PCIVendorID::RedHat, 0x0004 }, "QEMU PCI Quad-port 16550A", 4, 0, 0, 8, SerialDevice::Baud::Baud115200 } }; }; diff --git a/Kernel/PCI/IDs.h b/Kernel/PCI/IDs.h index ad55269073..52a7d80b8b 100644 --- a/Kernel/PCI/IDs.h +++ b/Kernel/PCI/IDs.h @@ -12,6 +12,7 @@ enum class PCIVendorID { VirtIO = 0x1af4, Intel = 0x8086, WCH = 0x1c00, + RedHat = 0x1b36 }; enum class PCIDeviceID {