[syslinux] com32 fswrite to filesystem

H. Peter Anvin hpa at zytor.com
Fri Mar 12 12:13:58 PST 2010


On 03/11/2010 03:56 PM, Don Hiatt wrote:
> On Thu, Mar 11, 2010 at 9:25 AM, Gene Cumm <gene.cumm at gmail.com> wrote:
>> I'm pretty sure this was discussed previously on the list.
>>
> I think this is it: http://syslinux.zytor.com/archives/2008-October/011034.html
>     "I really dislike the idea of write operations; it's way too easy to
>      trash filesystems when encountering semi-broken firmware.
> 	-hpa"
> 
> HPA: Is this still your stance? Even if write was supported only on
> "whitelisted" BIOS (e.g. BIOS that have been confirmed to be non-broken)?
> 

No, that really isn't practical.  The number of combinations which could
get screwed up is literally astronomical.  Consider the case where the
filesystem is on a RAID-1, for example -- proper writing means having to
find all the members and write to them, *and* manage the RAID metadata
properly.  This is possible (at least in the Syslinux 4 codebase), but
it is a huge amount of code and it would be hard to test and verify that
it doesn't cause breakage.

Similarly, to write to a journalled filesystem you have to be aware of
the journal, which may not even be on the same *type* of medium...
consider the case where the journal is in NVRAM or in flash that the
BIOS doesn't even know about.  Yes, people do these things, and when
you're dealing with writes, screwups have catastrophic consequences.

For very small pieces of data, like a text string, we have the ADV,
which is specifically structured to be low risk.  For large pieces of
data, if you know your environment is safe to write to, you might be
able to use a filesystem access library like libext2, libfat, etc...
although that might interfere with caching in the core (perhaps we need
a flush cache API call.)

	-hpa




More information about the Syslinux mailing list