ao486: do not set HDD info if not mounted.

This commit is contained in:
sorgelig
2018-04-26 03:33:01 +08:00
parent e66c8f1e5c
commit b78352c194

View File

@@ -350,8 +350,8 @@ static int hdd_set(uint32_t num)
hdd[num].hd_total_sectors = 0; hdd[num].hd_total_sectors = 0;
hdd[num].present = img_mount(hdd[num].type, hdd[num].name); hdd[num].present = img_mount(hdd[num].type, hdd[num].name);
if (hdd[num].present) if (!hdd[num].present) return 0;
{
hdd[num].hd_heads = 16; hdd[num].hd_heads = 16;
hdd[num].hd_spt = 63; hdd[num].hd_spt = 63;
hdd[num].hd_cylinders = get_image(hdd[num].type)->size / (hdd[num].hd_heads * hdd[num].hd_spt * 512); hdd[num].hd_cylinders = get_image(hdd[num].type)->size / (hdd[num].hd_heads * hdd[num].hd_spt * 512);
@@ -359,7 +359,6 @@ static int hdd_set(uint32_t num)
//Maximum 8GB images are supported. //Maximum 8GB images are supported.
if (hdd[num].hd_cylinders > 16383) hdd[num].hd_cylinders = 16383; if (hdd[num].hd_cylinders > 16383) hdd[num].hd_cylinders = 16383;
hdd[num].hd_total_sectors = hdd[num].hd_spt*hdd[num].hd_heads*hdd[num].hd_cylinders; hdd[num].hd_total_sectors = hdd[num].hd_spt*hdd[num].hd_heads*hdd[num].hd_cylinders;
}
/* /*
0x00.[31:0]: identify write 0x00.[31:0]: identify write