From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JmsvP-0001Ct-UR for mharc-grub-devel@gnu.org; Fri, 18 Apr 2008 11:54:56 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JmsvO-0001CG-9B for grub-devel@gnu.org; Fri, 18 Apr 2008 11:54:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JmsvM-0001B1-5Z for grub-devel@gnu.org; Fri, 18 Apr 2008 11:54:53 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JmsvL-0001Ay-Sp for grub-devel@gnu.org; Fri, 18 Apr 2008 11:54:51 -0400 Received: from aybabtu.com ([69.60.117.155]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JmsvL-0006Xy-ME for grub-devel@gnu.org; Fri, 18 Apr 2008 11:54:52 -0400 Received: from [192.168.10.6] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1JmsvI-0003xn-JO for grub-devel@gnu.org; Fri, 18 Apr 2008 17:54:50 +0200 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1Jmsut-0001zO-Dd for grub-devel@gnu.org; Fri, 18 Apr 2008 17:54:23 +0200 Date: Fri, 18 Apr 2008 17:54:23 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20080418155423.GA7616@thorin> References: <1208212240.3971.48.camel@localhost.localdomain> <20080415133805.GG21548@thorin> <1208433201.770.43.camel@localhost.localdomain> <20080417201107.GB13794@thorin> <20080417222114.reel0vq6f40gsskc@webmail.spamcop.net> <20080418113259.GD26239@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20080418113259.GD26239@thorin> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] Make gdb debugging a bit less painful 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, 18 Apr 2008 15:54:54 -0000 Bean confirmed it works. Committed without changing jmp to call, since it wasn't clear whether we want it or not. On Fri, Apr 18, 2008 at 01:32:59PM +0200, Robert Millan wrote: > On Thu, Apr 17, 2008 at 10:21:14PM -0400, Pavel Roskin wrote: > > Quoting Robert Millan : > > > > >Now that I think of it, is there any reason for doing all the cmain() > > >cruft before grub_main() ? Getting to grub_main() only requires a working > > >stack, which we have, and grub_main() inmediately returns control back to > > >architecture-specific code in grub_machine_init(). > > > > > >So why not move from: > > > > > > _start -> cmain -> grub_main > > > > > >to: > > > > > > _start -> grub_main -> grub_machine_init -> cmain > > > > > >? > > > > I think it would be great. We should try to make the code for > > different architectures more uniform to simplify maintenance. > > Here. Unfortunately I can't test it as I have no ieee1275 at hand currently. > > Anyone? > > -- > Robert Millan > > I know my rights; I want my phone call! > What use is a phone call… if you are unable to speak? > (as seen on /.) > diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp ../grub2/include/grub/ieee1275/ieee1275.h ./include/grub/ieee1275/ieee1275.h > --- ../grub2/include/grub/ieee1275/ieee1275.h 2008-01-24 09:21:43.000000000 +0100 > +++ ./include/grub/ieee1275/ieee1275.h 2008-04-18 13:31:27.000000000 +0200 > @@ -97,6 +97,7 @@ extern void EXPORT_FUNC(grub_ieee1275_se > > > > +void EXPORT_FUNC(grub_ieee1275_init) (void); > int EXPORT_FUNC(grub_ieee1275_finddevice) (char *name, > grub_ieee1275_phandle_t *phandlep); > int EXPORT_FUNC(grub_ieee1275_get_property) (grub_ieee1275_phandle_t phandle, > diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp ../grub2/kern/i386/ieee1275/startup.S ./kern/i386/ieee1275/startup.S > --- ../grub2/kern/i386/ieee1275/startup.S 2008-01-23 10:57:26.000000000 +0100 > +++ ./kern/i386/ieee1275/startup.S 2008-04-18 13:29:57.000000000 +0200 > @@ -39,7 +39,7 @@ > start: > _start: > movl %eax, EXT_C(grub_ieee1275_entry_fn) > - jmp EXT_C(cmain) > + jmp EXT_C(grub_main) > > /* > * This call is special... it never returns... in fact it should simply > diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp ../grub2/kern/ieee1275/cmain.c ./kern/ieee1275/cmain.c > --- ../grub2/kern/ieee1275/cmain.c 2008-04-12 23:09:35.000000000 +0200 > +++ ./kern/ieee1275/cmain.c 2008-04-18 13:30:43.000000000 +0200 > @@ -151,9 +151,8 @@ grub_ieee1275_find_options (void) > #undef SF > #undef OHW > > -void cmain (void); > void > -cmain (void) > +grub_ieee1275_init (void) > { > grub_ieee1275_finddevice ("/chosen", &grub_ieee1275_chosen); > > @@ -162,9 +161,4 @@ cmain (void) > grub_ieee1275_mmu = 0; > > grub_ieee1275_find_options (); > - > - /* Now invoke the main function. */ > - grub_main (); > - > - /* Never reached. */ > } > diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp ../grub2/kern/ieee1275/init.c ./kern/ieee1275/init.c > --- ../grub2/kern/ieee1275/init.c 2008-04-12 23:09:36.000000000 +0200 > +++ ./kern/ieee1275/init.c 2008-04-18 13:31:51.000000000 +0200 > @@ -180,6 +180,8 @@ grub_machine_init (void) > char args[256]; > int actual; > > + grub_ieee1275_init (); > + > grub_console_init (); > #ifdef __i386__ > grub_keyboard_controller_init (); > diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp ../grub2/kern/powerpc/ieee1275/crt0.S ./kern/powerpc/ieee1275/crt0.S > --- ../grub2/kern/powerpc/ieee1275/crt0.S 2008-01-19 12:41:00.000000000 +0100 > +++ ./kern/powerpc/ieee1275/crt0.S 2008-04-18 13:30:12.000000000 +0200 > @@ -42,5 +42,5 @@ _start: > lis 9, grub_ieee1275_entry_fn@ha > stw 5, grub_ieee1275_entry_fn@l(9) > > - bl cmain > + bl grub_main > 1: b 1b > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel -- Robert Millan I know my rights; I want my phone call! What use is a phone call… if you are unable to speak? (as seen on /.)