From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JmoqS-0007pZ-Hm for mharc-grub-devel@gnu.org; Fri, 18 Apr 2008 07:33:32 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JmoqQ-0007oP-6t for grub-devel@gnu.org; Fri, 18 Apr 2008 07:33:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JmoqN-0007o8-Ie for grub-devel@gnu.org; Fri, 18 Apr 2008 07:33:28 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JmoqN-0007o5-Cq for grub-devel@gnu.org; Fri, 18 Apr 2008 07:33:27 -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 1JmoqM-00063x-VC for grub-devel@gnu.org; Fri, 18 Apr 2008 07:33:27 -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 1JmoqK-0003YR-RX for grub-devel@gnu.org; Fri, 18 Apr 2008 13:33:26 +0200 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1Jmopv-00070W-S6 for grub-devel@gnu.org; Fri, 18 Apr 2008 13:32:59 +0200 Date: Fri, 18 Apr 2008 13:32:59 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20080418113259.GD26239@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> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="2fHTh5uZTiUOsy+g" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20080417222114.reel0vq6f40gsskc@webmail.spamcop.net> 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 11:33:30 -0000 --2fHTh5uZTiUOsy+g Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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 /.) --2fHTh5uZTiUOsy+g Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="cmain.diff" 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 --2fHTh5uZTiUOsy+g--