memdisk: pptr->cd_pkt.sect_count is in virtual sectors
authorH. Peter Anvin <hpa@zytor.com>
Fri, 20 Nov 2009 04:17:43 +0000 (20:17 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Fri, 20 Nov 2009 04:17:43 +0000 (20:17 -0800)
Per the El Torito spec, pptr->cd_pkt.sect_count are in virtual
sectors, i.e. 512-byte sectors.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
memdisk/setup.c

index 5a45f39..db986fa 100644 (file)
@@ -1032,7 +1032,7 @@ void setup(const struct real_mode_args *rm_args_ptr)
        pptr->cd_pkt.start = boot_cat->initial_entry.load_block;
        boot_seg = pptr->cd_pkt.load_seg = boot_cat->initial_entry.load_seg;
        pptr->cd_pkt.sect_count = boot_cat->initial_entry.sect_count;
-       boot_len = pptr->cd_pkt.sect_count * 2048;
+       boot_len = pptr->cd_pkt.sect_count * 512;
        pptr->cd_pkt.geom1 = (uint8_t)(pptr->cylinders) & 0xFF;
        pptr->cd_pkt.geom2 =
            (uint8_t)(pptr->sectors) | (uint8_t)((pptr->cylinders >> 2) & 0xC0);