+ else if ((lba * 2048) < g_chain->real_img_size_in_bytes)
+ {
+ /* fix for grub4dos Inconsistent data read from error */
+ memset((void *)(buffer + (count - 1) * 2048), 0, 2048);
+
+ count = (g_chain->real_img_size_in_bytes / 2048) - lba;
+ ventoy_vdisk_read_real(lba, count, buffer);
+ ix86->regs.dl = sandev->drive;
+
+ lba += count;
+ buffer += count * 2048;
+ count = (readend - g_chain->real_img_size_in_bytes) / 2048;
+ }
+
+ VirtSec = g_chain->virt_img_size_in_bytes / 2048;
+ if (lba + count > VirtSec)
+ {
+ count = VirtSec - lba;
+ }