seL4 / microkit

Microkit - A simple operating system framework for the seL4 microkernel
Other
70 stars 37 forks source link

ZCU102 hello world example #30

Closed podhrmic closed 5 months ago

podhrmic commented 1 year ago

Hello, I am running intro problems running the ZCU102 example. I am using the Xilinx QEMU fork, and I can boot the sel4 test on the emulated board from Uboot using tftpboot (so I am reasonably confident that the emulator is set up correctly).

I am building the example with dev_build.py --board=zcu102 --example=hello

However, when I attempt to run the loader.img I get the following error:

# Starting application at 0x08000000 ...
LDR|INFO: altloader for seL4 starting
LDR|ERROR: mismatch on loader data structure magic number
...
Resetting CPU ...

The docs say that:

The ZCU102 can run on a physical board or on an appropriate QEMU based emulator.

Can you advise how to run the hello world example on ZCU102?

sand7000 commented 1 year ago

Turns out we just had to use a different memory address. We had been using 0x8000000 because that worked for sel4test. This works for the hello world example:

tftpboot 0x40000000 loader.img
go 0x40000000
Ivan-Velickovic commented 1 year ago

The address that you load the system image to must match the loader_link_address specified, in the case of the ZCU102 it is 0x40000000 (https://github.com/BreakawayConsulting/sel4cp/blob/main/build_sdk.py#L65).

This is also why the QEMU command in the manual has this argument: -device loader,file=[SYSTEM IMAGE],addr=0x40000000,cpu-num=0 in order to load the system at that address.