[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: i386/pc/chainloader.c fails with syntax like chainloader (hd1, msdos
From: |
Vladimir 'φ-coder/phcoder' Serbinenko |
Subject: |
Re: i386/pc/chainloader.c fails with syntax like chainloader (hd1, msdos1)+1 |
Date: |
Fri, 21 Jun 2013 13:48:38 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130518 Icedove/17.0.5 |
On 21.06.2013 11:23, Michael Chang wrote:
> Hi,
>
> The i386/pc/chainloader.c hangs when attempting to chainload other
> disk's boot sector (or mbr) with a syntax like this. Say if current
> environment setting root=hd0,msdos2.
>
> $ chainloader (hd1,msdos1)+1
>
> However doing it this way always works.
>
> $ set root=hd1,msdos1
> $ chainloader +1
>
> I suppose the first syntax is valid as it should override $root [1]
> thus two cases should have identical result. But looking into the
> chainloader source it seems that the $root is always used to obtain
> the boot drive number and partition table. So there's a discrepancy if
> root is not set to the chainloader device which is explicitly
> specified in file.
No, the behaviour you see is intended consider someone copying
bootsector from (hd1,1) to (hd0,2)/boot.bin. It can still be booted with:
root=hd1,1
chainloader (hd0,2)/boot.bin
The disk passed in %dl and where the sector is loaded from isn't
necessarily the same.
>
> The attached file fixes the problem for me, I'd like to contribute if
> you think this is a problem or how to improve the patch.
>
> [1] http://www.gnu.org/software/grub/manual/grub.html#root
> [2] http://www.gnu.org/software/grub/manual/grub.html#chainloader
>
> Thanks,
> Michael
>
>
>
> _______________________________________________
> Grub-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/grub-devel
>
signature.asc
Description: OpenPGP digital signature