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

Try to build using libhermit-rs #7

Merged
merged 26 commits into from
Nov 17, 2019
Merged

Try to build using libhermit-rs #7

merged 26 commits into from
Nov 17, 2019

Conversation

tomaka
Copy link
Owner

@tomaka tomaka commented Oct 7, 2019

No description provided.

@tomaka
Copy link
Owner Author

tomaka commented Oct 7, 2019

It is cool that the core successfully compiles, but I'd like to have an actual binary, so will delay this until it's the case.

@tomaka
Copy link
Owner Author

tomaka commented Oct 8, 2019

The docker image unfortunately doesn't have rustup or the wasm32-wasi target installed.

@tomaka
Copy link
Owner Author

tomaka commented Oct 10, 2019

Obviously we don't have to build the WASI in the libhermit docker image, but this raises the question of how to properly build all this, and how to design the bootstrapping process (as in: which preloaded processes should be part of the kernel?).

Let's delay this more until it's figured out.

@tomaka
Copy link
Owner Author

tomaka commented Nov 15, 2019

Build is now failing because libm seems to be missing.

@tomaka
Copy link
Owner Author

tomaka commented Nov 16, 2019

The Rust libm story: rust-lang/rust#63455 (comment)

@tomaka
Copy link
Owner Author

tomaka commented Nov 16, 2019

Passing +soft-float doesn't prevent calls to libm: https://rust.godbolt.org/z/jipgAR

@kpp
Copy link

kpp commented Nov 16, 2019

Try -Ctarget-feature=-soft-float

@tomaka
Copy link
Owner Author

tomaka commented Nov 16, 2019

Thanks for the help, but this doesn't change anything :(

@kpp
Copy link

kpp commented Nov 16, 2019

nametbd-standalone-kernel depends on nametbd-core which is built as cargo build --locked --package nametbd-core --target x86_64-unknown-hermit (without -soft-float). Still it's a guess...

@tomaka
Copy link
Owner Author

tomaka commented Nov 16, 2019

I was somehow assuming that this would pass the flag to all dependencies.
I passed -soft-float everywhere now, and I think it doesn't work :(

@kpp
Copy link

kpp commented Nov 16, 2019

docker run -i -t -v tomaka_os/:/os rwthos/hermitcore-rs:latest
cd /os/
RUSTFLAGS="-L/usr/lib/x86_64-linux-gnu/ -Clink-args=-lm" cargo build --package nametbd-standalone-kernel --target x86_64-unknown-hermit

tomaka_os

@tomaka
Copy link
Owner Author

tomaka commented Nov 16, 2019

Oh nice, it's working 🎉
Thank you 🤗

@tomaka
Copy link
Owner Author

tomaka commented Nov 16, 2019

Running the kernel in uhyve yields an unknown instruction error, which I'm assuming is because the kernel terminates.
Running it in qemu doesn't work on my machine, because my qemu is old enough that it doesn't support 64bits kernels 🤦‍♂️

I'm going to merge this PR (maybe after a bit of clean-up), and then probably start working on an actual freestanding code.

@tomaka tomaka merged commit 129127f into master Nov 17, 2019
@tomaka tomaka deleted the try-hermit branch November 17, 2019 13:42
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