Installing non linux os on dargonboard410c


#1

Hi, I want to install non linux os on dragonboard.
I have an elf file of the kernel.
I gziped the elf file and used it as the kernel image in the mkbootimg command as instructed here

But I got:

[19960] [19960] booting linux @ 0x80008000, ramdisk @ 0x84000000 (4239482), tags/device tree @ 0x83e00000
[19970] [19970] undefined abort, halting
[19970] [19970] r0 0x00000000 r1 0x00000000 r2 0x83e00000 r3 0x644d5241
[19970] [19970] r4 0x8f68b834 r5 0x0040b07a r6 0x84000000 r7 0x8f68f2bc
[19970] [19970] r8 0x83e00000 r9 0x83e00000 r10 0x80008000 r11 0x80008000
[19970] [19970] r12 0x600001d3 usp 0x00000000 ulr 0x00000000 pc 0x80008000
[19970] [19970] spsr 0x800001d3


#2

Hi, I specifically try to load the kvm image generated from the unikraft project:
https://wiki.xenproject.org/wiki/Category:Unikraft_Users

using the simple “hello world” repo http://xenbits.xen.org/git-http/unikraft/apps/helloworld.git

All the elf does is print some staff and halt.

I compile it with “staging” branch of unikraft and with the following as .config file:

the result is an elf file under the “build directory” which can be run with:

qemu-system-aarch64 -machine virt -m 256 -cpu cortex-a53 -nographic -serial mon:stdio -kernel build/helloworld_kvm-arm64

I that in the dragonboard 410 kernel source tree
(http://git.linaro.org/landing-teams/working/qualcomm/kernel.git)

The kernel for mkboot command is generated with:

aarch64-linux-gnu-objcopy -O binary -R .note -R .note.gnu.build-id -R .comment -S vmlinux arch/arm64/boot/Image

So I did the same for the unikraft elf and set it as the --kernel parameter for the mkboot command.
Then I tried loading the boot.img with sudo fastboot boot boot.img. What happened is that the dragonboard rebooted to regular mode when received my image so loaded the linux image on the emmc.


#3

The bootloader cannot load an ELF image, it loads a Linux kernel image.
To load your payload using LittleKernel you need to link it so that the
linked image starts with a Linux/arm64 kernel header (see
https://www.kernel.org/doc/Documentation/arm64/booting.txt ), convert
the ELF image to binary and then wrap that image using mkbootimg .

Details on how to provide a kernel header for non kernel code are shared
here:

Alternatively if you wish to load ELF images directly it might be
possible to modify u-boot to do this although, when I last looked
(mid-2017) I couldn’t find any elf64 support in u-boot so you might have
to add this first.


#4
qemu-system-aarch64 -machine virt -m 256 -cpu cortex-a53 -nographic -serial mon:stdio -kernel build/helloworld_kvm-arm64

You haven’t said but presumably you have either rebuilt the image with some
DB410C drivers enabled or provided a suitable device tree so the
unikernel can adapter to the change of hardware. Without one of these things
a unikernel for kvm is very unlikely to run on a DB410C.

I that in the dragonboard 410 kernel source tree
(http://git.linaro.org/landing-teams/working/qualcomm/kernel.git)

The kernel for mkboot command is generated with:

aarch64-linux-gnu-objcopy -O binary -R .note -R .note.gnu.build-id -R .comment -S vmlinux arch/arm64/boot/Image

So I did the same for the unikraft elf and set it as the --kernel parameter for the mkboot command.
Then I tried loading the boot.img with sudo fastboot boot boot.img. What happened is that the dragonboard rebooted to regular mode when received my image so loaded the linux image on the emmc.

As mentioned above, if the unikernel does not provide a suitable kernel header
for the loader to use then this is not sufficient.