From: Viswesh S <viswesh_vichu@yahoo.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: Windows boot
Date: Sun, 10 Aug 2008 19:48:29 -0700 (PDT) [thread overview]
Message-ID: <332861.24819.qm@web31606.mail.mud.yahoo.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2852 bytes --]
----- Original Message ----
From: Bean <bean123ch@gmail.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Sent: Friday, 8 August, 2008 4:00:41 PM
Subject: Re: Windows boot
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.
Hi,
I tried the loadbin,according to the instructions which you had given in osdir.com
"
linux loadbin.bin
initrd ntldr
This method is not limited to grub2, it can also be used in boot
loaders which support the linux kernel format, such as
syslinux/lilo/grub.
To compile loadbin.bin, use the following commands:
gcc -nostdlib -DLOADBIN -Wl,-N -o lnxhdr lnxhdr.S
objcopy -O binary lnxhdr lnxhdr.bin
"
Are you sure, this is the procedure ? Dont we need to generate loadbin ?
Could you please confirm ?
Regards,
Viswesh
--
Bean
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel
Add more friends to your messenger and enjoy! Go to http://in.messenger.yahoo.com/invite/
[-- Attachment #2: Type: text/html, Size: 7190 bytes --]
next reply other threads:[~2008-08-11 2:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-11 2:48 Viswesh S [this message]
2008-08-11 4:15 ` Windows boot Bean
-- strict thread matches above, loose matches on Subject: below --
2008-08-08 6:50 Viswesh S
2008-08-08 10:30 ` 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=332861.24819.qm@web31606.mail.mud.yahoo.com \
--to=viswesh_vichu@yahoo.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.