Hello Team,
I am trying to run standalone application atop of QEMU for layerscape board.
I am able to execute Linux kernel using below command:
/qemu_v2/bin/qemu-system-aarch64 -m 2G -cpu cortex-a72 -M virt-4.2 \
-kernel /ls1046a/aarch64-layerscape-fvlinux-kernel \
-initrd /ls1046a/aarch64-layerscape-fvlinux-ramdisk.img \
-display none \
-serial mon:stdio \
-serial /dev/null \
-append 'root=/dev/sda rw console=ttyAMA0'
Which is working fine for Linux kernel. Request to similar provide command/guidance, which provides information/steps to run standalone application atop of QEMU for layerscape ls1028a or ls1046a board.
Command "qemu-aarch64 -L /usr/aarch64-linux-gnu" will work for dynamically linked executable. Here I need to run statically linked (not stripped), ELF 32-BIT LSB ARM executable image using qemu.
Hello Chavira,
I have Linux PC with QEMU and trying to run an standalone kernel atop of QEMU.
Thank you for contacting NXP support!
We don't have documentation about QEMU.
I know the command is qemu-aarch64 -L /usr/aarch64-linux-gnu ./hello64dyn, but I am not sure!
you can learn more about QEMU by following the link:
Command: "qemu-aarch64 -L /usr/aarch64-linux-gnu ./hello64dyn" is not working for standalone application of layerscape ls1028a or ls1046a board.
Observed below error:
qemu-system-aarch64: No machine specified, and there is no default
Linux User space emulator
Command line options
qemu-i386 [-h] [-d] [-L path] [-s size] [-cpu model] [-g port] [-B offset] [-R size] program [arguments...]
-h
Print the help
-L path
Set the x86 elf interpreter prefix (default=/usr/local/qemu-i386)
-s size
Set the x86 stack size in bytes (default=524288)
-cpu model
Select CPU model (-cpu help for list and additional feature selection)
-E var=value
Set environment var to value.
-U var
Remove var from the environment.
-B offset
Offset guest address by the specified number of bytes. This is useful when the address region required by guest applications is reserved on the host. This option is currently only supported on some hosts.
-R size
Pre-allocate a guest virtual address space of the given size (in bytes). "G", "M", and "k" suffixes may be used when specifying the size.
Debug options:
-d item1,...
Activate logging of the specified items (use ‘-d help’ for a list of log items)
-p pagesize
Act as if the host page size was ‘pagesize’ bytes
-g port
Wait gdb connection to port
-singlestep
Run the emulation in single step mode.
BSD User space emulator
BSD Status
target Sparc64 on Sparc64: Some trivial programs work.
Quick Start
In order to launch a BSD process, QEMU needs the process executable itself and all the target dynamic libraries used by it.
On Sparc64, you can just try to launch any process by using the native libraries:
qemu-sparc64 /bin/ls
Command line options
qemu-sparc64 [-h] [-d] [-L path] [-s size] [-bsd type] program [arguments...]
-h
Print the help
-L path
Set the library root path (default=/)
-s size
Set the stack size in bytes (default=524288)
-ignore-environment
Start with an empty environment. Without this option, the initial environment is a copy of the caller’s environment.
-E var=value
Set environment var to value.
-U var
Remove var from the environment.
-bsd type
Set the type of the emulated BSD Operating system. Valid values are FreeBSD, NetBSD and OpenBSD (default).
Debug options:
-d item1,...
Activate logging of the specified items (use ‘-d help’ for a list of log items)
-p pagesize
Act as if the host page size was ‘pagesize’ bytes
-singlestep
Run the emulation in single step mode.
I found the instructions in the next link:
https://www.qemu.org/docs/master/user/main.html
Command "qemu-aarch64 -L /usr/aarch64-linux-gnu" will work for dynamically linked executable. Here I need to run statically linked (not stripped), ELF 32-BIT LSB ARM executable image using qemu.
please try with qemu-aarch64.
or you can try according to the documentation of quemu.
Other binaries
user mode (Alpha)
"qemu-alpha" TODO.
user mode (Arm)
"qemu-armeb" TODO.
"qemu-arm" is also capable of running Arm "Angel" semihosted ELF binaries (as implemented by the arm-elf and arm-eabi Newlib/GDB configurations), and arm-uclinux bFLT format binaries.