qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

I Failed to execute AARCH64 Linux kernel on the QEMU


From: Minjun Hong
Subject: I Failed to execute AARCH64 Linux kernel on the QEMU
Date: Wed, 31 Jan 2024 14:20:22 +0900

Hello.

I'm trying to execute AARCH64 Linux kernel on the QEMU.

But,there was an error and the error log is:

rom: requested regions overlap (rom bootloader. free=0x00000000422c0a00, addr=0x0000000040000000)
qemu-system-aarch64: rom check and register reset failed

 And my development environment is:
host: x86_64 Ubuntu 18.04
linux kernel source version: v5.19
busybox version(for initramfs): 1_36_stable

 I cannot find what I should check first. I mean, I'm lost. So, I need help.

What I did to achieve my goal is as following:

1. Linux kernel build for AARCH64

- apply defconfig

make ARCH=arm64 defconfig -j$(nproc) CROSS_COMPILE=aarch64-linux-gnu-
-  set 'CONFIG_BLK_DEV_RAM' config by using menuconfig to use RAM disk
build kernel
make ARCH=arm64 -j$(nproc) CROSS_COMPILE=aarch64-linux-gnu-

2.  Build 'busybox' to make initramfs.gz
apply defconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
-  set 'CONFIG_STATIC' config by using menuconfig to build the libraries as static library form.
- build busybox
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j$(nproc)

 - install busybox
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- install

make initramfs.gz
cd _install
mkdir -p dev etc/init.d home/root lib mnt proc root sys tmp usr/lib var
cp -v /usr/aarch64-linux-gnu/lib/* ./lib/

cat > etc/init.d/rcS << EOF
#!/bin/sh
mount -t proc none /proc
mount -t sysfs none /sys
/sbin/mdev -s
[ ! -h /etc/mtab ]  && ln -s /proc/mounts /etc/mtab
[ ! -f /etc/resolv.conf ] && cat /proc/net/pnp > /etc/resolv.conf
EOF

chmod +x etc/init.d/rcS
find . | cpio -o --format=newc > ../initramfs
cd ..
gzip -vc initramfs > initramfs.gz
- install qemu
sudo apt install qemu-system-arm qemu-efi-aarch64

-  execute qemu
qemu-system-aarch64 \
-machine virt \
-cpu cortex-a57 \
-smp 4 \
-m 2048 \
-kernel arch/arm64/boot/Image \ 
-initrd busybox/initramfs.gz \ 
-append "rdinit=/sbin/init root=/dev/ram rootfstype=ramfs rw nokaslr" \ 
-nographic
 
 If you have any idea about this problem, please help me. Thanks!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]