Clément Chigot <[email protected]> writes:

> On Fri, Oct 24, 2025 at 10:35 AM Markus Armbruster <[email protected]> wrote:
>>
>> Kevin Wolf <[email protected]> writes:
>>
>> > Am 03.09.2025 um 09:57 hat Clément Chigot geschrieben:
>> >> This allows more flexibility to vvfat backend. The value for "Number of
>> >> Heads" and "Sectors per track" are based on SD specifications Part 2.
>>
>> This is too terse to remind me of how vvfat picks cylinders, heads, and
>> sectors before this patch, so I need to go dig through the source code.
>> I figure it depends on configuration parameters @floppy and @fat-type
>> like this:
>>
>>     floppy  fat-type    cyls heads secs   cyls*heads*secs*512
>>     false      12         64    16   63         31.5 MiB
>>     false      16       1024    16   63        504   MiB
>>     false      32       1024    16   63        504   MiB
>>     true       12         80     2   18       1440   KiB
>>     true       16         80     2   36       2880   KiB
>>     true       32         80     2   36       2880   KiB
>>
>> How exactly does the new parameter @size change this?
>
> My prime goal was to create a 256 Mib VVFAT disk. As you can see,
> today for hard-disks there are only two possibilities: 31.5 Mib or 504
> Mib. Hence, I've introduced the option `size=xxx` to allow more
> granular choices.
> This option changes how cyls, heads and secs parameters are computed
> to be as closed as possible of its value.
>
> I did try to keep it simple. I could have introduced options to select
> cylinders, heads, etc. But I think "size=xxx" would be more intuitive.
> There are also approximations made, as not all sizes can be reached. I
> didn't add errors or warnings for them. I'm fine adding them.

I don't have an opinion on whether we should support more sizes and/or
provide full control over CHS geometry.

>> >> Some limitations remains, the size parameter is recognized only when
>> >> "format=vvfat" is passed. In particular, "format=raw,size=xxx" is
>> >> keeping the previously hardcoded value: 504MB for FAT16 and 32 MB for
>> >> FAT12. FAT32 has not been adjusted and thus still default to 504MB.
>>
>> 31.5MiB unless I'm mistaken.
>
> True, I will fix it.
>
>> I'm not sure what you're trying to convey in this paragraph.  As far as
>> I can tell, you're adding a @size parameter to vvfat, so of course it
>> doesn't affect raw.
>
> Yes, but AFAICT, `if=sd,format=raw` will result in vvfat backend being
> called. I didn't manage to make the new option work with
> `if=sd,format=raw,size=256Mb`. Thus, when the "size" option is not
> provided, I keep the previous value (those for your above comment).
> Hence this paragraph to mostly warn people about the current
> limitation.

Are you talking about -drive?

Complete examples, please.

I'm confused about the connection between SD (from if=sd here, and "SD
specification" above) and vvfat.  SD is a frontend.  vvfat is a backend.

[...]


Reply via email to