qemu-discuss
[Top][All Lists]
Advanced

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

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


From: ckim
Subject: RE: Please help.. I wish to load .elf file directly for baremetal run..
Date: Wed, 17 Mar 2021 16:35:03 +0900

 

If I change the linker script so that the program loads and starts at RAM address, I can use -kernel test.elf and run the program.

But I’m still curious if I can load the program at 0x0 (ROM area) and use some data at 0x40000000 (RAM) like we can do in rtl simulation.

Thanks!

Chan Kim

 

From: ckim@etri.re.kr <ckim@etri.re.kr>
Sent: Wednesday, March 17, 2021 3:29 PM
To: 'qemu-discuss' <qemu-discuss@nongnu.org>
Subject: Please help.. I wish to load .elf file directly for baremetal run..

 

Hello all,

 

Using the help from this email list, Im 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.

Isnt 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]