aboutsummaryrefslogtreecommitdiff
path: root/pc-bios/s390-ccw/bootmap.h
diff options
context:
space:
mode:
authorCollin L. Walling <walling@linux.vnet.ibm.com>2018-02-23 10:43:14 -0500
committerThomas Huth <thuth@redhat.com>2018-02-26 07:56:55 +0100
commitba831b25262aa3d0c6d5eb0cd530487d3cb05493 (patch)
tree2737b286198feb8d58569424fdcae2e699b2b1a3 /pc-bios/s390-ccw/bootmap.h
parent9eaa654ab327b54901f398440258be766c327953 (diff)
s390-ccw: read stage2 boot loader data to find menu
Read the stage2 boot loader data block-by-block. We scan the current block for the string "zIPL" to detect the start of the boot menu banner. We then load the adjacent blocks (previous block and next block) to account for the possibility of menu data spanning multiple blocks. Signed-off-by: Collin L. Walling <walling@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'pc-bios/s390-ccw/bootmap.h')
-rw-r--r--pc-bios/s390-ccw/bootmap.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/pc-bios/s390-ccw/bootmap.h b/pc-bios/s390-ccw/bootmap.h
index 4cf7e1e463..c636626f1a 100644
--- a/pc-bios/s390-ccw/bootmap.h
+++ b/pc-bios/s390-ccw/bootmap.h
@@ -87,6 +87,7 @@ typedef struct ScsiMbr {
} __attribute__ ((packed)) ScsiMbr;
#define ZIPL_MAGIC "zIPL"
+#define ZIPL_MAGIC_EBCDIC "\xa9\xc9\xd7\xd3"
#define IPL1_MAGIC "\xc9\xd7\xd3\xf1" /* == "IPL1" in EBCDIC */
#define IPL2_MAGIC "\xc9\xd7\xd3\xf2" /* == "IPL2" in EBCDIC */
#define VOL1_MAGIC "\xe5\xd6\xd3\xf1" /* == "VOL1" in EBCDIC */
@@ -249,15 +250,33 @@ typedef struct EckdCdlIpl1 {
uint8_t data[24];
} __attribute__((packed)) EckdCdlIpl1;
+typedef struct EckdSeekArg {
+ uint16_t pad;
+ EckdCHS chs;
+ uint8_t pad2;
+} __attribute__ ((packed)) EckdSeekArg;
+
+typedef struct EckdStage1b {
+ uint8_t reserved[32 * STAGE2_BLK_CNT_MAX];
+ struct EckdSeekArg seek[STAGE2_BLK_CNT_MAX];
+ uint8_t unused[64];
+} __attribute__ ((packed)) EckdStage1b;
+
+typedef struct EckdStage1 {
+ uint8_t reserved[72];
+ struct EckdSeekArg seek[2];
+} __attribute__ ((packed)) EckdStage1;
+
typedef struct EckdCdlIpl2 {
uint8_t key[4]; /* == "IPL2" */
- uint8_t reserved0[88];
+ struct EckdStage1 stage1;
XEckdMbr mbr;
uint8_t reserved[24];
} __attribute__((packed)) EckdCdlIpl2;
typedef struct EckdLdlIpl1 {
- uint8_t reserved[112];
+ uint8_t reserved[24];
+ struct EckdStage1 stage1;
BootInfo bip; /* BootInfo is MBR for LDL */
} __attribute__((packed)) EckdLdlIpl1;