> On 25 Jul 2022, at 19:02, Peter Maydell <peter.mayd...@linaro.org> wrote:
>
>
> We document what the guest can assume about the virt board
> memory layout here:
>
> https://www.qemu.org/docs/master/system/arm/virt.html#hardware-configuration-information-for-bare-metal-programming
>
> Flash at 0, RAM at 0x4000_0000, must look in the DTB blob
> for all other information.
ah, ok, I probably missed this. :-(
btw, looking in the dtb blob is probably not a problem for a linux kernel, but
if I want only to write a simple test that needs a timer, getting the timer
address is probably more complicated than my entire test... :-(
> The one where SYS_HEAPINFO produces the bogus result putting the
> heap at 0x04000000, that you mentioned in the original report with
> the command line
>
> .../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
ah, the bogus one... that's a bit more complicated, since it happened in the
early tests, and I don't remember how I did it, it might be that I tried to
load my code in flash and my data in ram, but I'm not sure.
try to check the logic and avoid the cases when flash addresses are returned
for heap, if possible.
btw, this might be a different topic, but on Cortex-M devices I'm used to
configure the linker scripts to allocate the text in flash and the data+bss in
ram; for qemu aarch32/64 devices I could not make this work, and I had to
allocate everything in ram, which is functional, but probably not very accurate
for some tests, that might fail when running from flash.
regards,
Liviu