qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-discuss] Why is QEMU disk geometry limited to 16 heads


From: Jakob Bohm
Subject: Re: [Qemu-discuss] Why is QEMU disk geometry limited to 16 heads
Date: Fri, 10 Apr 2015 19:47:25 +0200
User-agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

On 10/04/2015 19:11, Dmitry Grigoryev wrote:
Hello,

I have a disk image which won't run with QEMU. Its CHS formula is 510,255,63 isn't recognized automatically, and whenever I specify -drive file=image.raw,cyls=510,heads=255,secs=63 QEMU exits saying "invalid physical heads number".

Is there a reason why head count above 16 isn't supported? Is there a workaround to make my image usable by QEMU without losing the data?

PC historic fact: The ATA hard disk interface (electrical/register programming) is limited to max 16384 cyls, 16 heads, 63 sectors in CHS mode, 16Mi (16 binary millions)  sectors in LBA24 mode and 256Ti (16 binary Terra) sectors in LBA48 mode.  The historic BIOS INT 13h Hard disk API is limited to 1024 cyls, 255 heads, 63 sectors in CHS mode, and a lot (I guess 2**64) of sectors in LBA mode.  The historic BIOS INT 13h Floppy disk API was limited to 256 cyls, 255 heads, 255 sectors but only supported devices with 1 or 2 heads.

So whenever a PC BIOS (such as the SeaBios used in qemu PC-style virtual machines) is accessing an ATA disk > 1024 cylinders, it converts the number of cylinders and heads to a different multiplum such as 510 * 255 * 63 rather than the 8129 * 16 * 63 ATA CHS geometry or 8193150 ATA LBA24 sectors presented by the signals on the ATA cable.

Because qemu settings specify the virtual hardware, not the virtual BIOS, the CHS settings passed to qemu should be the "hardware" 8129 * 16 * 63 or just let qemu use the default for the number of LBA sectors in your image file.  Then the SeaBios inside the virtual machine will return that as 510 * 255 * 63 to the boot loader etc. for the few moments before those programs start talking to the "hardware" directly.

Enjoy

Jakob
-- 
Jakob Bohm, CIO, Partner, WiseMo A/S.  https://www.wisemo.com
Transformervej 29, 2860 Søborg, Denmark.  Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]