I noticed that SeaBIOS fails to boot from virtio disk smaller than 512K. The attempt to access a disk fails at basic_access(). (cylinder >= nlc || head >= nlh || sector > nlspt) is true because nlc is zero. The problem seams to be in how SeaBIOS calculates lchs from pchs in get_translation(). Both QEMU and SeaBIOS fake disk geometry from real disk size, but it seams that they do it differently and when they disagree part of the disk may not be readable.
What would be the best way to fix that?
-- Gleb.