summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2013-10-09 17:22:14 +0200
committerHelge Deller <deller@gmx.de>2013-10-09 17:22:14 +0200
commitd9a5f7d041c42f9af6f5a1b2a2ee4135d16e44f7 (patch)
tree449e507cb980a6b12a3ab989ed0c384241650c4c
parentac4326de74061c85148942f965c513c0a0e17f1b (diff)
downloadpalo-d9a5f7d041c42f9af6f5a1b2a2ee4135d16e44f7.tar.gz
Increase command line length in bootsector from 127 to 1024 bytes.
A longer Linux kernel command line may help if you want to provide more and longer information to the kernel, e.g. for UUIDs of harddisks.
-rw-r--r--ipl/crt0.S4
-rw-r--r--ipl/ipl.c10
-rw-r--r--lib/common.h7
3 files changed, 13 insertions, 8 deletions
diff --git a/ipl/crt0.S b/ipl/crt0.S
index 383b37f..d52485f 100644
--- a/ipl/crt0.S
+++ b/ipl/crt0.S
@@ -304,11 +304,9 @@ longjmp:
.export $global$, data
$global$:
.word 4
- .export commandline,data
+ .import commandline,data
.export rd_start,data
.export rd_end,data
-commandline:
- .blockz 256+4
rd_start:
.blockz 4
rd_end:
diff --git a/ipl/ipl.c b/ipl/ipl.c
index 28325f5..1748883 100644
--- a/ipl/ipl.c
+++ b/ipl/ipl.c
@@ -14,8 +14,7 @@
#undef PAGE0
#define PAGE0 ((struct zeropage *)0x00000000)
-/* length of command line buffer (see crt0.S) */
-#define CMDLINELEN (256+4)
+char commandline[CMDLINELEN];
int Debug = 0;
int interactive = 0;
@@ -381,7 +380,6 @@ iplmain(int is_interactive, char *initialstackptr, int started_wide)
int partitioned;
unsigned entry;
struct firstblock f;
- extern char commandline[];
int blocked_bootdev;
int wide;
int kern_part, rd_part;
@@ -451,6 +449,12 @@ iplmain(int is_interactive, char *initialstackptr, int started_wide)
if (f.rd_sz > 0)
printf(" 0/ramdisk %d bytes @ 0x%x\n", f.rd_sz, f.rd_offset);
+ if (f.cmdline[0] == '\0' && f.cmdline_old[0]) /* old style command line ? */
+ {
+ strcpy(f.cmdline, f.cmdline_old);
+ f.cmdline_old[0] = 0;
+ }
+
if (f.cmdline[0] == '\0') /* no command line specified */
{
die("ERROR: No command line on boot media -- faking one\n");
diff --git a/lib/common.h b/lib/common.h
index 6ac7a3d..dda15f7 100644
--- a/lib/common.h
+++ b/lib/common.h
@@ -64,6 +64,8 @@ void *pa_memcpy(void *dest, const void *src, unsigned n);
#define PFLAG_INSTALL 0x1
#define PFLAG_EXT2 0x2
+#define CMDLINELEN 1024 /* max length of command line */
+
struct firstblock
{
unsigned char lifmagic0; /* 0x80 */
@@ -75,7 +77,7 @@ struct firstblock
int kern32_sz; /* # bytes to load */
int rd_offset; /* seek() here to begin loading ramdisk */
int rd_sz; /* # bytes in ramdisk */
- char cmdline[128]; /* Up to 127 bytes of text plus a \0 */
+ char cmdline_old[128]; /* OLD: Up to 127 bytes of text plus a \0 */
unsigned char pad1[0xf0 - 8 - 9 * sizeof (int) - 128];
int kern32_native_sz; /* 32bit kernel: uncompressed file size */
@@ -93,7 +95,8 @@ struct firstblock
struct partition part[4];
/* offset 0x1fe */
unsigned char dosmagic[2]; /* 0x55, 0xaa */
- unsigned char pad4[2048 - 0x200];
+ unsigned char pad4[1024 - 0x200];
+ char cmdline[CMDLINELEN];/* max 1023 bytes of text plus a \0 */
};
/* we use this so that we can do without the ctype library */