Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KyrZm-0000og-GQ for mharc-grub-devel@gnu.org; Sat, 08 Nov 2008 12:26:22 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KyrZk-0000lm-1U for grub-devel@gnu.org; Sat, 08 Nov 2008 12:26:20 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KyrZj-0000lJ-I7 for grub-devel@gnu.org; Sat, 08 Nov 2008 12:26:19 -0500 Received: from [199.232.76.173] (port=36447 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KyrZj-0000ky-9p for grub-devel@gnu.org; Sat, 08 Nov 2008 12:26:19 -0500 Received: from web31604.mail.mud.yahoo.com ([68.142.198.150]:42301) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1KyrZi-0003U3-UB for grub-devel@gnu.org; Sat, 08 Nov 2008 12:26:19 -0500 Received: (qmail 68127 invoked by uid 60001); 8 Nov 2008 17:26:15 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=mq3NAT+gFuBe6WHnFYGXSsdVSBn/27iJ8LsH6Ymxaiol43d1hIkMJTj65NT2rqcVX+VVut6EYbvctEm983ScAR6CHrblu/lrFNBD3eQoRt/yVLtyttRv/Y/eh7NyT1JhG6L1O5ZRWDA83zsy+vZh9yGrTlfO2IC2aHzan6mwLMs=; X-YMail-OSG: 2L5IFyIVM1lDY7Hvmre6_.zJuwlBGwEdlPs5gAskEHyfibuHpEzykmPmJaUQ24dJAc8e0McqE_aAI4qy7lfjHRSGiBiB2ILXs2RN.CE2SHHebhXUa2DlY_6Ahqmhi_UYkH5MiMENWa5U1Q1.1dmoOiQpS4gc6wR62zziJfkKWPru9BrCBOYsJMLRzf0- Received: from [122.167.192.39] by web31604.mail.mud.yahoo.com via HTTP; Sat, 08 Nov 2008 09:26:15 PST X-Mailer: YahooMailRC/1155.29 YahooMailWebService/0.7.260.1 Date: Sat, 8 Nov 2008 09:26:15 -0800 (PST) From: Viswesh S To: The development of GRUB 2 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Message-ID: <637281.67639.qm@web31604.mail.mud.yahoo.com> X-detected-operating-system: by monty-python.gnu.org: FreeBSD 6.x (1) Subject: Re: Windows,grub and grub2 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: Sat, 08 Nov 2008 17:26:20 -0000 Hi,=0A=0A=0A=0A----- Original Message ----=0A> From: Viswesh S =0A> To: The development of GRUB 2 =0A> Se= nt: Tuesday, 14 October, 2008 5:04:53 PM=0A> Subject: Re: Windows,grub and = grub2=0A> =0A> Hi,=0A> =0A> =0A> =0A> ----- Original Message ----=0A> > Fro= m: Bean =0A> > To: The development of GRUB 2 =0A> > Sent: Monday, 29 Septem= ber, 2008 4:20:57 PM=0A> > Subject: Re: Windows,grub and grub2=0A> > =0A> >= On Mon, Sep 29, 2008 at 1:18 PM, Viswesh S wrote:=0A> > > Hi,=0A> > >=0A> = > >=0A> > >=0A> > > ----- Original Message ----=0A> > >> From: Bean =0A> > = >> To: The development of GRUB 2 =0A> > >> Sent: Tuesday, 23 September, 200= 8 7:20:49 PM=0A> > >> Subject: Re: Windows,grub and grub2=0A> > >>=0A> > >>= On Tue, Sep 23, 2008 at 4:23 PM, Viswesh S wrote:=0A> > >> >=0A> > >> >=0A= > > >> >=0A> > >> >=0A> > >> > ----- Original Message ----=0A> > >> >> From= : Bean=0A> > >> >> To: The development of GRUB 2=0A> > >> >> Sent: Monday, = 22 September, 2008 9:10:26 AM=0A> > >> >> Subject: Re: Windows,grub and gru= b2=0A> > >> >>=0A> > >> >> On Tue, Sep 9, 2008 at 2:00 PM, Viswesh S wrote:= =0A> > >> >> > Below is the dump of screen output while chainloading the nt= fsnew =0A> file.=0A> > >> >> > ***************************************=0A> = > >> >> > DI=3DCFF0 SI=3D07EE BP=3D1FF0 SP=3D1FE8 BX=3D0000 DX=3D0000 CX=3D= 0000 AX=3D0000=0A> > >> >> > CS=3D0000 SS=3D0000 DS=3D0000 ES=3D0000 FG=3D0= 246 IP=3D7C57=0A> > >> >> >=0A> > >> >> > DI=3D7FF0 SI=3D07EE BP=3D1FF0 SP= =3D7BF4 BX=3D55AA DX=3D0000 CX=3D0000 AX=3D0100 =0A> CX=3D07C0=0A> > >> >> = > DS=3D07C0 ES=3D0000 FG=3D0007 IP=3D0082=0A> > >> >> > *******************= ***********************=0A> > >> >> > Could you please let me know the way = to disassemble the binary file =0A> > without=0A> > >> >> > any header.The = way in which you decoded the boot record.=0A> > >> >> >=0A> > >> >> > Also = one more thing to let you know is that,=0A> > >> >> >=0A> > >> >> > with th= e grub-1.96 ( without the chainloader patch of =0A> disk->dev->read() =0A> = > ) ,=0A> > >> >> > with windows2003 in partition 1 and linux in partition = 3, when we=0A> > >> chainload,=0A> > >> >> > if we look at the partition ta= ble passed to another bootloader ie =0A> > location=0A> > >> >> > 0x7be - w= e can see that it is junk, but the surprising point is that, =0A> in=0A> > = >> >> > this case as I have mentioned in my first mail, windows boots up fr= om=0A> > >> >> > grub2.So it is that the partition table is not required fo= r the =0A> > chainloader=0A> > >> >> > thing and just the boot record is su= fficient=0A> > >> >>=0A> > >> >> Hi,=0A> > >> >>=0A> > >> >> Oh, sorry for = another long delay. I disassemble the file with ida,=0A> > >> >> which is a= n amazing tool. I don't know if there is open source=0A> > >> >> alternativ= e, please let me know if you find one.=0A> > >> >>=0A> > >> >> The output f= rom ida is in masm format, I modify it a bit so that it=0A> > >> >> can be = compiled using nasm. Please note that nasm doesn't generate the=0A> > >> >>= same binary file as original one, but you can get an idea what it=0A> > >>= >> does.=0A> > >> >>=0A> > >> >> From the output, the program fails at the= second int 13 call, int=0A> > >> >> 13/ah =3D 48h. Although I notice that = DL=3D0, which is not supposed to=0A> > >> >> happen. Perhaps you can add a = grub_printf in grub_chainloader_boot to=0A> > >> >> show the value of boot = drive:=0A> > >> >>=0A> > >> >> static grub_err_t=0A> > >> >> grub_chainload= er_boot (void)=0A> > >> >> {=0A> > >> >>=A0 grub_printf ("boot_drive=3D%d\n= ", boot_drive);=0A> > >> >>=A0 grub_chainloader_real_boot (boot_drive, boot= _part_addr);=0A> > >> >>=0A> > >> >>=A0 /* Never reach here.=A0 */=0A> > >>= >>=A0 return GRUB_ERR_NONE;=0A> > >> >> }=0A> > >> >>=0A> > >> >> --=0A> >= >> >> Bean=0A> > >> >>=0A> > >> >>=0A> > >> >=0A> > >> > Hi,=0A> > >> >=0A= > > >> > The value of boot drive is 0x80.=0A> > >> >=0A> > >> > This was th= e same value in disk->drive also.=0A> > >>=0A> > >> Hi,=0A> > >>=0A> > >> I= nteresting, perhaps %dx is changed somewhere. Please try the=0A> > >> follo= wing patch, it dumps the value of %dx just before jumping to the=0A> > >> b= oot sector.=0A> > >>=0A> > >> --=0A> > >> Bean=0A> > >=0A> > > The patch wo= rks and now Windows is booting perfectly fine from Grub2.=0A> > >=0A> > > I= will go through the assembly and try to understand what modifications you = =0A> > have done.So there is a problem in Grub2 code, which needs to be fix= ed ?=0A> > >=0A> > > Till this point, I was chainloading grub from Grub2 an= d then chainloading =0A> > Windows2008 from it.=0A> > >=0A> > > Thanks for = the consistent help till this point and for the future also.=0A> > =0A> > H= i,=0A> > =0A> > That's strange, the patch doesn't do anything except output= the value of dx:=0A> > =0A> >=A0 =A0 /* set up to pass boot drive */=0A> >= =A0 =A0 popl=A0 =A0 %edx=0A> > +=A0 =A0 movl=A0 =A0 %edx, %edi=0A> > =0A> >= =A0 =A0 /* ESI must point to a partition table entry */=0A> >=A0 =A0 popl= =A0 =A0 %esi=0A> > =0A> >=A0 =A0 call=A0 =A0 prot_to_real=0A> >=A0 =A0 .cod= e16=0A> > +=0A> > +=A0 =A0 push=A0 =A0 %dx=0A> > +=A0 =A0 call=A0 =A0 hex_o= ut=0A> > +=A0 =A0 push=A0 =A0 %di=0A> > +=A0 =A0 call=A0 =A0 hex_out=0A> > = +=0A> >=A0 =A0 ljmp=A0 =A0 $0, $GRUB_MEMORY_MACHINE_BOOT_LOADER_ADDR=0A> > = +=0A> > +hex_out:=0A> > +=A0 =A0 pushw=A0 =A0 %bp=0A> > +=A0 =A0 movw=A0 = =A0 %sp, %bp=0A> > +=A0 =A0 pushaw=0A> > +=A0 =A0 movb=A0 =A0 $0xE, %ah=0A>= > +=A0 =A0 movw=A0 =A0 $7, %bx=0A> > +=A0 =A0 movw=A0 =A0 $4, %cx=0A> > += =A0 =A0 movw=A0 =A0 4(%bp), %dx=0A> > +1:=0A> > +=A0 =A0 rol=A0 =A0 $4, %dx= =0A> > +=A0 =A0 movb=A0 =A0 %dl, %al=0A> > +=A0 =A0 andb=A0 =A0 $0xF, %al= =0A> > +=A0 =A0 cmpb=A0 =A0 $10, %al=0A> > +=A0 =A0 jb=A0 =A0 2f=0A> > +=A0= =A0 subb=A0 =A0 $('0'-'A'+10), %al=0A> > +2:=0A> > +=A0 =A0 addb=A0 =A0 $'= 0', %al=0A> > +=A0 =A0 int=A0 =A0 $0x10=0A> > +=A0 =A0 loop=A0 =A0 1b=0A> >= +=A0 =A0 movb=A0 =A0 $' ', %al=0A> > +=A0 =A0 int=A0 =A0 $0x10=0A> > +=A0 = =A0 popaw=0A> > +=A0 =A0 popw=A0 =A0 %bp=0A> > +=A0 =A0 ret=A0 =A0 $2=0A> >= =A0 =A0 .code32=0A> > =0A> > #include "../loader.S"=0A> > =0A> > Perhaps yo= u can try:=0A> > =0A> > 1, %edi is used as backup register in case %edx is = changed by=0A> > prot_to_real, you can remove "movl %edx, %edi", "push %di"= , "call=0A> > hex_out" and see if it still works.=0A> > =0A> > 2, It's poss= ible that the bug is position related, replace "push %dx",=0A> > "call hex_= out" with equal number of nop and see what happens.=0A> > =0A> > -- =0A> > = Bean=0A> > =0A> =0A> We can remove the patch completely, without putting no= p also, but just comment =0A> out the following code=0A> =0A> /*=0A> =A0 = =A0 xorl=A0 =A0 %eax, %eax=0A> =A0 =A0 call=A0 =A0 EXT_C(grub_gate_a20)=0A>= */=0A> =0A> This is the only difference and when I comment out this, Windo= ws boots up from =0A> Grub2.=0A> =0A> Regards,=0A> Viswesh=0A> =0A> =0A=0AS= o is this a bug in grub2 ?=0A=0ACan you people confirm this ?=0A=0AViswesh= =0A=0A=0A=0A Add more friends to your messenger and enjoy! Go to http:= //messenger.yahoo.com/invite/