From a4d70aa537a48fd6ab645435be94246c4e41a2e7 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 9 Aug 2009 11:32:00 -0400 Subject: [PATCH] Use regular CD reading to load initial CDROM boot image. 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cdrom.c b/src/cdrom.c index 8f9e7d0..8ccbeea 100644 --- a/src/cdrom.c +++ b/src/cdrom.c @@ -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; -- 2.39.5