]> xenbits.xensource.com Git - seabios.git/commitdiff
Use regular CD reading to load initial CDROM boot image.
authorKevin O'Connor <kevin@koconnor.net>
Sun, 9 Aug 2009 15:32:00 +0000 (11:32 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Sun, 9 Aug 2009 15:32:00 +0000 (11:32 -0400)
Use cdrom_read() instead of cdrom_read_512() for loading the initial
    image.  The initial image will always start on a 2K block, and it
    should be okay to load extra sectors if the sector count doesn't
    end on a 2K boundary.

src/cdrom.c

index 8f9e7d0a45096a1e8d9856d3a2ece57948c88dce..8ccbeeab327e9626e418219080bfbb2e1d248301 100644 (file)
@@ -463,10 +463,10 @@ cdrom_boot(int cdid)
     SET_EBDA2(ebda_seg, cdemu.ilba, lba);
 
     // And we read the image in memory
-    dop.lba = lba * 4;
-    dop.count = nbsectors;
+    dop.lba = lba;
+    dop.count = DIV_ROUND_UP(nbsectors, 4);
     dop.buf_fl = MAKE_FLATPTR(boot_segment, 0);
-    ret = cdrom_read_512(&dop);
+    ret = cdrom_read(&dop);
     if (ret)
         return 12;