All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: how to increase commandline size (fwd)
@ 2006-10-10  0:45 Jeff Chua
  2006-10-10  1:03 ` how to increase commandline size (patch + changelog) Jeff Chua
  0 siblings, 1 reply; 15+ messages in thread
From: Jeff Chua @ 2006-10-10  0:45 UTC (permalink / raw)
  To: Grub Devel; +Cc: Jeff Chua


On Sun, 8 Oct 2006, Marco Gerards wrote:

>> It seems to stop at 256 characters counting the input length
> 
> That's weird.  Could you please have a look at loader/i386/pc/linux.c
> to see if it gets the entire line or just a part.  Perhaps this
> limitation is in the protocol used to pass the command line to Linux,
> I don't this protocol.

Marco,

I managed to trace down the limitation to GRUB_LINUX_CL_END_OFFSET.
This limits to 255 characters. I've expanded to 1536 and it seems ok.
I've modified the code to rely on COMMAND_LINE_SIZE defined in the kernel.

ps. Marco had requested that I post this to the mailing list so that you 
all can help verify this is ok.


Here's the patch ...

Thanks for your help,

Jeff.


--- grub2/include/grub/i386/linux.h.org	2006-10-10 01:06:33 +0800
+++ grub2/include/grub/i386/linux.h	2006-10-10 01:07:54 +0800
@@ -17,6 +17,8 @@
   *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   */

+#include <asm/param.h>
+
  #ifndef GRUB_LINUX_MACHINE_HEADER
  #define GRUB_LINUX_MACHINE_HEADER	1

@@ -41,8 +43,9 @@
  #define GRUB_LINUX_VID_MODE_ASK		0xFFFD

  #define GRUB_LINUX_CL_OFFSET		0x9000
-#define GRUB_LINUX_CL_END_OFFSET	0x90FF
-#define GRUB_LINUX_SETUP_MOVE_SIZE	0x9100
+#define GRUB_LINUX_CL_END_OFFSET	\
+		(GRUB_LINUX_CL_OFFSET + COMMAND_LINE_SIZE)
+#define GRUB_LINUX_SETUP_MOVE_SIZE	(GRUB_LINUX_CL_END_OFFSET + 1)
  #define GRUB_LINUX_CL_MAGIC		0xA33F

  #define GRUB_LINUX_EFI_SIGNATURE	\
--- grub2/kern/i386/pc/startup.S.org	2006-10-10 01:05:30 +0800
+++ grub2/kern/i386/pc/startup.S	2006-10-10 01:05:45 +0800
@@ -51,6 +51,7 @@
  #include <grub/cpu/linux.h>
  #include <grub/machine/kernel.h>
  #include <grub/machine/multiboot.h>
+#include <asm/param.h>

  #define ABS(x)	((x) - EXT_C(start) + GRUB_BOOT_MACHINE_KERNEL_ADDR + 0x200)

@@ -760,7 +761,7 @@
  	/* copy the real mode code */
  	movl	EXT_C(grub_linux_tmp_addr), %esi
  	movl	%ebx, %edi
-	movl	$GRUB_LINUX_SETUP_MOVE_SIZE, %ecx
+	movl	$(GRUB_LINUX_CL_OFFSET + COMMAND_LINE_SIZE + 1), %ecx
  	cld
  	rep
  	movsb
--- grub2/Makefile.org	2006-10-10 01:05:59 +0800
+++ grub2/Makefile	2006-10-10 01:06:06 +0800
@@ -61,7 +61,7 @@
  	 -DGRUB_LIBDIR=\"$(pkglibdir)\"
  TARGET_CC = gcc
  TARGET_CFLAGS = -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes                  -Wundef -Wstrict-prototypes -g -Os -falign-jumps=1 -falign-loops=1 -falign-functions=1
-TARGET_CPPFLAGS =  -I. -Iinclude -I$(srcdir)/include \
+TARGET_CPPFLAGS =  -I/usr/include -I. -Iinclude -I$(srcdir)/include \
  	-Wall -W
  TARGET_LDFLAGS =
  OBJCOPY = objcopy



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2006-10-13 18:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-10  0:45 how to increase commandline size (fwd) Jeff Chua
2006-10-10  1:03 ` how to increase commandline size (patch + changelog) Jeff Chua
2006-10-10  2:27   ` Hollis Blanchard
2006-10-10  3:08     ` Jeff Chua
2006-10-10  4:32       ` Hollis Blanchard
2006-10-10  4:59         ` Jeff Chua
2006-10-10  6:54           ` Marco Gerards
2006-10-10  6:52         ` Marco Gerards
2006-10-10  8:01           ` Jeff Chua
2006-10-10 12:35             ` Markus Laire
2006-10-10 14:38             ` Marco Gerards
2006-10-10 15:40               ` Hollis Blanchard
2006-10-10 16:08                 ` Marco Gerards
2006-10-10 17:17                   ` Jeff Chua
2006-10-13 18:53                     ` Yoshinori K. Okuji

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.