qemu-devel
[Top][All Lists]
Advanced

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

TARGET_SYS_HEAPINFO and Cortex-A15 memory map


From: Liviu Ionescu
Subject: TARGET_SYS_HEAPINFO and Cortex-A15 memory map
Date: Thu, 2 Jun 2022 21:36:38 +0300

I'm experiencing some issues with the startup code for an emulated Cortex-a15 
machine I plan to use for running unit-tests.

I'm starting QEMU with:

.../qemu-system-arm  "--machine" "virt" "--cpu" "cortex-a15" "--nographic" "-d" 
"unimp,guest_errors" "--semihosting-config" 
"enable=on,target=native,arg=sample-test,arg=one,arg=two" -s -S


At 0x0 I'm loading the application that uses the newlib semihosting library and 
startup.


The application starts and I can use GDB to step into the code from the very 
beginning. In crt0 the first thing I see is a call to SYS_HEAPINFO, followed by 
setting the heap and stack.

The values returned are:

0x04000000 - heap base
0x08000000 - heap limit
0x08000000 - stack base
0x0 - stack limit

This sets the SP at 0x08000000, which I'm not sure it is a valid memory 
address, since writes to it seem ineffective, and in the first function called, 
when it tries to pop registers from the stack, everything is zero, and the 
program jumps to 0x0.

I'm not very familiar with the Cortex-A15 memory map and initialisation; if the 
memory below 0x08000000 is indeed valid for a stack, probably I need to enable 
something more during the reset sequence, to make it writable.

Any suggestion?


Liviu







reply via email to

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