summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--Makefile3
-rw-r--r--hw/s390-virtio.c26
-rw-r--r--pc-bios/README4
-rw-r--r--pc-bios/s390-zipl.rombin0 -> 3336 bytes
4 files changed, 32 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index eb9e02b7a0..306a1a4038 100644
--- a/Makefile
+++ b/Makefile
@@ -184,7 +184,8 @@ pxe-e1000.bin \
 pxe-ne2k_pci.bin pxe-pcnet.bin \
 pxe-rtl8139.bin pxe-virtio.bin \
 bamboo.dtb petalogix-s3adsp1800.dtb \
-multiboot.bin linuxboot.bin
+multiboot.bin linuxboot.bin \
+s390-zipl.rom
 else
 BLOBS=
 endif
diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c
index c36a8b2336..898f442355 100644
--- a/hw/s390-virtio.c
+++ b/hw/s390-virtio.c
@@ -52,6 +52,10 @@
 #define INITRD_PARM_SIZE                0x010410UL
 #define PARMFILE_START                  0x001000UL
 
+#define ZIPL_START			0x009000UL
+#define ZIPL_LOAD_ADDR			0x009000UL
+#define ZIPL_FILENAME			"s390-zipl.rom"
+
 #define MAX_BLK_DEVS                    10
 
 static VirtIOS390Bus *s390_bus;
@@ -188,6 +192,28 @@ static void s390_init(ram_addr_t ram_size,
 
         env->psw.addr = KERN_IMAGE_START;
         env->psw.mask = 0x0000000180000000ULL;
+    } else {
+        ram_addr_t bios_size = 0;
+        char *bios_filename;
+
+        /* Load zipl bootloader */
+        if (bios_name == NULL) {
+            bios_name = ZIPL_FILENAME;
+        }
+
+        bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
+        bios_size = load_image(bios_filename, qemu_get_ram_ptr(ZIPL_LOAD_ADDR));
+
+        if ((long)bios_size < 0) {
+            hw_error("could not load bootloader '%s'\n", bios_name);
+        }
+
+        if (bios_size > 4096) {
+            hw_error("stage1 bootloader is > 4k\n");
+        }
+
+        env->psw.addr = ZIPL_START;
+        env->psw.mask = 0x0000000180000000ULL;
     }
 
     if (initrd_filename) {
diff --git a/pc-bios/README b/pc-bios/README
index fc940a7c9d..e62b4cd716 100644
--- a/pc-bios/README
+++ b/pc-bios/README
@@ -27,3 +27,7 @@
   virtio 1af4:1000
 
   http://rom-o-matic.net/
+
+- The S390 zipl loader is an addition to the official IBM s390-tools
+  package. That fork is maintained in its own git repository at:
+  git://repo.or.cz/s390-tools.git
diff --git a/pc-bios/s390-zipl.rom b/pc-bios/s390-zipl.rom
new file mode 100644
index 0000000000..f7af9b155d
--- /dev/null
+++ b/pc-bios/s390-zipl.rom
Binary files differ