El dom, 31-05-2009 a las 13:36 +0200, Vladimir 'phcoder' Serbinenko escribió: > 2009/5/31 Javier Martín <lordhab...@gmail.com>: > > El sáb, 30-05-2009 a las 17:28 +0200, Vladimir 'phcoder' Serbinenko > > escribió: > > Put it that way, I agree with your change. To the scrapper with > > parse_biosdisk then! > Sorry, I didn't mean to upset you. Here is a patch to do it You did not upset me at all! I'm sorry if I seemed rude or hostile. I truly meant to give you a go-ahead at scrapping that code.
> Good luck with your exams Thank you very much, I'll need it. > > Doing some tests I discovered that freedos MBR (but not the > bootsector) relies on %dl being preserved across int 0x13. In the > patch you can see additional hassle to preserve %dx. Do not do this. Some BIOS functions (like ah=08h) return data in dl. Clients should not expect data in registers to be preserved across interrupt calls. I don't know if there is something like a 8086/PC-BIOS ABI document that we can find to confirm the non-preservation of dl, but the FreeDOS MBR should be fixed then. > Another problem I discovered is that %dl (chainloader) and bootdrive > (multiboot) passed to payload is out of sync. > Does anyone has a suggestion how to do it cleanly. The problems are: > -chainloader/multiboot shouldn't depend on biosdisk if possible > -%dl should be set accordingly to mapping > -%dl should be correct even if grub2 uses its own drivers (now it's > set to nonsense) > I have some ideas on this subject but would like to hear what others think. I managed to get the right %dl passed with the following procedure: let's say I want to boot FreeDOS on hd1, but I will drivemap it so that it will become hd0. Instead of doing this: root=(hd1,1) drivemap -s (hd0) (hd1) chainloader +1 I do the following: root=(hd0) drivemap -s (hd0) (hd1) chainloader (hd1,1)+1 This gets the right number into %dl (I have not checked multiboot), but I acknowledge that it's nothing more than a hack. I cannot see a way for drivemap to access that data and modify it according to the mappings without breaking modularity with multiboot and chainloader (and what about other loaders?). Regarding grub2 using its own drivers, we have no reliable way of conclusively saying that (ata2)==(hd1), so we'd better say nothing at all and keep dl=ffh as we do currently. -- -- Lazy, Oblivious, Recurrent Disaster -- Habbit
signature.asc
Description: Esto es una parte de mensaje firmado digitalmente
_______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel