[SeaBIOS] [PATCH] fix two issues with virtio-blk

Gleb Natapov gleb at redhat.com
Sun May 16 10:10:45 CEST 2010


On Sat, May 15, 2010 at 10:08:54PM +0200, Sebastian Herbszt wrote:
> Kevin O'Connor wrote:
> >On Sat, May 15, 2010 at 05:17:31PM +0200, Sebastian Herbszt wrote:
> >>Doing a read emulation
> >>in BIOS shouldn't be too bad, but a write emulation will need a "physical
> >>sector size" RMW buffer (no clue where the BIOS could steal those 4KB from).
> >
> >SeaBIOS has a "malloc_low" function which obtains permanent memory in
> >the first 1Meg.  Currently, it grabs memory at the end of 640K (it
> >moves the ebda down if needed).  It's probably possible to use memory
> >in the c/d/e/f segments - though that's tricky because parts of that
> >area are likely to be read-only.
> >
> >Right now SeaBIOS allocates a 2K buffer to support cdrom emulation
> >(this is different from what bochs bios does).  So, going to a 4K
> >buffer is probably reasonable.
> >
> >-Kevin
> 
> This explains why i see 2 KB less free memory with SeaBIOS.
> With current SeaBIOS i get 511 KB free memory running MS-DOS 6.22
> with CDROM support. Sure you can grab another 4 KB for a RMW buffer,
> but sooner or later there won't be enough memory free to play your favorite
> game from the 90s. And i didn't even load an option ROM which also wants
> 1-2 KB EBDA or some useful TSR program.
> 
> Why is a 4 KB physical sector size needed in a VM anyway?
> 
Performance of course. Qemu today can advertise physical block size and
logical block size greater then 512 with virtio. The problem is that if
logical block size != 512 boot fails.

--
			Gleb.



More information about the SeaBIOS mailing list