[SeaBIOS] [PATCH] ramdisk: Allow ramdisk support (CONFIG_FLASH_FLOPPY) under QEMU

Kevin O'Connor kevin at koconnor.net
Thu Jul 23 15:24:39 CEST 2015


Don't require coreboot to use CONFIG_FLASH_FLOPPY - with the latest
QEMU, it's possible to place a floppy image into fw_cfg using the qemu
command line (eg, "-fw_cfg name=floppyimg/MyFloppy,file=file.img").

Signed-off-by: Kevin O'Connor <kevin at koconnor.net>
---
 src/Kconfig      | 13 +++++++------
 src/hw/ramdisk.c |  2 +-
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/Kconfig b/src/Kconfig
index b14e554..d70624e 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -96,12 +96,6 @@ endchoice
             the CBFS filesystem is at a non-standard location (eg,
             0xffe00000 if CBFS ends 2Meg below the end of flash).
 
-    config FLASH_FLOPPY
-        depends on COREBOOT_FLASH
-        bool "Floppy images in CBFS"
-        default y
-        help
-            Support floppy images in coreboot flash.
     config MULTIBOOT
         depends on COREBOOT
         bool "multiboot support"
@@ -220,6 +214,13 @@ menu "Hardware support"
         default y
         help
             Support floppy drive access.
+    config FLASH_FLOPPY
+        depends on DRIVES
+        bool "Floppy images from CBFS or fw_cfg"
+        default y
+        help
+            Support floppy images stored in coreboot flash or from
+            QEMU fw_cfg.
 
     config PS2PORT
         depends on KEYBOARD || MOUSE
diff --git a/src/hw/ramdisk.c b/src/hw/ramdisk.c
index e847824..4cdf95f 100644
--- a/src/hw/ramdisk.c
+++ b/src/hw/ramdisk.c
@@ -53,7 +53,7 @@ ramdisk_setup(void)
     if (!drive)
         return;
     drive->type = DTYPE_RAMDISK;
-    dprintf(1, "Mapping CBFS floppy %s to addr %p\n", filename, pos);
+    dprintf(1, "Mapping floppy %s to addr %p\n", filename, pos);
     char *desc = znprintf(MAXDESCSIZE, "Ramdisk [%s]", &filename[10]);
     boot_add_floppy(drive, desc, bootprio_find_named_rom(filename, 0));
 }
-- 
1.9.3




More information about the SeaBIOS mailing list