X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=src%2Framdisk.c;h=bae30e213d419f25bb36aee6a938341512ef9ee5;hb=refs%2Fheads%2Fcoreboot;hp=01648402b0e159e4f8cb7d0461e608092a49d5b4;hpb=575ffc8fd1127e3cb8fbb7f587cadfa85eb9b73d;p=seabios.git diff --git a/src/ramdisk.c b/src/ramdisk.c index 0164840..bae30e2 100644 --- a/src/ramdisk.c +++ b/src/ramdisk.c @@ -9,19 +9,21 @@ #include "memmap.h" // add_e820 #include "biosvar.h" // GET_GLOBAL #include "bregs.h" // struct bregs +#include "boot.h" // boot_add_floppy void ramdisk_setup(void) { - if (!CONFIG_COREBOOT_FLASH || !CONFIG_FLASH_FLOPPY) + if (!CONFIG_COREBOOT || !CONFIG_COREBOOT_FLASH || !CONFIG_FLASH_FLOPPY) return; // Find image. struct cbfs_file *file = cbfs_findprefix("floppyimg/", NULL); if (!file) return; + const char *filename = cbfs_filename(file); u32 size = cbfs_datasize(file); - dprintf(3, "Found floppy file %s of size %d\n", cbfs_filename(file), size); + dprintf(3, "Found floppy file %s of size %d\n", filename, size); int ftype = find_floppy_type(size); if (ftype < 0) { dprintf(3, "No floppy type found for ramdisk size\n"); @@ -40,10 +42,13 @@ ramdisk_setup(void) cbfs_copyfile(file, pos, size); // Setup driver. - dprintf(1, "Mapping CBFS floppy %s to addr %p\n", cbfs_filename(file), pos); - struct drive_s *drive_g = addFloppy((u32)pos, ftype, DTYPE_RAMDISK); + struct drive_s *drive_g = init_floppy((u32)pos, ftype); if (!drive_g) - strtcpy(drive_g->desc, cbfs_filename(file), MAXDESCSIZE); + return; + drive_g->type = DTYPE_RAMDISK; + dprintf(1, "Mapping CBFS floppy %s to addr %p\n", filename, pos); + char *desc = znprintf(MAXDESCSIZE, "Ramdisk [%s]", &filename[10]); + boot_add_floppy(drive_g, desc, bootprio_find_named_rom(filename, 0)); } static int @@ -81,7 +86,7 @@ ramdisk_copy(struct disk_op_s *op, int iswrite) int process_ramdisk_op(struct disk_op_s *op) { - if (!CONFIG_COREBOOT_FLASH || !CONFIG_FLASH_FLOPPY) + if (!CONFIG_COREBOOT || !CONFIG_COREBOOT_FLASH || !CONFIG_FLASH_FLOPPY) return 0; switch (op->command) {