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

Add Aarch64 test #16

Merged
merged 4 commits into from
May 21, 2021
Merged

Add Aarch64 test #16

merged 4 commits into from
May 21, 2021

Conversation

jschwe
Copy link
Contributor

@jschwe jschwe commented May 18, 2021

This PR adds an aarch64 artifact of the hermit application (for use with the github workflow) that will exit once it reaches the point up to which the kernel currently works. Expected Output is something like:

$ qemu-system-aarch64 -display none -smp 4 -m 1G -serial stdio -kernel target/aarch64-unknown-hermit-loader/debug/rusty-loader  -machine raspi3 -semihosting
[LOADER] Enter startup code
[LOADER] Loader: [0x80000 - 0x131a010]
[LOADER] Allocating 0x268 bytes at 0x11190C0, index 0
[LOADER] Allocating 0x870 bytes at 0x1119340, index 640
[LOADER] Allocating 0xC0 bytes at 0x1119BC0, index 2816
[LOADER] Allocating 0xE0 bytes at 0x1119CC0, index 3072
[LOADER] This is a supported HermitCore Application
[LOADER] Found entry point: 0x500f4
[LOADER] File Size: 488897 Bytes
[LOADER] Mem Size:  522008 Bytes
[LOADER] start 0x9a2cc, size 0x7f718
[LOADER] Load HermitCore Application at 0x1200000
[LOADER] Found TLS starts at 0x1250200 (size 88 Bytes)
[LOADER] Jumping to HermitCore Application Entry Point at 0x12500f4
Welcome to hermit kernel.
[0][INFO] Welcome to HermitCore-rs 0.3.45
[0][INFO] Kernel starts at 0x0
[0][INFO] BSS starts at 0x12775c8
[0][INFO] TLS starts at 0x0 (size 0 Bytes)
[0][INFO] The current hermit-kernel is only implemented up to this point on aarch64.
[0][INFO] Attempting to exit via QEMU.
[0][INFO] This requires that you passed the `-semihosting` option to QEMU.

This test compiles the rusty-loader with an application artifact compiled from
jschwe/libhermit-rs@f5faa6d
The artifact is technically the rusty_demo artifact, since the hello_world artifact
didn't work for me.
This is most likely due to the loader still being brittle.
I suspect that the copying process is buggy, since (un)commenting simple things
such as log messages in rusty-loader will break or fix entry into the kernel.
Until this is fixed this workflow will probably fail sometimes.

Update: Commit ae3308c changes the way the Stack pointer is set and this seems to fix the issues I'd been having.

It's currently only used on aarch64 anyway.
Note: If the default x86 binary is used, rusty-loader will
fail during the assertion of the elf header machine type.

Signed-off-by: Jonathan Schwender <[email protected]>
This test compiles the rusty-loader with an application artifact compiled from
jschwe/libhermit-rs@f5faa6d
The artifact is technically the rusty_demo artifact, since the hello_world artifact
didn't work for me.
This is most likely due to the loader still being brittle.
I suspect that the copying process is buggy, since (un)commenting simple things
such as log messages in rusty-loader will break or fix entry into the kernel.
Until this is fixed this workflow will probably fail sometimes.

Signed-off-by: Jonathan Schwender <[email protected]>
Apparently make doesn't understand quotes and just passes them along
which causes problems with include_env!
`error: couldn't read src/arch/aarch64/"/home/jona/rusty-hermit/loader/data/hello_world_aarch64": No such file or directory (os error 2)`
Removing the quotes fixes this.

Signed-off-by: Jonathan Schwender <[email protected]>
Parts of this commit (especially link.ld) are more or less
directly taken from https://github.com/rust-embedded/rust-raspberrypi-OS-tutorials/blob/master/16_virtual_mem_part4_higher_half_kernel/src/bsp/raspberrypi/link.ld
(MIT License).
I'm not sure if we want to (or already) do virtual addressing in the loader, so
I'm sticking to the physical part for now.

Anyway this seems to fix the problem I had, where the kernel_start and kernel_end
_addresses_ seemingly changed at runtime!

Signed-off-by: Jonathan Schwender <[email protected]>
@stlankes
Copy link
Contributor

bors r+

@bors bors bot merged commit 85567c8 into hermit-os:master May 21, 2021
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.

2 participants