summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNeil Horman <nhorman@tuxdriver.com>2008-01-30 19:10:45 -0500
committerSimon Horman <horms@verge.net.au>2008-02-20 10:57:06 +0900
commitb5c2ed5e02cfe862eded56be7f6c1106e84e6e6c (patch)
treea7912cf8aa7b305e86cc5ad963465116f285dc03 /include
parent162cecf91f6ac99d5af35ac6488415cdfa98ac58 (diff)
downloadkexec-tools-b5c2ed5e02cfe862eded56be7f6c1106e84e6e6c.tar.gz
Kexec command line length
Fine, New patch attached. This patch does 5 things: 1) moves command line out of the zero page (struct bootparam) 2) extends command line length to support 2K command lines 3) adds a check to ensure that command line length is reasonably sized for new boot protocols 4) adds a check to ensure that command line length is reasonably sized for old boot protocols 5) imports variables from latest struct setup_header in kernel bootparams.h Incorporates simplified version checking for boot protocol and conservatively warns if the kernels boot protocol is below version 2.06 which is guaranteed to have 2K commandlines (even though some arches may have that support in older boot protocols) Neil Signed-off-by: Neil Horman <nhorman@tuxdriver.com> include/x86/x86-linux.h | 20 ++++++++++++++------ kexec/arch/i386/kexec-bzImage.c | 11 +++++++++++ kexec/arch/i386/x86-linux-setup.c | 3 ++- 3 files changed, 27 insertions(+), 7 deletions(-) Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'include')
-rw-r--r--include/x86/x86-linux.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/include/x86/x86-linux.h b/include/x86/x86-linux.h
index afe66bd..4f3507e 100644
--- a/include/x86/x86-linux.h
+++ b/include/x86/x86-linux.h
@@ -144,18 +144,22 @@ struct x86_linux_param_header {
/* 2.04+ */
uint32_t kernel_alignment; /* 0x230 */
uint8_t relocatable_kernel; /* 0x234 */
- uint8_t reserved15[0x2d0 - 0x235]; /* 0x230 */
+ uint8_t reserved15[3]; /* 0x235 */
+ uint32_t cmdline_size; /* 0x238 */
+ uint32_t hardware_subarch; /* 0x23C */
+ uint64_t hardware_subarch_data; /* 0x240 */
+ uint8_t reserved16[0x2d0 - 0x248]; /* 0x248 */
#endif
struct e820entry e820_map[E820MAX]; /* 0x2d0 */
/* 0x550 */
-#define COMMAND_LINE_SIZE 256
+#define COMMAND_LINE_SIZE 2048
};
struct x86_linux_faked_param_header {
struct x86_linux_param_header hdr; /* 0x00 */
- uint8_t reserved16[688]; /* 0x550 */
- uint8_t command_line[COMMAND_LINE_SIZE]; /* 0x800 */
- uint8_t reserved17[1792]; /* 0x900 - 0x1000 */
+ uint8_t reserved17[0xab0]; /* 0x550 */
+ uint8_t command_line[COMMAND_LINE_SIZE]; /* 0x1000 */
+ uint8_t reserved18[0x200]; /* 0x1800 - 0x2000 */
};
struct x86_linux_header {
@@ -206,7 +210,11 @@ struct x86_linux_header {
#else
uint32_t kernel_alignment; /* 0x230 */
uint8_t relocatable_kernel; /* 0x234 */
- uint8_t tail[32*1024 - 0x235]; /* 0x230 */
+ uint8_t reserved6[3]; /* 0x235 */
+ uint32_t cmdline_size; /* 0x238 */
+ uint32_t hardware_subarch; /* 0x23C */
+ uint64_t hardware_subarch_data; /* 0x240 */
+ uint8_t tail[32*1024 - 0x248]; /* 0x248 */
#endif
} PACKED;