[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 14/14] pc-bios/s390-ccw: Wire up the netload cod
From: |
Thomas Huth |
Subject: |
[Qemu-devel] [RFC PATCH 14/14] pc-bios/s390-ccw: Wire up the netload code |
Date: |
Tue, 27 Jun 2017 13:48:20 +0200 |
Link the libnet.a to the s390-ccw.elf file, call netload() instead of
the external network boot image, and jump to loaded kernel at address 0,
so that we can finally do a full network boot with the s390-ccw firmware
now.
Signed-off-by: Thomas Huth <address@hidden>
---
pc-bios/s390-ccw/Makefile | 2 +-
pc-bios/s390-ccw/bootmap.c | 10 +++++++++-
pc-bios/s390-ccw/main.c | 3 +--
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile
index 369bd65..827d7be 100644
--- a/pc-bios/s390-ccw/Makefile
+++ b/pc-bios/s390-ccw/Makefile
@@ -10,7 +10,7 @@ $(call set-vpath, $(SRC_PATH)/pc-bios/s390-ccw)
.PHONY : all clean build-all libc.a libnet.a
OBJECTS = start.o main.o bootmap.o sclp.o virtio.o virtio-scsi.o virtio-net.o
-OBJECTS += libc.a sbrk.o
+OBJECTS += libnet.a libc.a sbrk.o
QEMU_CFLAGS := $(filter -W%, $(QEMU_CFLAGS))
QEMU_CFLAGS += -ffreestanding -fno-delete-null-pointer-checks -msoft-float
QEMU_CFLAGS += -march=z900 -fPIE -fno-strict-aliasing
diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c
index 523fa78..32befda 100644
--- a/pc-bios/s390-ccw/bootmap.c
+++ b/pc-bios/s390-ccw/bootmap.c
@@ -11,6 +11,7 @@
#include "s390-ccw.h"
#include "bootmap.h"
#include "virtio.h"
+#include "libnet/netapps.h"
#ifdef DEBUG
/* #define DEBUG_FALLBACK */
@@ -744,7 +745,14 @@ void zipl_load(void)
}
if (virtio_get_device_type() == VIRTIO_ID_NET) {
- jump_to_IPL_code(vdev->netboot_start_addr);
+ long len;
+
+ len = netload();
+ if (len < 0) {
+ panic("Network loading failed");
+ }
+ sclp_print("Netload done, starting kernel...\n");
+ asm volatile (" lpsw 0(%0) " : : "r"(0) : "memory");
}
ipl_scsi();
diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
index 1cacc1b..b058e1b 100644
--- a/pc-bios/s390-ccw/main.c
+++ b/pc-bios/s390-ccw/main.c
@@ -150,12 +150,11 @@ static void virtio_setup(void)
IPL_assert(found, "No virtio device found");
+ virtio_setup_device(blk_schid);
if (virtio_get_device_type() == VIRTIO_ID_NET) {
sclp_print("Network boot device detected\n");
vdev->netboot_start_addr = iplb.ccw.netboot_start_addr;
} else {
- virtio_setup_device(blk_schid);
-
IPL_assert(virtio_ipl_disk_is_valid(), "No valid IPL device detected");
}
}
--
1.8.3.1
- [Qemu-devel] [RFC PATCH 01/14] pc-bios/s390-ccw: Add the libc from the SLOF firmware, (continued)
- [Qemu-devel] [RFC PATCH 01/14] pc-bios/s390-ccw: Add the libc from the SLOF firmware, Thomas Huth, 2017/06/27
- [Qemu-devel] [RFC PATCH 07/14] libnet: Rework error message printing, Thomas Huth, 2017/06/27
- [Qemu-devel] [RFC PATCH 08/14] libnet: Refactor some code of netload() into a separate function, Thomas Huth, 2017/06/27
- [Qemu-devel] [RFC PATCH 10/14] pc-bios/s390-ccw: Add timer code for the libnet, Thomas Huth, 2017/06/27
- [Qemu-devel] [RFC PATCH 11/14] pc-bios/s390-ccw: Add virtio-net driver code, Thomas Huth, 2017/06/27
- [Qemu-devel] [RFC PATCH 09/14] pc-bios/s390-ccw: Make the basic libnet code compilable, Thomas Huth, 2017/06/27
- [Qemu-devel] [RFC PATCH 12/14] pc-bios/s390-ccw: Load file via an intermediate .INS file, Thomas Huth, 2017/06/27
- [Qemu-devel] [RFC PATCH 13/14] pc-bios/s390-ccw: Allow loading to address 0, Thomas Huth, 2017/06/27
- [Qemu-devel] [RFC PATCH 14/14] pc-bios/s390-ccw: Wire up the netload code,
Thomas Huth <=
- [Qemu-devel] [RFC PATCH 05/14] pc-bios/s390-ccw: Add the TFTP network loading stack from SLOF, Thomas Huth, 2017/06/27
- Re: [Qemu-devel] [RFC PATCH 00/14] Implement network booting directly into the s390-ccw BIOS, Farhan Ali, 2017/06/27
- Re: [Qemu-devel] [RFC PATCH 00/14] Implement network booting directly into the s390-ccw BIOS, Viktor Mihajlovski, 2017/06/27
- Re: [Qemu-devel] [RFC PATCH 00/14] Implement network booting directly into the s390-ccw BIOS, Thomas Huth, 2017/06/27
- Re: [Qemu-devel] [RFC PATCH 00/14] Implement network booting directly into the s390-ccw BIOS, Viktor Mihajlovski, 2017/06/28
- Re: [Qemu-devel] [RFC PATCH 00/14] Implement network booting directly into the s390-ccw BIOS, Thomas Huth, 2017/06/28
- Re: [Qemu-devel] [RFC PATCH 00/14] Implement network booting directly into the s390-ccw BIOS, Thomas Huth, 2017/06/28
- Re: [Qemu-devel] [RFC PATCH 00/14] Implement network booting directly into the s390-ccw BIOS, Viktor Mihajlovski, 2017/06/28
- Re: [Qemu-devel] [RFC PATCH 00/14] Implement network booting directly into the s390-ccw BIOS, Thomas Huth, 2017/06/29