qemu-discuss
[Top][All Lists]
Advanced

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

Please help.. I wish to load .elf file directly for baremetal run..


From: ckim
Subject: Please help.. I wish to load .elf file directly for baremetal run..
Date: Wed, 17 Mar 2021 15:28:32 +0900

Hello all,

 

Using the help from this email list, I’m using command below for my baremetal program test on qemu. (-s -S for connecting with gdb) :

 

$aarch64-none-elf-objcopy -O binary test.elf test.bin

$cp test.bin pflash.img; truncate -s 67108864 pflash.img        //to cut it down to 64MB because the pflash size is 64MB)

$qemu-system-aarch64 -machine type=virt,gic-version=3,secure=true,virtualization=true -cpu cortex-a72 -nographic -smp 1 -m 2048 -drive if=pflash,file=pflash.img,format=raw,readonly=on -s -

 

The entry address is 0. The problem is this test.bin can become very big when I have some space between section.

For example, if I want to put some initialized data (that can be changed) in RAM at 0x40000000, this bin file becomes bigger than 1GB. (because it fills the in-between spaces in .bin file)

I tried just using -kernel test.elf but it errors in rom_check_and_register_reset() inside qemu_init.

And the arm64 virt machine places dtb in the first RAM area.

Isn’t there any option though which I can just load the .elf file (each section to its address) and run from the entry address?

and is it possible to disable dtb loading at the first RAM address?

Thank you for any help.

 

Chan Kim

 


reply via email to

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