From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KSNST-0003GR-0W for mharc-grub-devel@gnu.org; Sun, 10 Aug 2008 22:48:33 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KSNSR-0003EG-QT for grub-devel@gnu.org; Sun, 10 Aug 2008 22:48:31 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KSNSR-0003C3-0D for grub-devel@gnu.org; Sun, 10 Aug 2008 22:48:31 -0400 Received: from [199.232.76.173] (port=44713 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSNSQ-0003Bo-L4 for grub-devel@gnu.org; Sun, 10 Aug 2008 22:48:30 -0400 Received: from web31606.mail.mud.yahoo.com ([68.142.198.152]:26120) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1KSNSQ-0004DI-2q for grub-devel@gnu.org; Sun, 10 Aug 2008 22:48:30 -0400 Received: (qmail 25330 invoked by uid 60001); 11 Aug 2008 02:48:29 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=PQbn96k5UTblSqict49IJA59h5+Zo4ZTB4Bxuo8v3yPD0dg64UnuoEntVUv1OGycVswQ7J7ZVQGWrVXNkICw6cFFgkwKDyHYNtRjYJhSwNO0p6qHl4EAUImplNU2mMQjyDwFKpfOtToggsmQ95kAj63t3+ICc3DmJOPD9By5KTg=; Received: from [122.167.193.248] by web31606.mail.mud.yahoo.com via HTTP; Sun, 10 Aug 2008 19:48:29 PDT X-Mailer: YahooMailRC/1042.48 YahooMailWebService/0.7.218 Date: Sun, 10 Aug 2008 19:48:29 -0700 (PDT) From: Viswesh S To: The development of GRUB 2 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1624192340-1218422909=:24819" Message-ID: <332861.24819.qm@web31606.mail.mud.yahoo.com> X-detected-kernel: by monty-python.gnu.org: FreeBSD 6.x (1) Subject: Re: Windows boot X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2008 02:48:32 -0000 --0-1624192340-1218422909=:24819 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =0A=0A=0A=0A----- Original Message ----=0AFrom: Bean = =0ATo: The development of GRUB 2 =0ASent: Friday, 8 Aug= ust, 2008 4:00:41 PM=0ASubject: Re: Windows boot=0A=0AOn Fri, Aug 8, 2008 a= t 2:50 PM, Viswesh S wrote:=0A> Hi,=0A>=0A> Thank= s,let me have a look at the chainloader command in grub2 and in legacy=0A> = grub.=0A>=0A> Could you let me know the issue which you faced in the chainl= oader command.=0A=0AHi,=0A=0AThe problem is in loader/i386/pc/chainloader.c= (grub_chainloader_cmd):=0A=0A=C2=A0 /* Obtain the partition table from the= root device.=C2=A0 */=0A=C2=A0 dev =3D grub_device_open (0);=0A=C2=A0 if (= dev)=0A=C2=A0 =C2=A0 {=0A=C2=A0 =C2=A0 =C2=A0 grub_disk_t disk =3D dev->dis= k;=0A=0A=C2=A0 =C2=A0 =C2=A0 if (disk)=0A=C2=A0=C2=A0=C2=A0 {=0A=C2=A0=C2= =A0=C2=A0 =C2=A0 grub_partition_t p =3D disk->partition;=0A=C2=A0=C2=A0=C2= =A0 =0A=C2=A0=C2=A0=C2=A0 =C2=A0 /* In i386-pc, the id is equal to the BIOS= drive number.=C2=A0 */=0A=C2=A0=C2=A0=C2=A0 =C2=A0 drive =3D (int) disk->i= d;=0A=0A=C2=A0=C2=A0=C2=A0 =C2=A0 if (p)=0A=C2=A0=C2=A0=C2=A0 =C2=A0 =C2=A0= {=0A=C2=A0=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 grub_disk_read (disk, p->offse= t, 446, 64,=0A=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2= =A0 =C2=A0 =C2=A0 (char *) GRUB_MEMORY_MACHINE_PART_TABLE_ADDR);=0A=C2=A0= =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 part_addr =3D (void *) (GRUB_MEMORY_MACHI= NE_PART_TABLE_ADDR=0A=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0 =C2=A0 + (p->index << 4));=0A=C2=A0=C2=A0=C2= =A0 =C2=A0 =C2=A0 }=0A=C2=A0=C2=A0=C2=A0 }=0A=0A=C2=A0 =C2=A0 =C2=A0 grub_d= evice_close (dev);=0A=C2=A0 =C2=A0 }=0A=0Ap->offset is the offset of the st= art of the partition, but actually,=0Awe need to read the sector that conta= in the partition table, which is=0Athe mbr for primary. But replace p->offs= et with 0 doesn't fix this, as=0Agrub_disk_read is related to the beginning= of partition, not the disk.=0AYou need to use the low level api:=0A=0Adisk= ->dev->read (disk, 0, 1, (char *) GRUB_MEMORY_MACHINE_PART_TABLE_ADDR);=0A= =0ABut this fix only apply to primary partition, for logical partition,=0At= he partition table is not in mbr, and this quick patch doesn't work.=0ABut = I remember someone send a patch to allow for loading of syslinux=0Ain logic= al partition, you can search the list if you're interested.=0A=0ABTW, if th= is doesn't work, you can try loadbin. It can be used to=0Achainload ntldr/b= ootmgr directly.=0A=0AHi,=0AI tried the loadbin,according to the instructio= ns which you had given in osdir.com=0A" =0Alinux loadbin.bin=0Ainitrd ntldr= =0A=0AThis method is not limited to grub2, it can also be used in boot=0Alo= aders which support the linux kernel format, such as=0Asyslinux/lilo/grub.= =0A=0ATo compile loadbin.bin, use the following commands:=0A=0Agcc -nostdli= b -DLOADBIN -Wl,-N -o lnxhdr lnxhdr.S=0Aobjcopy -O binary lnxhdr lnxhdr.bin= =0A"=0AAre you sure, this is the procedure ? Dont we need to generate loadb= in ?=0ACould you please confirm ?=0ARegards,=0AViswesh=0A=0A-- =0ABean=0A= =0A=0A_______________________________________________=0AGrub-devel mailing = list=0AGrub-devel@gnu.org=0Ahttp://lists.gnu.org/mailman/listinfo/grub-deve= l=0A=0A=0A=0A Add more friends to your messenger and enjoy! Go to http= ://in.messenger.yahoo.com/invite/ --0-1624192340-1218422909=:24819 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

=0A

=0A
----- Original Message ----
From: Bean <b= ean123ch@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 <viswes= h_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 cha= inloader command.

Hi,

The problem is in loader/i386/pc/chainl= oader.c (grub_chainloader_cmd):

  /* Obtain the partition table= from the root device.  */
  dev =3D grub_device_open (0);
=   if (dev)
    {
      grub_disk_t disk= =3D dev->disk;

      if (disk)
    {
    &nbs= p; grub_partition_t p =3D disk->partition;
   
&nb= sp;     /* In i386-pc, the id is equal to the BIOS drive num= ber.  */
      drive =3D (int) disk->id;
=
      if (p)
        {<= BR>          grub_disk_read (disk, p->offs= et, 446, 64,
            &n= bsp;     (char *) GRUB_MEMORY_MACHINE_PART_TABLE_ADDR);
 =          part_addr =3D (void *) (GRUB_MEMORY_MACHI= NE_PART_TABLE_ADDR
          &nb= sp;         + (p->index << 4));
 =        }
    }

    &= nbsp; 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 prima= ry. 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 a= llow for loading of syslinux
in logical partition, you can search the li= st if you're interested.

BTW, if this doesn't work, you can try load= bin. It can be used to
chainload ntldr/bootmgr directly.
=0A&nbs= p;
=0A
 
=0A
 
=0A
Hi,
=0A
 
=0A