SeaBIOS can be used for booting legacy OS and also Linux is still using
CMOS address 0x10 to configure floppy controller. Under these assumptions
it makes sense to allow boot from CMOS defined floppy drives.

Signed-off-by: Petr Cvek <petrcve...@gmail.com>
---
 src/Kconfig     | 7 +++++++
 src/hw/floppy.c | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/Kconfig b/src/Kconfig
index 3a8ffa1..42b9614 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -227,6 +227,13 @@ menu "Hardware support"
         default y
         help
             Support floppy drive access.
+    config LEGACY_FLOPPY
+        depends on FLOPPY && COREBOOT
+        bool "Get floppy type from CMOS"
+        default n
+        help
+            Support boot from CMOS defined floppy. Used by legacy OSes
+            on IBM PC compatible machine under coreboot.
     config FLASH_FLOPPY
         depends on DRIVES
         bool "Floppy images from CBFS or fw_cfg"
diff --git a/src/hw/floppy.c b/src/hw/floppy.c
index 9e6647d..40af360 100644
--- a/src/hw/floppy.c
+++ b/src/hw/floppy.c
@@ -155,7 +155,7 @@ floppy_setup(void)
         return;
     dprintf(3, "init floppy drives\n");
 
-    if (CONFIG_QEMU) {
+    if (CONFIG_QEMU || CONFIG_LEGACY_FLOPPY) {
         u8 type = rtc_read(CMOS_FLOPPY_DRIVE_TYPE);
         if (type & 0xf0)
             addFloppy(0, type >> 4);
-- 
2.37.0

_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-le...@seabios.org

Reply via email to