[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] hw/arm/boot: Load the Non Linux initrd to the memor
From: |
Dongjiu Geng |
Subject: |
[Qemu-devel] [PATCH] hw/arm/boot: Load the Non Linux initrd to the memory |
Date: |
Tue, 27 Aug 2019 17:41:55 +0800 |
Except support linux operation system, qemu also supports other
operation system which is non linux, such as microkernel system.
But now Qemu only load linux initrd, so change it to load both
linux and Non-linux initrd Image.
Signed-off-by: Dongjiu Geng <address@hidden>
---
hw/arm/boot.c | 45 +++++++++++++++++++++++----------------------
1 file changed, 23 insertions(+), 22 deletions(-)
diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index a830655e1a..2e6c17975a 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -1056,30 +1056,31 @@ static void arm_setup_direct_kernel_boot(ARMCPU *cpu,
exit(1);
}
info->entry = entry;
- if (is_linux) {
- uint32_t fixupcontext[FIXUP_MAX];
- if (info->initrd_filename) {
- initrd_size = load_ramdisk_as(info->initrd_filename,
- info->initrd_start,
- info->ram_size - info->initrd_start,
- as);
- if (initrd_size < 0) {
- initrd_size = load_image_targphys_as(info->initrd_filename,
- info->initrd_start,
- info->ram_size -
- info->initrd_start,
- as);
- }
- if (initrd_size < 0) {
- error_report("could not load initrd '%s'",
- info->initrd_filename);
- exit(1);
- }
- } else {
- initrd_size = 0;
+ if (info->initrd_filename) {
+ initrd_size = load_ramdisk_as(info->initrd_filename,
+ info->initrd_start,
+ info->ram_size - info->initrd_start,
+ as);
+ if (initrd_size < 0) {
+ initrd_size = load_image_targphys_as(info->initrd_filename,
+ info->initrd_start,
+ info->ram_size -
+ info->initrd_start,
+ as);
}
- info->initrd_size = initrd_size;
+ if (initrd_size < 0) {
+ error_report("could not load initrd '%s'",
+ info->initrd_filename);
+ exit(1);
+ }
+ } else {
+ initrd_size = 0;
+ }
+ info->initrd_size = initrd_size;
+
+ if (is_linux) {
+ uint32_t fixupcontext[FIXUP_MAX];
fixupcontext[FIXUP_BOARDID] = info->board_id;
fixupcontext[FIXUP_BOARD_SETUP] = info->board_setup_addr;
--
2.17.1
- [Qemu-devel] [PATCH] hw/arm/boot: Load the Non Linux initrd to the memory,
Dongjiu Geng <=