On Tue, Jun 05, 2018 at 06:09:54PM +0300, Nikolay Ivanets wrote:
As far as I know, QEMU should be able to tell SeaBIOS the exact geometry to use (eg, via qemu -hdachs c,h,s[,t] option). If you're not getting the expected behavior, be sure to include the seabios log file - see: https://www.seabios.org/Debugging
Here is geometry when I have with patched bios (Windows boot): drive 0x000f57f0: PCHS=16383/16/63 translation=lba LCHS=1024/255/32 s=143305920
Here is geometry I have with original Seabios (boot fails): drive 0x000f0bd0: PCHS=16383/16/63 translation=lba LCHS=1024/255/63 s=143305920
Qemu limits what we can specify in CHS to 16383, 16 and 63 respectively and I don't see any combinations which will perform necessary translation from PCHS=16383/16/63 to LCHS=1024/255/32.
If I understand it correctly, you're looking for LCHS=1024/255/32. I don't know why QEMU wont let you specify heads=255, but short of doing that, I don't see a way for SeaBIOS to obtain that logical mapping.
The disk geometry translation stuff is arcane - the SeaBIOS code is translated from the original Bochs bios code. If it needs to be enhanced, it would require both a qemu patch (to specify the desired translation/geometry) and a seabios patch (to implement it).
-Kevin
Kevin O'Connor kevin@koconnor.net wrote:
If I understand it correctly, you're looking for LCHS=1024/255/32. I don't know why QEMU wont let you specify heads=255, but short of doing that, I don't see a way for SeaBIOS to obtain that logical mapping.
The disk geometry translation stuff is arcane - the SeaBIOS code is translated from the original Bochs bios code. If it needs to be enhanced, it would require both a qemu patch (to specify the desired translation/geometry) and a seabios patch (to implement it).
-Kevin
Kevin,
Why is QEMU disk geometry limited to 16 heads: https://lists.gnu.org/archive/html/qemu-discuss/2015-04/msg00019.html Here is similar discussion about disk image required 32 sectors/track: https://lists.gnu.org/archive/html/qemu-devel/2008-06/msg00380.html
The problem is that Qemu takes total number of sectors (based on disk size) and reports maximum allowed PCHS=16383/16/63 which Seabios cannot translate to required LCHS=1024/255/32 under no circumstances because 63 sectors/track is hardcoded. So Volume Boot Record cannot be loaded and thus, Operating System.
One more report for your reference: https://www.veritas.com/support/en_US/article.100006632
So it looks like such a disk images cannot be booted under Qemu + Seabios. I realize that it is impossible to make a BIOS to automatically adopt translation to satisfy all use-cases. The only way I see is to provided an alternative build of Seabios where alternative No of sectors/track is used for translation instead of hard-coded value of 63. This might be configured via "make menuconfig" for example. I can work on this if you find it acceptable.
-- Mykola Ivanets