hermit-os / hermit-rs

Hermit for Rust.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Request for info: running hermit-based applications on top of Xen

lyuts opened this issue · comments

commented

Hi guys,

Thank you for this project and your effort, this looks very interesting and promising. Out of curiosity I decided to give a try of hello world in one of test xen installations.

Compiled with

cargo build -Zbuild-std=std,core,alloc,panic_abort -Zbuild-std-features=compiler-builtins-mem --target x86_64-unknown-hermit

I grabbed the produced binary, created an empty initramfs and tried spinning up a domU. Guest failed to run, and I'm getting the following errors in the xl logs.

2022-12-27 02:10:11.988+0000: xc: panic: xc_dom_hvmloader.c:112: xc_dom_parse_hvm_kernel: ELF image is not 32bit: Invalid kernel
2022-12-27 02:10:11.988+0000: libxl: libxl_dom.c:578:libxl__build_dom: xc_dom_parse_image failed
2022-12-27 02:10:11.988+0000: libxl: libxl_create.c:1654:domcreate_rebuild_done: Domain 53:cannot (re-)build domain: -3
$ file target/x86_64-unknown-hermit/debug/unikernel_demo
target/x86_64-unknown-hermit/debug/unikernel_demo: ELF 64-bit LSB pie executable, x86-64, version 1 (embedded), dynamically linked, BuildID[xxHash]=3122861d032a21a2, with debug_info, not stripped

This is probably not a bug, and instead I'm looking for pointers in investigating this or proper ways to run this on Xen. Any bits of information would be useful.
Thank you.

commented

Update: I should confirm that I'm on a 64bit host, and 32 bit error message looks like a red herring. I realized that I'm just feeding in a produced binary as is. I compressed it and I'm now getting a more descriptive error:

xc: panic: xc_dom_core.c:692: xc_dom_find_loader: no loader found: Invalid kernel

which makes sense, and I need to figure out how to bundle both loader and kernel when creating the guest.

Excuse me, I oversaw this issue. I know this issue. Currently, we don't have the time to support Xen.

commented

@stlankes , do you think would it be possible for you and/or other project core team to document Xen support, i.e. issues, blockers, and what bits are missing? I myself would find it very useful for studying the domain, and maybe someone from the community could step up and help with the implementation.