From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Ik3Wx-0007OT-NR for mharc-grub-devel@gnu.org; Mon, 22 Oct 2007 16:05:43 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ik3Wu-0007KY-IF for grub-devel@gnu.org; Mon, 22 Oct 2007 16:05:40 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ik3Wt-0007Jw-RH for grub-devel@gnu.org; Mon, 22 Oct 2007 16:05:40 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ik3Wt-0007JT-L6 for grub-devel@gnu.org; Mon, 22 Oct 2007 16:05:39 -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 1Ik3Ws-00036O-DR for grub-devel@gnu.org; Mon, 22 Oct 2007 16:05:38 -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 1Ik3Wq-0003wj-E3 for grub-devel@gnu.org; Mon, 22 Oct 2007 22:05:37 +0200 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1Ik3Wk-000330-Lx for grub-devel@gnu.org; Mon, 22 Oct 2007 22:05:30 +0200 Date: Mon, 22 Oct 2007 22:05:30 +0200 From: Robert Millan To: grub-devel@gnu.org Message-ID: <20071022200530.GB31128@thorin> References: <20071019200726.GA12105@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20071019200726.GA12105@thorin> Organization: free as in freedom X-Message-Flag: Microsoft discourages use of Outlook. 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] convert biosdisk into a module 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, 22 Oct 2007 20:05:40 -0000 Committed. On Fri, Oct 19, 2007 at 10:07:26PM +0200, Robert Millan wrote: > > This patch converts biosdisk into a module. > > In the future, maybe we can also move some of the grub_biosdisk_* functions > in kern/i386/pc/startup.S into this module, but it seems the build system > reacts very adversely to modules containing standalone assembly files, so > I fixed one bug (see followup) and gave up. > > -- > 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 /.) > 2007-10-19 Robert Millan > > * conf/i386-pc.rmk (kernel_img_SOURCES): Remove `disk/i386/pc/biosdisk.c'. > (pkgdata_MODULES): Add `biosdisk.mod'. > (biosdisk_mod_SOURCES, biosdisk_mod_CFLAGS, biosdisk_mod_LDFLAGS): New > variables. > > * disk/i386/pc/biosdisk.c: Include `'. > (grub_biosdisk_init): Replace with ... > (GRUB_MOD_INIT(biosdisk)): ... this. > (grub_biosdisk_fini): Replace with ... > (GRUB_MOD_FINI(biosdisk)): ... this. > > * kern/i386/pc/init.c: Remove `'. > (grub_machine_init): Remove call to grub_biosdisk_init(). > (grub_machine_fini): Remove call to grub_machine_fini(). > > * util/i386/pc/grub-install.in (modules): Add `biosdisk'. > > diff -urp grub2/conf/i386-pc.rmk grub2.biosdisk/conf/i386-pc.rmk > --- grub2/conf/i386-pc.rmk 2007-10-01 17:50:34.000000000 +0200 > +++ grub2.biosdisk/conf/i386-pc.rmk 2007-10-19 22:00:34.000000000 +0200 > @@ -27,7 +27,7 @@ kernel_img_SOURCES = kern/i386/pc/startu > kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ > kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ > kern/i386/dl.c kern/i386/pc/init.c kern/parser.c kern/partition.c \ > - kern/env.c disk/i386/pc/biosdisk.c \ > + kern/env.c \ > term/i386/pc/console.c \ > symlist.c > kernel_img_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ > @@ -127,11 +127,16 @@ grub_install_SOURCES = util/i386/pc/grub > grub_mkrescue_SOURCES = util/i386/pc/grub-mkrescue.in > > # Modules. > -pkgdata_MODULES = _chain.mod _linux.mod linux.mod normal.mod \ > +pkgdata_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ > _multiboot.mod chain.mod multiboot.mod reboot.mod halt.mod \ > vbe.mod vbetest.mod vbeinfo.mod video.mod gfxterm.mod \ > videotest.mod play.mod bitmap.mod tga.mod cpuid.mod serial.mod > > +# For biosdisk.mod. > +biosdisk_mod_SOURCES = disk/i386/pc/biosdisk.c > +biosdisk_mod_CFLAGS = $(COMMON_CFLAGS) > +biosdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) > + > # For _chain.mod. > _chain_mod_SOURCES = loader/i386/pc/chainloader.c > _chain_mod_CFLAGS = $(COMMON_CFLAGS) > diff -urp grub2/disk/i386/pc/biosdisk.c grub2.biosdisk/disk/i386/pc/biosdisk.c > --- grub2/disk/i386/pc/biosdisk.c 2007-07-22 01:32:20.000000000 +0200 > +++ grub2.biosdisk/disk/i386/pc/biosdisk.c 2007-10-19 22:00:34.000000000 +0200 > @@ -19,6 +19,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -311,14 +312,12 @@ static struct grub_disk_dev grub_biosdis > .next = 0 > }; > > -void > -grub_biosdisk_init (void) > +GRUB_MOD_INIT(biosdisk) > { > grub_disk_dev_register (&grub_biosdisk_dev); > } > > -void > -grub_biosdisk_fini (void) > +GRUB_MOD_FINI(biosdisk) > { > grub_disk_dev_unregister (&grub_biosdisk_dev); > } > diff -urp grub2/kern/i386/pc/init.c grub2.biosdisk/kern/i386/pc/init.c > --- grub2/kern/i386/pc/init.c 2007-09-07 23:55:26.000000000 +0200 > +++ grub2.biosdisk/kern/i386/pc/init.c 2007-10-19 22:00:34.000000000 +0200 > @@ -21,7 +21,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -226,9 +225,6 @@ grub_machine_init (void) > > if (! grub_os_area_addr) > grub_fatal ("no upper memory"); > - > - /* The memory system was initialized, thus register built-in devices. */ > - grub_biosdisk_init (); > } > > void > @@ -241,7 +237,6 @@ grub_machine_set_prefix (void) > void > grub_machine_fini (void) > { > - grub_biosdisk_fini (); > grub_console_fini (); > } > > diff -urp grub2/util/i386/pc/grub-install.in grub2.biosdisk/util/i386/pc/grub-install.in > --- grub2/util/i386/pc/grub-install.in 2007-07-22 01:32:32.000000000 +0200 > +++ grub2.biosdisk/util/i386/pc/grub-install.in 2007-10-19 22:00:34.000000000 +0200 > @@ -224,7 +224,7 @@ fi > partmap_module=`$grub_probe --target=partmap --device-map=${device_map} ${grubdir} 2> /dev/null` > > # _chain is often useful > -modules="$modules $fs_module $partmap_module _chain" > +modules="$modules $fs_module $partmap_module biosdisk _chain" > > $grub_mkimage --output=${grubdir}/core.img --prefix=`make_system_path_relative_to_its_root ${grubdir}` $modules || exit 1 > > _______________________________________________ > 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 /.)