grub-devel
[Top][All Lists]
Advanced

[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: Michael Chang
Subject: Re: i386/pc/chainloader.c fails with syntax like chainloader (hd1, msdos1)+1
Date: Sun, 23 Jun 2013 18:43:27 +0800

2013/6/21 Vladimir 'φ-coder/phcoder' Serbinenko <address@hidden>:
> 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.

Thanks to your explaination. I now realize what has happened.

Although it's sensible to me, but in syntax wise it would confuse
people if they map their experience from other commands to this one.
Not a big deal really, but will be great if could have some highlight
about this case in the documentation.

Thanks,
Michael

>>
>> 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
>>
>
>
>
> _______________________________________________
> Grub-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/grub-devel
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]