All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Millan <rmh@aybabtu.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: [PATCH] build 32-bit Linux loader as `linux', rename legacy loader to `linux16'
Date: Sun, 22 Mar 2009 17:00:32 +0100	[thread overview]
Message-ID: <20090322160032.GA21948@thorin> (raw)
In-Reply-To: <20090321175056.GC18284@thorin>

[-- Attachment #1: Type: text/plain, Size: 753 bytes --]

On Sat, Mar 21, 2009 at 06:50:56PM +0100, Robert Millan wrote:
> On Wed, Mar 18, 2009 at 02:09:11PM +0100, phcoder wrote:
> > IMO linux16 for pc/linux.c would better reflect the difference with  
> > normal 'linux' command.
> 
> I'm fine with that.  Does anyone object to the proposed rename?
> 
> Note this implies the new Linux loader becomes the default in grub-mkconfig
> setup (it is already but only with coreboot).

Here's a patch to rename `linux' to `linux16' and build the 32-bit loader as
simply `linux'.

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."

[-- Attachment #2: linux16.diff --]
[-- Type: text/x-diff, Size: 4550 bytes --]

2009-03-22  Robert Millan  <rmh@aybabtu.com>

	* conf/i386-pc.rmk (pkglib_MODULES): Add `linux16.mod'.
	(linux16_mod_SOURCES, linux16_mod_CFLAGS, linux16_mod_LDFLAGS): New
	variables.  Use 16-bit loader.
	(linux_mod_SOURCES, linux_mod_CFLAGS, linux_mod_LDFLAGS): Use 32-bit
	loader.
	* kern/i386/loader.S (grub_linux_boot): Rename to ...
	(grub_linux16_boot): ... this.  Update all users.
	* loader/i386/linux.c (grub_linux32_boot): Rename to ...
	(grub_linux_boot): ... this.  Update all users.

	* loader/i386/pc/linux.c (GRUB_MOD_INIT(linux)): Rename to ...
	(GRUB_MOD_INIT(linux16)): ... this.  Rename `linux' and `initrd'
	commands to `linux16' and `initrd16'.
	(GRUB_MOD_FINI(linux)): Rename to ...
	(GRUB_MOD_FINI(linux16)): ... this.

Index: conf/i386-pc.rmk
===================================================================
--- conf/i386-pc.rmk	(revision 2043)
+++ conf/i386-pc.rmk	(working copy)
@@ -167,7 +167,7 @@ grub_install_SOURCES = util/i386/pc/grub
 # For grub-mkrescue.
 grub_mkrescue_SOURCES = util/i386/pc/grub-mkrescue.in
 
-pkglib_MODULES = biosdisk.mod chain.mod linux.mod normal.mod \
+pkglib_MODULES = biosdisk.mod chain.mod normal.mod \
 	multiboot.mod reboot.mod halt.mod	\
 	vbe.mod vbetest.mod vbeinfo.mod play.mod serial.mod	\
 	ata.mod vga.mod memdisk.mod pci.mod lspci.mod	\
@@ -185,8 +185,13 @@ chain_mod_SOURCES = loader/i386/pc/chain
 chain_mod_CFLAGS = $(COMMON_CFLAGS)
 chain_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
-# For _linux.mod.
-linux_mod_SOURCES = loader/i386/pc/linux.c
+pkglib_MODULES += linux16.mod
+linux16_mod_SOURCES = loader/i386/pc/linux.c
+linux16_mod_CFLAGS = $(COMMON_CFLAGS)
+linux16_mod_LDFLAGS = $(COMMON_LDFLAGS)
+
+pkglib_MODULES += linux.mod
+linux_mod_SOURCES = loader/i386/linux.c
 linux_mod_CFLAGS = $(COMMON_CFLAGS)
 linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
Index: kern/i386/loader.S
===================================================================
--- kern/i386/loader.S	(revision 2043)
+++ kern/i386/loader.S	(working copy)
@@ -59,7 +59,7 @@ VARIABLE(grub_linux_real_addr)
 VARIABLE(grub_linux_is_bzimage)
 	.long	0
 
-FUNCTION(grub_linux_boot)
+FUNCTION(grub_linux16_boot)
 	/* Must be done before zImage copy.  */
 	call	EXT_C(grub_dl_unload_all)
 
Index: include/grub/i386/loader.h
===================================================================
--- include/grub/i386/loader.h	(revision 2043)
+++ include/grub/i386/loader.h	(working copy)
@@ -30,7 +30,7 @@ extern grub_int32_t EXPORT_VAR(grub_linu
 extern grub_addr_t EXPORT_VAR(grub_os_area_addr);
 extern grub_size_t EXPORT_VAR(grub_os_area_size);
 
-grub_err_t EXPORT_FUNC(grub_linux_boot) (void);
+grub_err_t EXPORT_FUNC(grub_linux16_boot) (void);
 
 void EXPORT_FUNC(grub_unix_real_boot) (grub_addr_t entry, ...)
      __attribute__ ((cdecl,noreturn));
Index: loader/i386/linux.c
===================================================================
--- loader/i386/linux.c	(revision 2043)
+++ loader/i386/linux.c	(working copy)
@@ -263,7 +263,7 @@ struct
 #endif
 
 static grub_err_t
-grub_linux32_boot (void)
+grub_linux_boot (void)
 {
   struct linux_kernel_params *params;
   int e820_num;
@@ -522,7 +522,7 @@ grub_cmd_linux (grub_command_t cmd __att
 
   if (grub_errno == GRUB_ERR_NONE)
     {
-      grub_loader_set (grub_linux32_boot, grub_linux_unload,
+      grub_loader_set (grub_linux_boot, grub_linux_unload,
 		       0 /* set noreturn=0 in order to avoid grub_console_fini() */);
       loaded = 1;
     }
Index: loader/i386/pc/linux.c
===================================================================
--- loader/i386/pc/linux.c	(revision 2043)
+++ loader/i386/pc/linux.c	(working copy)
@@ -269,7 +269,7 @@ grub_cmd_linux (grub_command_t cmd __att
   if (grub_errno == GRUB_ERR_NONE)
     {
       grub_linux_prot_size = prot_size;
-      grub_loader_set (grub_linux_boot, grub_linux_unload, 1);
+      grub_loader_set (grub_linux16_boot, grub_linux_unload, 1);
       loaded = 1;
     }
 
@@ -378,18 +378,18 @@ grub_cmd_initrd (grub_command_t cmd __at
 
 static grub_command_t cmd_linux, cmd_initrd;
 
-GRUB_MOD_INIT(linux)
+GRUB_MOD_INIT(linux16)
 {
   cmd_linux =
-    grub_register_command ("linux", grub_cmd_linux,
+    grub_register_command ("linux16", grub_cmd_linux,
 			   0, "load linux");
   cmd_initrd =
-    grub_register_command ("initrd", grub_cmd_initrd,
+    grub_register_command ("initrd16", grub_cmd_initrd,
 			   0, "load initrd");
   my_mod = mod;
 }
 
-GRUB_MOD_FINI(linux)
+GRUB_MOD_FINI(linux16)
 {
   grub_unregister_command (cmd_linux);
   grub_unregister_command (cmd_initrd);

  reply	other threads:[~2009-03-22 16:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-06 19:57 [PATCH] linux/gfxterm integration Robert Millan
2009-03-08 13:01 ` Robert Millan
2009-03-08 13:09   ` Robert Millan
2009-03-08 13:35   ` Vesa Jääskeläinen
2009-03-13 19:44     ` Robert Millan
2009-03-13 20:10       ` David Miller
2009-03-18 10:25       ` new Linux loader (Re: [PATCH] linux/gfxterm integration) Robert Millan
2009-03-18 13:09         ` phcoder
2009-03-21 17:50           ` Robert Millan
2009-03-22 16:00             ` Robert Millan [this message]
2009-03-28 12:53               ` [PATCH] build 32-bit Linux loader as `linux', rename legacy loader to `linux16' Robert Millan
2009-03-30 13:32                 ` Pavel Roskin
2009-03-30 14:35                   ` phcoder
2009-03-30 16:06                     ` Yoshinori K. Okuji
2009-03-30 21:51                       ` Pavel Roskin
2009-04-01 13:23                         ` Robert Millan
2009-04-01 14:04                           ` Pavel Roskin
2009-04-01 14:22                             ` Robert Millan
2009-04-01 13:33                       ` Robert Millan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090322160032.GA21948@thorin \
    --to=rmh@aybabtu.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.