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.
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,
It's only 2KB more - the buffer could be shared.
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?
It isn't - I was just describing where one could get the memory. I'm not planning on implementing this.
There may come a point where drives require a bigger sector size. (SeaBIOS can also run on real hardware.) In that case, it may be necessary to add support - after all, one can't run old games if their computer doesn't boot. However, I think we can cross that bridge when we get to it.
-Kevin