From: Bean <bean123ch@gmail.com>
To: "The development of GRUB 2" <grub-devel@gnu.org>
Subject: Re: Windows boot
Date: Fri, 8 Aug 2008 18:30:41 +0800 [thread overview]
Message-ID: <ca0f59980808080330q504cafcag7d2ecd7dcf2a1f90@mail.gmail.com> (raw)
In-Reply-To: <675279.90397.qm@web31601.mail.mud.yahoo.com>
On Fri, Aug 8, 2008 at 2:50 PM, Viswesh S <viswesh_vichu@yahoo.com> wrote:
> Hi,
>
> Thanks,let me have a look at the chainloader command in grub2 and in legacy
> grub.
>
> Could you let me know the issue which you faced in the chainloader command.
Hi,
The problem is in loader/i386/pc/chainloader.c (grub_chainloader_cmd):
/* Obtain the partition table from the root device. */
dev = grub_device_open (0);
if (dev)
{
grub_disk_t disk = dev->disk;
if (disk)
{
grub_partition_t p = disk->partition;
/* In i386-pc, the id is equal to the BIOS drive number. */
drive = (int) disk->id;
if (p)
{
grub_disk_read (disk, p->offset, 446, 64,
(char *) GRUB_MEMORY_MACHINE_PART_TABLE_ADDR);
part_addr = (void *) (GRUB_MEMORY_MACHINE_PART_TABLE_ADDR
+ (p->index << 4));
}
}
grub_device_close (dev);
}
p->offset is the offset of the start of the partition, but actually,
we need to read the sector that contain the partition table, which is
the mbr for primary. But replace p->offset with 0 doesn't fix this, as
grub_disk_read is related to the beginning of partition, not the disk.
You need to use the low level api:
disk->dev->read (disk, 0, 1, (char *) GRUB_MEMORY_MACHINE_PART_TABLE_ADDR);
But this fix only apply to primary partition, for logical partition,
the partition table is not in mbr, and this quick patch doesn't work.
But I remember someone send a patch to allow for loading of syslinux
in logical partition, you can search the list if you're interested.
BTW, if this doesn't work, you can try loadbin. It can be used to
chainload ntldr/bootmgr directly.
--
Bean
next prev parent reply other threads:[~2008-08-08 10:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-08 6:50 Windows boot Viswesh S
2008-08-08 10:30 ` Bean [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-08-11 2:48 Viswesh S
2008-08-11 4:15 ` Bean
2008-08-08 6:22 Viswesh S
2008-08-08 6:40 ` Bean
2008-08-08 1:58 Viswesh S
2008-08-08 3:43 ` Bean
2008-08-07 14:30 Viswesh S
2008-08-07 22:26 ` Javier Martín
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=ca0f59980808080330q504cafcag7d2ecd7dcf2a1f90@mail.gmail.com \
--to=bean123ch@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.