If we're booting a disk or partition, then error out if the loaded
sector doesn't have a boot sector signature, rather than the
otherwise-inevitable crash.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
}
}
+ if (!opt.loadfile) {
+ if (*(uint16_t *)((char *)boot_sector+boot_size-2) != 0xaa55) {
+ error("Boot sector signature not found (unbootable disk/partition?)\n");
+ goto bail;
+ }
+ }
+
if (partinfo) {
/* 0x7BE is the canonical place for the first partition entry. */
regs.esi.w[0] = 0x7be;