Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aarch64/riscv64: make the microkit loader relocatable #220

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alwin-joshy
Copy link
Contributor

@alwin-joshy alwin-joshy commented Sep 20, 2024

This allows a microkit image to be loaded anywhere in memory at which point it will relocate itself to the LOADER_LINK_ADDRESS. These changes are based on the elfloader from seL4/seL4_tools.

Changes include:

  • crt0.s was changed to crt0.S and compiled with gcc to pass in LINK_ADDRESS
  • memmove and memcpy implementations were added
  • loader_data was changed to include a size field. This is the size of loader_data, the list of regions, and the regions themselves. These also need to be relocated to ensure that everything works correctly

Tested on: imx8mm with LOADER_LINK_ADDRESS = 0x41000000 and uboot load address parameter set to 0x42000000

@alwin-joshy
Copy link
Contributor Author

Added support for RISC-V. Tested on star64 by loading image at address 0x70000000 (LOADER_LINK_ADDRESS is 0x60000000)

This allows a microkit image to be loaded anywhere in memory at which
point it will relocate itself to the LOADER_LINK_ADDRESS. These changes
are based on the elfloader from seL4/seL4_tools.

Changes include:

* crt0.s was changed to crt0.S and compiled with gcc to pass in
  LINK_ADDRESS
* memmove and memcpy implementations were added
* loader_data was changed to include a size field. This is the size
  of loader_data, the list of regions, and the regions themselves.
  These also need to be relocated to ensure that everything works
  correctly

Signed-off-by: Alwin Joshy <[email protected]>
This allows a microkit image to be loaded anywhere in memory at which
point it will relocate itself to the LOADER_LINK_ADDRESS. These changes
are based on the elfloader from seL4/seL4_tools.

See previous commit for more details.

Signed-off-by: Alwin Joshy <[email protected]>
@alwin-joshy alwin-joshy changed the title aarch64: make the microkit loader relocatable aarch64/riscv64: make the microkit loader relocatable Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant