s390: enable detection of kernel version from bzImage
Extend "parmarea" to include an offset of the version string, which is stored as 8-byte big endian value. To retrieve version string from bzImage reliably, one should check the presence of "S390EP" ascii string at 0x10008 (available since v3.2), then read the version string offset from 0x10428 (which has been 0 since v3.2 up to now). The string is null terminated. Could be retrieved with the following "file" command magic (requires file v5.34): 8 string \x02\x00\x00\x18\x60\x00\x00\x50\x02\x00\x00\x68\x60\x00\x00\x50\x40\x40\x40\x40\x40\x40\x40\x40 Linux S390 >0x10008 string S390EP >>0x10428 bequad >0 >>>(0x10428.Q) string >\0 \b, version %s Reported-by: Petr Tesarik <ptesarik@suse.com> Suggested-by: Petr Tesarik <ptesarik@suse.com> Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
This commit is contained in:

committed by
Heiko Carstens

parent
5f9e832c13
commit
6abe281970
@@ -54,6 +54,7 @@
|
||||
#define INITRD_SIZE_OFFSET 0x10410
|
||||
#define OLDMEM_BASE_OFFSET 0x10418
|
||||
#define OLDMEM_SIZE_OFFSET 0x10420
|
||||
#define KERNEL_VERSION_OFFSET 0x10428
|
||||
#define COMMAND_LINE_OFFSET 0x10480
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
@@ -74,7 +75,8 @@ struct parmarea {
|
||||
unsigned long initrd_size; /* 0x10410 */
|
||||
unsigned long oldmem_base; /* 0x10418 */
|
||||
unsigned long oldmem_size; /* 0x10420 */
|
||||
char pad1[0x10480 - 0x10428]; /* 0x10428 - 0x10480 */
|
||||
unsigned long kernel_version; /* 0x10428 */
|
||||
char pad1[0x10480 - 0x10430]; /* 0x10430 - 0x10480 */
|
||||
char command_line[ARCH_COMMAND_LINE_SIZE]; /* 0x10480 */
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user