[SeaBIOS] [PATCHv2] add write support to virtio-blk

Kevin O'Connor kevin at koconnor.net
Sat Aug 21 22:15:34 CEST 2010

On Sat, Aug 21, 2010 at 11:02:54PM +0300, Gleb Natapov wrote:
> On Sat, Aug 21, 2010 at 03:12:32PM -0400, Kevin O'Connor wrote:
> > On Wed, Aug 18, 2010 at 05:46:20PM +0300, Gleb Natapov wrote:
> > > Windows XP does write to sector 0 during installation and prints
> > > mysterious error if write fails. Interestingly if write drops data,
> > > but returns OK to Windows installer installation proceed without
> > > complains and completes successfully.
> > [...]
> > > +    case CMD_FORMAT:
> > >          return DISK_RET_EWRITEPROTECT;
> > 
> > If CMD_WRITE is implemented, I think CMD_FORMAT should just return
> > DISK_RET_SUCCESS (as ata does).
> > 
> Can you explain why? What CMD_FORMAT is suppose to do? May be it is just
> a nop for virtio disk and returning success is much better in this case.

I believe format is supposed to write out the track info on floppy
disks and such.

The ata spec still has a format command in it - though I wouldn't be
surprised if modern drives didn't do anything when given that command.
(The SeaBIOS ATA code returns success on CMD_FORMAT - see

I'm not sure how calling code will react to getting a EWRITEPROTECT on
format but success on a write.  For consistency, I think it should
either succeed on both or fail on both.

I don't think we need to actually implement virtio format code - a nop
should be fine (just like what ata does).


More information about the SeaBIOS mailing list