All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: i386/pc/chainloader.c fails with syntax like chainloader (hd1, msdos1)+1
Date: Fri, 21 Jun 2013 13:48:38 +0200	[thread overview]
Message-ID: <51C43D96.2010201@gmail.com> (raw)
In-Reply-To: <CAOx4COVgfbdjQnJzNOPmkfJq_Mk+EodqOWrsBt-B7T55kp7acw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1490 bytes --]

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



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 291 bytes --]

  reply	other threads:[~2013-06-21 11:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-21  9:23 i386/pc/chainloader.c fails with syntax like chainloader (hd1, msdos1)+1 Michael Chang
2013-06-21 11:48 ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2013-06-23 10:43   ` Michael Chang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51C43D96.2010201@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.