From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KRPFI-0002Hm-Sx for mharc-grub-devel@gnu.org; Fri, 08 Aug 2008 06:30:57 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KRPFC-0002Fx-Am for grub-devel@gnu.org; Fri, 08 Aug 2008 06:30:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KRPF7-0002F0-L7 for grub-devel@gnu.org; Fri, 08 Aug 2008 06:30:47 -0400 Received: from [199.232.76.173] (port=39187 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KRPF6-0002Ej-5o for grub-devel@gnu.org; Fri, 08 Aug 2008 06:30:44 -0400 Received: from ti-out-0910.google.com ([209.85.142.191]:13693) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KRPF6-0000fx-5J for grub-devel@gnu.org; Fri, 08 Aug 2008 06:30:44 -0400 Received: by ti-out-0910.google.com with SMTP id u5so467009tia.10 for ; Fri, 08 Aug 2008 03:30:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=fZIDsNydCmdHLd4gn8eFFf9Lunf1xleVUBr4xMTiWvg=; b=cb/MLL9bgUtzrT/HoVHnQKB7yfsZ18l4hCdeB/2PaHecFBzJIoWbzJAMvUkK9hnZUe KOilRrwbYtI2thXsCrInzWJzlLFsi2a4/bSSADQK+IUPvCdYWE9sbI6jYltJV24nvaL3 ST8c0kGvtF9EPBn9qLWOMUYqwo0mmXCiuPAFM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=Qdvi6kVVzY4taO8zGGMC9ctSgpdjtnKD2IAUlfeqdKITA9DS/TCKxP2rHu7zaNBECJ kVy1pRPyJWH9yNM3h229vDoSlaxTM+OPji8eU7N0Ua2gvfKjO94KAs/37FG2oDm2iLaY ccGFrynEkYkAwWyOrJQ7robC6i2JxF1wenq5k= Received: by 10.110.109.12 with SMTP id h12mr5513509tic.34.1218191441350; Fri, 08 Aug 2008 03:30:41 -0700 (PDT) Received: by 10.110.16.5 with HTTP; Fri, 8 Aug 2008 03:30:41 -0700 (PDT) Message-ID: Date: Fri, 8 Aug 2008 18:30:41 +0800 From: Bean To: "The development of GRUB 2" In-Reply-To: <675279.90397.qm@web31601.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <675279.90397.qm@web31601.mail.mud.yahoo.com> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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: Fri, 08 Aug 2008 10:30:52 -0000 On Fri, Aug 8, 2008 at 2:50 PM, Viswesh S 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