qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PULL 48/49] i386: populate floppy drive information in


From: John Snow
Subject: Re: [Qemu-devel] [PULL 48/49] i386: populate floppy drive information in DSDT
Date: Wed, 10 Feb 2016 16:54:30 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0


On 02/10/2016 12:33 PM, Roman Kagan wrote:
> On Wed, Feb 10, 2016 at 12:16:32PM -0500, John Snow wrote:
>> On 02/10/2016 12:10 PM, Roman Kagan wrote:
>>> Well, as I wrote in another mail, SeaBIOS, which is supposed to provide
>>> the same information to int 0x13/0x08, populates it with static data
>>> based only on the drive type as encoded in CMOS at initialization time,
>>> and everyone seem to have been fine with that so far.  I'll need to
>>> re-test it with real Windows guests, though.
>>>
>>
>> OK, but what we appear to be doing currently is polling the current
>> geometry values for a drive instead of some pre-chosen ones based on the
>> drive type.
>>
>> What values does SeaBIOS use? (Can you point me to the table it uses?)
> 
> src/hw/floppy.c:
> 
> struct floppyinfo_s FloppyInfo[] VARFSEG = {
>     // Unknown
>     { {0, 0, 0}, 0x00, 0x00},
>     // 1 - 360KB, 5.25" - 2 heads, 40 tracks, 9 sectors
>     { {2, 40, 9}, FLOPPY_SIZE_525, FLOPPY_RATE_300K},
>     // 2 - 1.2MB, 5.25" - 2 heads, 80 tracks, 15 sectors
>     { {2, 80, 15}, FLOPPY_SIZE_525, FLOPPY_RATE_500K},
>     // 3 - 720KB, 3.5"  - 2 heads, 80 tracks, 9 sectors
>     { {2, 80, 9}, FLOPPY_SIZE_350, FLOPPY_RATE_250K},
>     // 4 - 1.44MB, 3.5" - 2 heads, 80 tracks, 18 sectors
>     { {2, 80, 18}, FLOPPY_SIZE_350, FLOPPY_RATE_500K},
>     // 5 - 2.88MB, 3.5" - 2 heads, 80 tracks, 36 sectors
>     { {2, 80, 36}, FLOPPY_SIZE_350, FLOPPY_RATE_1M},
>     // 6 - 160k, 5.25"  - 1 heads, 40 tracks, 8 sectors
>     { {1, 40, 8}, FLOPPY_SIZE_525, FLOPPY_RATE_250K},
>     // 7 - 180k, 5.25"  - 1 heads, 40 tracks, 9 sectors
>     { {1, 40, 9}, FLOPPY_SIZE_525, FLOPPY_RATE_300K},
>     // 8 - 320k, 5.25"  - 2 heads, 40 tracks, 8 sectors
>     { {2, 40, 8}, FLOPPY_SIZE_525, FLOPPY_RATE_250K},
> };
> 
> The array is indexed by the floppy drive type from CMOS
> 
> Roman.
> 

Hm, thanks. These seem like sane geometries, but looking at the QEMU
geometry table ... I'm not sure what these even mean anymore, or what it
might mean when they don't align with the SeaBIOS values. We probably
don't even try very often. Maybe nobody ever has.

    { FLOPPY_DRIVE_TYPE_288, 36, 80, 1, FDRIVE_RATE_1M, }, // 5760
    { FLOPPY_DRIVE_TYPE_288, 39, 80, 1, FDRIVE_RATE_1M, }, // 6240
    { FLOPPY_DRIVE_TYPE_288, 40, 80, 1, FDRIVE_RATE_1M, }, // 6400
    { FLOPPY_DRIVE_TYPE_288, 44, 80, 1, FDRIVE_RATE_1M, }, // 7040
    { FLOPPY_DRIVE_TYPE_288, 48, 80, 1, FDRIVE_RATE_1M, }, // 7680

If sectors are 512 bytes, the byte size of these diskettes range from
2.813 MiB (or 2.99 Mb; I just today discovered the only way to get an
even 2.88 is to count this as ((36 * 80 * 2) * 512 / 1000 / 1024), which
mixes x^2 and x^10 designations) up through a whopping 3.74MiB/"3.84MB"

QEMU seems to try to support some real funky formats. Not even really
sure where Fabrice got these numbers from.

Sigh, as long as things sort of seem to work. I'm not going to invest
any further effort into figuring out exactly what we should be doing. If
the UEFI guests are working I'm happy if you are.

--js



reply via email to

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