hermit-os / hermit-rs Goto Github PK
View Code? Open in Web Editor NEWHermit for Rust.
License: Apache License 2.0
Hermit for Rust.
License: Apache License 2.0
rust-lang/rust#76698 is the reason that the CI failed
Sorry, probably a dumb question, but I run this unikernel on EC2?
rusty-hermit currently does not work using uhyve (on Ubuntu bionic at least). I'm opening this issue so that I can link to all related issues and PRs in one place.
the README.md file misspells rustyhermit as rusyhermit.
The rust-toolchain
file introduced in #54 is a better way than setting the default globally.
But this needs to be reflected in the README
Recently a PR landed on smoltcp that brought async support to the tcp stack. I'm not certain if libhermit-rs or rusty-hermit is directly exposing this api.
So my question: is there any support for async networking already?
Particularly I'm interested in non blocking network IO / green threading when it comes to serving tcp traffic.
I went already thru the code base but couldn't find anything that looks like it, maybe I'm missing something?
Hi,
after new commits I'm not able anymore to build a project with hermit-sys as dependency, it seems related to a change in the build toolchain and config.
Here the log:
error: failed to run custom build command for
hermit-sys v0.1.20
Caused by:
process didn't exit successfully:/home/aproietti/hello_world/target/debug/build/hermit-sys-d0bdb23e975a1f94/build-script-build
(exit status: 101)
--- stdout
cargo:rerun-if-env-changed=HERMIT_IP
cargo:rerun-if-env-changed=HERMIT_GATEWAY
cargo:rerun-if-env-changed=HERMIT_MASK
Build libhermit-rs output-status: exit status: 101
Build libhermit-rs output-stdout:
Build libhermit-rs output-stderr: Updating crates.io index
Compiling compiler_builtins v0.1.39
Compiling core v0.0.0 (/home/aproietti/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
Compiling autocfg v1.0.1
error: Error loading target specification: Could not find specification for target "x86_64-unknown-hermit-kernel". Runrustc --print target-list
for a list of built-in targetserror: could not compile
core
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed--- stderr
thread 'main' panicked at 'assertion failed: output.status.success()', /home/aproietti/.cargo/registry/src/github.com-1ecc6299db9ec823/hermit-sys-0.1.20/build.rs:107:5
note: run withRUST_BACKTRACE=1
environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
This is a very awesome project, just recently discovered it. Now I'm preparing a little talk at the Rust Munich Meetup for which I prepare a little demo.
Nothing fancy, just an echo TCP Server. So far so good, I got the other example (hello world) working.
But for this one I'm not getting the network interface right. I tried qemu
and uhyve
but no luck so far.
qemu-system-x86_64 -netdev socket,id=mynet0,connect=:8080 ....
did not workqemu-system-x86_64 -netdev user,id=mynet0,net=192.168.76.0/24,dhcpstart=192.168.76.9 ...
did not workHERMIT_IP="192.168.76.9" HERMIT_GATEWAY="192.168.76.254" HERMIT_MASK="255.255.255.0" HERMIT_NETIF=mynet0 cargo run --release
for the network above as described for uhyve
The error I'm getting:
...
[0][INFO] Compiled with ACPI support
[0][INFO] Compiled with SMP support
[0][INFO] HermitCore is running on common system!
[INFO] Spawn network thread with id 2
[WARN] Ethernet interface not available
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: "accept failed" }', src/main.rs:9:47
[0][INFO] Number of interrupts
[0][INFO] [0][7]: 3
[0][INFO] Shutting down system
I'm not sure what am I missing. Maybe you could give me a hint how the network interface can be provided.
Many thanks in Advance
Now we have a separation between Rusty Demo and the demo in this repository.
Hi I run (with and without sudo..):
$ qemu-system-x86_64 -cpu qemu64,apic,fsgsbase,rdtscp,xsave,fxsr
-enable-kvm -display none -smp 1 -m 1G -serial stdio
-kernel rusty-loader/target/x86_64-unknown-hermit-loader/debug/rusty-loader
-initrd hello_world/target/x86_64-unknown-hermit/debug/hello_world
-netdev tap,id=net0,ifname=tap10,script=no,downscript=no,vhost=on
-device virtio-net-pci,netdev=net0,disable-legacy=on
on an hello world app with this main.rs:
// src/main.rs
#[cfg(target_os = "hermit")]
extern crate hermit_sys;fn main() {
println!("Hello World!");
}
with this Cargo.toml:
[package]
name = "hello_world"
version = "0.1.0"
authors = ["Alessio Proietti [email protected]"]
edition = "2018"{comment #} See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[target.'cfg(target_os = "hermit")'.dependencies.hermit-sys]
version = "0.1.*"
default-features = false
features = ["smoltcp"][profile.release]
opt-level = 3[profile.dev]
opt-level = 1
But there's no way for it to start correctly (I created the virtual net bridge as for documentation), that's what happens:
[LOADER] Loader: [0x100000 - 0x336018]
[LOADER] Found Multiboot information at 0x9500
[LOADER] Found module: [0x338000 - 0x1872228]
[LOADER] Module length: 0x153a228
[LOADER] Found an ELF module at 0x338000
[LOADER] Map 200 pages at 0x338000 (page size 4 KByte)
[LOADER] Map 11 pages at 0x400000 (page size 2048 KByte)
[LOADER] Allocating 0x268 bytes at 0x133840, index 0
[LOADER] Allocating 0x8B8 bytes at 0x133AC0, index 640
[LOADER] Allocating 0xD0 bytes at 0x1343C0, index 2944
[LOADER] Allocating 0xE0 bytes at 0x1344C0, index 3200
[LOADER] This is a supported HermitCore Application
[LOADER] Found entry point: 0x705c0
[LOADER] File Size: 1122048 Bytes
[LOADER] Mem Size: 1206144 Bytes
[LOADER] start 0x338000, size 0x126780
[LOADER] Load HermitCore Application at 0x1a00000
[LOADER] Found TLS starts at 0x1afabb8 (size 120 Bytes)
[LOADER] BootInfo located at 0x333a90
[LOADER] Use stack address 0x3f8000
[LOADER] Jumping to HermitCore Application Entry Point at 0x4705c0
[0][INFO] Welcome to HermitCore-rs 0.3.48
[0][INFO] Kernel starts at 0x400000
[0][INFO] BSS starts at 0x512000
[0][INFO] TLS starts at 0x1afabb8 (size 120 Bytes)
[0][INFO] Found Multiboot info at 0x9500
[0][INFO] Found cmdline at 0x33704b (size 68)
[0][INFO] Total memory size: 63 MB
[0][INFO] Kernel region: [0x400000 - 0x600000]
[0][INFO] A pure Rust application is running on top of HermitCore!
[0][INFO] Heap: size 48 MB, start address 0x600000
[0][INFO] Heap is located at 0x600000 -- 0x3600000 (0 Bytes unmapped)
[0][INFO]
[0][INFO] ===================== PHYSICAL MEMORY FREE LIST ======================
[0][INFO] 0x00000003600000 - 0x00000003FE0000
[0][INFO] ======================================================================
[0][INFO]
[0][INFO]
[0][INFO] ================== KERNEL VIRTUAL MEMORY FREE LIST ===================
[0][INFO] 0x00000003600000 - 0x00800000000000
[0][INFO] ======================================================================
[0][INFO]
[0][INFO]
[0][INFO] ========================== CPU INFORMATION ===========================
[0][INFO] Model: QEMU Virtual CPU version 2.5+
[0][INFO] Frequency: 2386 MHz (from Measurement)
[0][INFO] SpeedStep Technology: Not Available
[0][INFO] Features: MMX SSE SSE2 SSE3 MCE FXSR XSAVE RDTSCP CLFLUSH HYPERVISOR
[0][INFO] Physical Address Width: 40 bits
[0][INFO] Linear Address Width: 48 bits
[0][INFO] Supports 1GiB Pages: No
[0][INFO] ======================================================================
[0][INFO]
[0][INFO] HermitCore-rs booted on 2021-03-28 at 12:48:44
[0][ERROR] General Protection (#GP) Exception: ExceptionStackFrame {
instruction_pointer: 0x437ca0,
code_segment: 0x8,
cpu_flags: 0x46,
stack_pointer: 0x3ff338,
stack_segment: 0x10,
}, error 0x0
[0][ERROR] fs = 0x1, gs = 0x1
and then it continues to loop printing
[0][ERROR] General Protection (#GP) Exception: ExceptionStackFrame {
instruction_pointer: 0x437ca0,
code_segment: 0x8,
cpu_flags: 0x2,
stack_pointer: 0x3ff080,
stack_segment: 0x10,
}, error 0x0
[0][ERROR] fs = 0x1, gs = 0x1
ad infinitum changin' only the stack pointer...
I can't make any sense out of it.
lscpu out:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 39 bits physical, 48 bits virtual
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 2
Core(s) per socket: 2
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 69
Model name: Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
Stepping: 1
CPU MHz: 1194.586
CPU max MHz: 3000,0000
CPU min MHz: 800,0000
BogoMIPS: 4788.97
Virtualization: VT-x
L1d cache: 64 KiB
L1i cache: 64 KiB
L2 cache: 512 KiB
L3 cache: 4 MiB
NUMA node0 CPU(s): 0-3
Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled
Vulnerability L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown: Mitigation; PTI
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Full generic retpoline, IBPB conditional, IBRS_FW, STIBP conditional, RSB filling
Vulnerability Srbds: Mitigation; Microcode
Vulnerability Tsx async abort: Not affected
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc
arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4
_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriori
ty ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear flush_l1d
f667373 broke networking.
nightly-2021-07-01
works, but when building that one locally, it does not anymore. What am I doing wrong? 🤔
RustyHermit is currently not buildable with the latest version of the nightly compiler. PR rust-lang/rust#74842 will fix this issue.
The execution time of hello_world degraded by about 13% over the last several month.
Version checked in the uhyve repo:
time: [224.29 ms 225.64 ms 226.60 ms]
Current master version with all features enabled, i.e. fsgsbase, pci, acpi:
time: [253.29 ms 255.99 ms 258.55 ms]
Current master version with pci and acpi enabled:
time: [250.02 ms 252.49 ms 254.95 ms]
Current master version with pci enabled:
time: [250.88 ms 254.38 ms 257.67 ms]
Current master version with acpi enabled:
time: [252.18 ms 254.48 ms 256.79 ms]
It seems to be that regardless of which feature is enabled, execution time is slower than it used to be and I am not sure why it is. The version checked in the uhyve repo seems to have at least pci enabled:
ᨂ target/release/uhyve -v benches_data/hello_world_old
[0][INFO] Welcome to HermitCore-rs 0.3.37
[0][INFO] Kernel starts at 0x400000
[0][INFO] BSS starts at 0x5ca000
[0][INFO] TLS starts at 0x553dd0 (size 184 Bytes)
[0][INFO] Total memory size: 64 MB
[0][INFO] Kernel region: [0x400000 - 0x600000]
[0][INFO] A pure Rust application is running on top of HermitCore!
[0][INFO] Heap: size 50 MB, start address 0x600000
[0][INFO] Heap is located at 0x600000 -- 0x3800000 (0 Bytes unmapped)
[0][INFO]
[0][INFO] ===================== PHYSICAL MEMORY FREE LIST ======================
[0][INFO] 0x00000003800000 - 0x00000004000000
[0][INFO] ======================================================================
[0][INFO]
[0][INFO]
[0][INFO] ================== KERNEL VIRTUAL MEMORY FREE LIST ===================
[0][INFO] 0x00000003800000 - 0x00800000000000
[0][INFO] ======================================================================
[0][INFO]
[0][INFO]
[0][INFO] ========================== CPU INFORMATION ===========================
[0][INFO] Model: uhyve - unikernel hypervisor
[0][INFO] Frequency: 3693 MHz (from Hypervisor)
[0][INFO] SpeedStep Technology: Not Available
[0][INFO] Features: MMX SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 AVX AESNI RDRAND FMA MOVBE MCE FXSR XSAVE RDTSCP CLFLUSH TSC-DEADLINE X2APIC HYPERVISOR AVX2 BMI1 BMI2 FSGSBASE
[0][INFO] Physical Address Width: 48 bits
[0][INFO] Linear Address Width: 48 bits
[0][INFO] Supports 1GiB Pages: Yes
[0][INFO] ======================================================================
[0][INFO]
[0][INFO] HermitCore-rs booted on 2020-12-24 at 11:43:26
[0][INFO]
[0][INFO] ======================== PCI BUS INFORMATION =========================
[0][INFO] 00:00 Ethernet controller [0200]: Red Hat, Inc. Virtio network device [1AF4:1000], MemoryBar: 0xc000 (size 0x10)
[0][INFO] ======================================================================
[0][INFO]
[0][INFO] IOAPIC v0 has 1 entries
[0][INFO] HermitCore is running on uhyve!
[0][INFO] Found virtio device with device id 0x1000
[0][WARN] Legacy Virtio devices are not supported, skipping!
[INFO] Spawn network thread with id 2
[WARN] Ethernet interface not available
Hello World!
[0][INFO] Number of interrupts
[0][INFO] [0][7]: 3
As suggested in hermit-os/kernel#60:
I'd think that the following names/locations would be easier to comprehend:
When running rusty-hermit demo on windows or macOS with 2 cores on QEMU the demo gets stuck in the laplace loop. On windows adding a println inside the loop fixes this behaviour for me and the demo runs fine. Can someone explain what is happening here?
The problem only occurs on qemu when
The following is only tested on windows:
With SMP=3 we have the following behaviour:
With SMP=4
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ()', src\arch\x86_64\kernel\scheduler.rs:92:25
Because of this issue hermit-os/kernel#40 is stuck, since the pipeline doesn't complete on windows and mac due to this error.
This Patch fixed the demo for me on windows with SMP=2.
Index: demo/src/tests/laplace.rs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- demo/src/tests/laplace.rs (revision 4b74fa4889f60c27eda89c40d3b22598ffc54ff5)
+++ demo/src/tests/laplace.rs (date 1588778712995)
@@ -55,7 +55,7 @@
iteration(¤t[0], &mut next[0], size_x, size_y);
}
matrix.swap(0, 1);
-
+ println!("Finished laplace iteration {}", counter);
counter += 1;
}
We have disable LFS support, because we synchronize the repository with a git instance, which isn't able to synchronize LFS objects.
5685ca7 broke Rust-level debugging support. While it is still possible to step through assembly code using qemu
or uyhve
, any operation on a higher level, like setting a breakpoint in Rust code, is broken.
As this is caused by relocated code, which apparently confuses gdb
in its current form, there must be a way to properly communicate the relocation details to make it work again.
I noticed this issue while rebasing #124.
While all updates on master since opening the PR bc3db32...fc6de5c seem to be unrelated to virtio, I can't get the netbench to work anymore.
In both debug and release I see two ICMPv6 Multicast Listener Report Messages v2 (143) with Wireshark, but no ARP request for 10.0.5.1
.
Strange that there are different outputs on debug and release...
[0][INFO] Feature set wanted by network driver are in conformance with specification.
[0][ERROR] Device features set, does not satisfy minimal features needed. Aborting!
[0][ERROR] Virtio networkd driver could not be initialized with device: 1041
[INFO] Spawn network thread with id 2
[WARN] Ethernet interface not available
Connecting to the server 10.0.5.1...
Couldn't connect to server...
[0][INFO] Feature set wanted by network driver are in conformance with specification.
[0][INFO] Feature set wanted by network driver are in conformance with specification.
[0][INFO] Driver found a subset of features for virtio device 1041. Features are: [VIRTIO_NET_F_MAC, VIRTIO_NET_F_STATUS, VIRTIO_F_RING_INDIRECT_DESC, VIRTIO_F_VERSION_1, VIRTIO_F_RING_PACKED]
[0][INFO] Features have been negotiated between virtio network device 1041 and driver.
[0][INFO] Created PackedVq: idx=0, size=256
[0][INFO] Created PackedVq: idx=1, size=256
[0][INFO] Network driver successfully initialized virtqueues.
[0][INFO] Device specific initialization for Virtio network defice 1041 finished
[0][INFO] Network device with id 1041, has been initialized by driver!
[0][INFO] Virtio-net link is up after initialization.
[0][INFO] Virtio network driver initialized with Virtio network device.
[0][INFO] Install virtio interrupt handler at line 11
[INFO] Spawn network thread with id 2
[INFO] MAC address 52-54-00-12-34-56
[INFO] Configure network interface with address 10.0.5.3/24
[INFO] Configure gateway with address 10.0.5.1
[INFO] MTU: 1500 bytes
Connecting to the server 10.0.5.1...
Couldn't connect to server...
[0][INFO] Feature set wanted by network driver are in conformance with specification.
[0][INFO] Feature set wanted by network driver are in conformance with specification.
[0][INFO] Driver found a subset of features for virtio device 1041. Features are: [VIRTIO_NET_F_MAC, VIRTIO_NET_F_STATUS, VIRTIO_F_RING_INDIRECT_DESC, VIRTIO_F_VERSION_1]
[0][INFO] Features have been negotiated between virtio network device 1041 and driver.
[0][INFO] Created SplitVq: idx=0, size=256
[0][INFO] Created SplitVq: idx=1, size=256
[0][INFO] Network driver successfully initialized virtqueues.
[0][INFO] Device specific initialization for Virtio network defice 1041 finished
[0][INFO] Network device with id 1041, has been initialized by driver!
[0][INFO] Virtio-net link is up after initialization.
[0][INFO] Virtio network driver initialized with Virtio network device.
[0][INFO] Install virtio interrupt handler at line 11
[INFO] Spawn network thread with id 2
[INFO] MAC address 52-54-00-12-34-56
[INFO] Configure network interface with address 10.0.5.3/24
[INFO] Configure gateway with address 10.0.5.1
[INFO] MTU: 1500 bytes
Connecting to the server 10.0.5.1...
Connection established! Ready to send...
Sent everything!
$ uhyve target/x86_64-unknown-hermit/debug/hello_world
thread 'main' panicked at 'Unable to create VM: OsError(16)', /home/giles/.cargo/registry/src/github.com-1ecc6299db9ec823/uhyve-0.0.23/src/bin/uhyve.rs:181:10
stack backtrace:
0: 0x56016c0fd697 - std::backtrace_rs::backtrace::libunwind::trace::h746c3e9529d524bc
at /rustc/1700ca07c6dd7becff85678409a5df6ad4cf4f47/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
1: 0x56016c0fd697 - std::backtrace_rs::backtrace::trace_unsynchronized::h86340908ff889faa
at /rustc/1700ca07c6dd7becff85678409a5df6ad4cf4f47/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x56016c0fd697 - std::sys_common::backtrace::_print_fmt::h43f85f9b18230404
at /rustc/1700ca07c6dd7becff85678409a5df6ad4cf4f47/library/std/src/sys_common/backtrace.rs:67:5
3: 0x56016c0fd697 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hc132ae1a5b5aa7cd
at /rustc/1700ca07c6dd7becff85678409a5df6ad4cf4f47/library/std/src/sys_common/backtrace.rs:46:22
4: 0x56016c11c5cc - core::fmt::write::hdf023a0036d2a25f
at /rustc/1700ca07c6dd7becff85678409a5df6ad4cf4f47/library/core/src/fmt/mod.rs:1078:17
5: 0x56016c0f85b2 - std::io::Write::write_fmt::h8580846154bcb66a
at /rustc/1700ca07c6dd7becff85678409a5df6ad4cf4f47/library/std/src/io/mod.rs:1519:15
6: 0x56016c0ff805 - std::sys_common::backtrace::_print::h7ee55fed88d107a3
at /rustc/1700ca07c6dd7becff85678409a5df6ad4cf4f47/library/std/src/sys_common/backtrace.rs:49:5
7: 0x56016c0ff805 - std::sys_common::backtrace::print::h54a7d3e52a524177
at /rustc/1700ca07c6dd7becff85678409a5df6ad4cf4f47/library/std/src/sys_common/backtrace.rs:36:9
8: 0x56016c0ff805 - std::panicking::default_hook::{{closure}}::h60921e857bf55a40
at /rustc/1700ca07c6dd7becff85678409a5df6ad4cf4f47/library/std/src/panicking.rs:208:50
9: 0x56016c0ff35a - std::panicking::default_hook::hf0f9afb1017317fc
at /rustc/1700ca07c6dd7becff85678409a5df6ad4cf4f47/library/std/src/panicking.rs:225:9
10: 0x56016c0fffa1 - std::panicking::rust_panic_with_hook::h8d66bf42b407aaea
at /rustc/1700ca07c6dd7becff85678409a5df6ad4cf4f47/library/std/src/panicking.rs:591:17
11: 0x56016c0ffae7 - std::panicking::begin_panic_handler::{{closure}}::hde71edcd925d0c5e
at /rustc/1700ca07c6dd7becff85678409a5df6ad4cf4f47/library/std/src/panicking.rs:497:13
12: 0x56016c0fdb5c - std::sys_common::backtrace::__rust_end_short_backtrace::h8a3c7d6cea578919
at /rustc/1700ca07c6dd7becff85678409a5df6ad4cf4f47/library/std/src/sys_common/backtrace.rs:141:18
13: 0x56016c0ffa49 - rust_begin_unwind
at /rustc/1700ca07c6dd7becff85678409a5df6ad4cf4f47/library/std/src/panicking.rs:493:5
14: 0x56016c11b6f1 - core::panicking::panic_fmt::h20225113c4a2f8fd
at /rustc/1700ca07c6dd7becff85678409a5df6ad4cf4f47/library/core/src/panicking.rs:92:14
15: 0x56016c11b513 - core::option::expect_none_failed::hc6d6d4cea4fdc285
at /rustc/1700ca07c6dd7becff85678409a5df6ad4cf4f47/library/core/src/option.rs:1268:5
16: 0x56016bfd8999 - uhyve::main::h25caef88d415da46
17: 0x56016bfd3823 - std::sys_common::backtrace::__rust_begin_short_backtrace::hbfc576f104f953ad
18: 0x56016bfd3b49 - std::rt::lang_start::{{closure}}::hca78c41f3c1bcf7b
19: 0x56016c1003c7 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h54c39b9b8451875a
at /rustc/1700ca07c6dd7becff85678409a5df6ad4cf4f47/library/core/src/ops/function.rs:259:13
20: 0x56016c1003c7 - std::panicking::try::do_call::hcdfba51a06e21b42
at /rustc/1700ca07c6dd7becff85678409a5df6ad4cf4f47/library/std/src/panicking.rs:379:40
21: 0x56016c1003c7 - std::panicking::try::hb36953ccd24f930d
at /rustc/1700ca07c6dd7becff85678409a5df6ad4cf4f47/library/std/src/panicking.rs:343:19
22: 0x56016c1003c7 - std::panic::catch_unwind::hbb374cd03beb3824
at /rustc/1700ca07c6dd7becff85678409a5df6ad4cf4f47/library/std/src/panic.rs:396:14
23: 0x56016c1003c7 - std::rt::lang_start_internal::h97dca9624db2aa85
at /rustc/1700ca07c6dd7becff85678409a5df6ad4cf4f47/library/std/src/rt.rs:51:25
24: 0x56016bfd8bb2 - main
25: 0x7f3171aadb6b - __libc_start_main
26: 0x56016bfd30ca - _start
27: 0x0 - <unknown>
any ideas?
Since docs.rs has no build for hermit, and with
https://github.com/hermitcore/rusty-hermit/blob/667195d509afd8ea5a4c25ac94e52fe353b49414/hermit-abi/Cargo.toml#L28
We only build doc for x86_64-unknown-hermit
. The latest doc for hermit-abi is https://docs.rs/hermit-abi/0.1.8/hermit_abi/ , where the crates.io version is 0.1.14.
I suggest using CI service to generate doc and publish it to github pages.
Only 0.1.1 is present, but 0.1.5 is on crates.io
I'm one of the maintainers for getrandom
, a no_std
library which attempts to define the "standard" way to get cryptographic entropy on every Rust target. The rand
crate and others use this crate under the hood.
As far as I can tell HermitCore doesn't expose or have a way to get OS-based randomness. For that reason, we don't currently support Hermit.
Are users simply expected to call RDRAND? This is reasonable, provided that HermitCore is x86_64
only.
We found that several math libraries provided by libm were in fact not exposed through the hermit cmath wrapper (sys/cmath.rs), such as pow and log10. This caused linker errors when the compiled program attempted to call these functions.
Consider the following program:
#[cfg(target_os = "hermit")]
extern crate hermit_sys;
fn main() {
println!("{}", 0.42f64.log10());
}
Requires:
@stlankes, in hermit-os/kernel@6cfaee1 for #117 you introduced sys_block_current_task_with_timeout
.
I had a look at using std::thread::park_timeout
instead. It's implemented using std::sync::Condvar::wait_timeout
which is currently not supported on hermit (rust-lang/rust/library/std/src/sys/hermit/condvar.rs).
Do you think, it would be worth the time to add support and go that route instead?
I can't get APIC timer interrupts working on uhyve.
This is why I was looking how rusty-hermit triggers it, but I was unsuccessful in that as well.
I ran the following program on Linux:
use std::thread;
fn main() {
thread::spawn(|| loop {
println!(" 2")
});
loop {
println!("1 ")
}
}
On my host system, this yields both outputs as expected, but running this in rusty-hermit only prints “1 ”.
Is this expected or is rusty-hermit failing to set up uhyve's APIC timer interrupts as well?
Note that I opened this issue in the parent repository, as I am not sure of the scope of this problem.
I'm currently working on hermit-os/kernel#40 and I just can't get the pipeline to work. Compiling (rusty_demo) always fails at the last step with
error: failed to get bitcode from object file for LTO (Bitcode section not found in object file)
This error is also present in the gitlab ci pipeline. At first I couldn't reproduce this issue on my machine.
But after updating my rust nightly I now also run into this issue on my machine.
nightly-x86_64-unknown-linux-gnu updated - rustc 1.45.0-nightly (7ced01a73 2020-04-30) (from rustc 1.44.0-nightly (45d050cde 2020-04-21))
Can anyone else reproduce this?
I am somewhat confused why master and devel branch have diverged so much. As someone new to the codebase I can't even be sure to what exactly the differences are.
From what I've seen the master branch takes hermit-sys from crates.io, and this makes it hard to keep devel and master in sync. What are the benefits in downloading hermit-sys from crates.io versus using hermit-sys with the lib-hermit submodule at a fixed commit?
I'm working with this env:
rustup --version
rustup 1.23.1 (3df2264a9 2020-11-30)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently activerustc
version isrustc 1.50.0-nightly (11c94a197 2020-12-21)
I added to Cargo.toml these lines:
[target.'cfg(target_os = "hermit")'.dependencies]
hermit-sys = "0.1.*"
default-features = false
features = ["smoltcp"]
First the IDE complains but that's ok for me, the fact is also the compiler doens't build, that's the error:
$ HERMIT_IP="10.0.5.100" cargo build -Z build-std=std,core,alloc,panic_abort --target x86_64-unknown-hermit
error: failed to parse manifest at
/home/me/hello_world/Cargo.toml
Caused by:
invalid type: booleanfalse
, expected a version string like "0.9.8" or a detailed dependency like { version = "0.9.8" } for key
target.cfg(target_os = "hermit").dependencies.default-features
I dind't expect this at this basic level.
++EDIT++
This works, consider to review the doc. I can do it anyway.
[target.'cfg(target_os = "hermit")'.dependencies.hermit-sys]
version = "0.1.*"
default-features = false
features = ["smoltcp"]
The current compiler creates invalid code, if we enable LTO support. Consequently, we disable temporary the support.
There is no issue section at hermitcore/rust so I'm opening this issue here.
Rust CONTRIBUTING.md states that
Rust follows a no merge policy, meaning, when you encounter merge conflicts you are expected to always rebase instead of merge. E.g. always use rebase when bringing the latest changes from the master branch to your feature branch. Also, please make sure that fixup commits are squashed into other related commits with meaningful commit messages.
However hermitcore/rust does contain a current merge commit. So I would suggest to drop that commit and rebase instead.
What is the current process for PRs regarding changes in stdlib? Should I open a PR against hermitcore/rust and once that's approved @stlankes opens a PR in rust-lang/rust?
When installing uhyve via cargo install uhyve
as described in the readme, it fails with the error output listed below. However, installing it via $ cargo +nightly install uhyve --locked
as described in the uhyve readme works without an error.
[harryr@coruscant hello_world]$ cargo install uhyve
Updating crates.io index
Installing uhyve v0.0.28
Compiling libc v0.2.103
Compiling bitflags v1.3.2
Compiling proc-macro2 v1.0.29
Compiling unicode-xid v0.2.2
Compiling cfg-if v1.0.0
Compiling syn v1.0.80
Compiling memchr v2.4.1
Compiling autocfg v1.0.1
Compiling winapi-build v0.1.1
Compiling log v0.4.14
Compiling cc v1.0.71
Compiling winapi v0.2.8
Compiling x86 v0.37.0
Compiling unicode-width v0.1.9
Compiling unicode-segmentation v1.8.0
Compiling regex-syntax v0.6.25
Compiling strsim v0.8.0
Compiling bit_field v0.10.1
Compiling plain v0.2.3
Compiling termcolor v1.1.2
Compiling ansi_term v0.11.0
Compiling humantime v2.1.0
Compiling vec_map v0.8.2
Compiling lazy_static v1.4.0
Compiling rustc-serialize v0.3.24
Compiling strum v0.20.0
Compiling virtio-bindings v0.1.0
Compiling burst v0.0.2
Compiling byteorder v1.4.3
Compiling kvm-bindings v0.4.0
Compiling raw-cpuid v9.1.1
Compiling kernel32-sys v0.2.2
Compiling memoffset v0.6.4
Compiling textwrap v0.11.0
Compiling heck v0.3.3
Compiling tun-tap v0.1.2
Compiling aho-corasick v0.7.18
Compiling gdb-protocol v0.1.0
Compiling quote v1.0.10
Compiling regex v1.5.4
Compiling atty v0.2.14
Compiling vmm-sys-util v0.9.0
Compiling nix v0.22.0
Compiling num_cpus v1.13.0
Compiling memchr v1.0.2
Compiling nix v0.20.0
Compiling vmm-sys-util v0.8.0
Compiling aligned_alloc v0.1.3
Compiling clap v2.33.3
Compiling env_logger v0.8.4
Compiling kvm-bindings v0.5.0
Compiling core_affinity v0.5.10
Compiling nom v3.2.1
Compiling kvm-ioctls v0.8.0
Compiling mac_address v1.1.2
Compiling scroll_derive v0.10.5
Compiling strum_macros v0.20.1
Compiling scroll v0.10.2
Compiling goblin v0.4.3
Compiling uhyve v0.0.28
error[E0433]: failed to resolve: use of undeclared type `Msrs`
--> /home/harryr/.cargo/registry/src/github.com-1ecc6299db9ec823/uhyve-0.0.28/src/linux/vcpu.rs:154:14
|
154 | let msrs = Msrs::from_entries(&msr_entries)
| ^^^^ use of undeclared type `Msrs`
error[E0425]: cannot find value `KVM_MAX_CPUID_ENTRIES` in this scope
--> /home/harryr/.cargo/registry/src/github.com-1ecc6299db9ec823/uhyve-0.0.28/src/linux/vcpu.rs:59:25
|
59 | .get_supported_cpuid(KVM_MAX_CPUID_ENTRIES)
| ^^^^^^^^^^^^^^^^^^^^^ not found in this scope
error[E0308]: mismatched types
--> /home/harryr/.cargo/registry/src/github.com-1ecc6299db9ec823/uhyve-0.0.28/src/linux/uhyve.rs:185:38
|
185 | unsafe { vm.set_user_memory_region(kvm_mem) }.or_else(to_error)?;
| ^^^^^^^ expected struct `kvm_bindings::x86::bindings::kvm_userspace_memory_region`, found struct `kvm_bindings::kvm_userspace_memory_region`
error[E0308]: mismatched types
--> /home/harryr/.cargo/registry/src/github.com-1ecc6299db9ec823/uhyve-0.0.28/src/linux/uhyve.rs:198:39
|
198 | unsafe { vm.set_user_memory_region(kvm_mem) }.or_else(to_error)?;
| ^^^^^^^ expected struct `kvm_bindings::x86::bindings::kvm_userspace_memory_region`, found struct `kvm_bindings::kvm_userspace_memory_region`
error[E0308]: mismatched types
--> /home/harryr/.cargo/registry/src/github.com-1ecc6299db9ec823/uhyve-0.0.28/src/linux/uhyve.rs:214:17
|
214 | vm.enable_cap(&cap)
| ^^^^ expected struct `kvm_bindings::x86::bindings::kvm_enable_cap`, found struct `kvm_bindings::kvm_enable_cap`
|
= note: expected reference `&kvm_bindings::x86::bindings::kvm_enable_cap`
found reference `&kvm_bindings::kvm_enable_cap`
error[E0308]: mismatched types
--> /home/harryr/.cargo/registry/src/github.com-1ecc6299db9ec823/uhyve-0.0.28/src/linux/uhyve.rs:224:20
|
224 | if vm.enable_cap(&cap).is_ok() {
| ^^^^ expected struct `kvm_bindings::x86::bindings::kvm_enable_cap`, found struct `kvm_bindings::kvm_enable_cap`
|
= note: expected reference `&kvm_bindings::x86::bindings::kvm_enable_cap`
found reference `&kvm_bindings::kvm_enable_cap`
error[E0308]: mismatched types
--> /home/harryr/.cargo/registry/src/github.com-1ecc6299db9ec823/uhyve-0.0.28/src/linux/uhyve.rs:232:20
|
232 | if vm.enable_cap(&cap).is_ok() {
| ^^^^ expected struct `kvm_bindings::x86::bindings::kvm_enable_cap`, found struct `kvm_bindings::kvm_enable_cap`
|
= note: expected reference `&kvm_bindings::x86::bindings::kvm_enable_cap`
found reference `&kvm_bindings::kvm_enable_cap`
error[E0308]: mismatched types
--> /home/harryr/.cargo/registry/src/github.com-1ecc6299db9ec823/uhyve-0.0.28/src/linux/uhyve.rs:244:17
|
244 | vm.enable_cap(&cap)
| ^^^^ expected struct `kvm_bindings::x86::bindings::kvm_enable_cap`, found struct `kvm_bindings::kvm_enable_cap`
|
= note: expected reference `&kvm_bindings::x86::bindings::kvm_enable_cap`
found reference `&kvm_bindings::kvm_enable_cap`
error[E0308]: mismatched types
--> /home/harryr/.cargo/registry/src/github.com-1ecc6299db9ec823/uhyve-0.0.28/src/linux/uhyve.rs:248:21
|
248 | vm.register_irqfd(&evtfd, UHYVE_IRQ_NET).or_else(to_error)?;
| ^^^^^^ expected struct `vmm_sys_util::linux::eventfd::EventFd`, found struct `EventFd`
|
= note: expected reference `&vmm_sys_util::linux::eventfd::EventFd`
found reference `&EventFd`
= note: perhaps two different versions of crate `vmm_sys_util` are being used?
error[E0308]: mismatched types
--> /home/harryr/.cargo/registry/src/github.com-1ecc6299db9ec823/uhyve-0.0.28/src/linux/vcpu.rs:192:14
|
192 | sregs.cs = seg;
| ^^^ expected struct `kvm_bindings::x86::bindings::kvm_segment`, found struct `kvm_bindings::kvm_segment`
error[E0308]: mismatched types
--> /home/harryr/.cargo/registry/src/github.com-1ecc6299db9ec823/uhyve-0.0.28/src/linux/vcpu.rs:197:14
|
197 | sregs.ds = seg;
| ^^^ expected struct `kvm_bindings::x86::bindings::kvm_segment`, found struct `kvm_bindings::kvm_segment`
error[E0308]: mismatched types
--> /home/harryr/.cargo/registry/src/github.com-1ecc6299db9ec823/uhyve-0.0.28/src/linux/vcpu.rs:198:14
|
198 | sregs.es = seg;
| ^^^ expected struct `kvm_bindings::x86::bindings::kvm_segment`, found struct `kvm_bindings::kvm_segment`
error[E0308]: mismatched types
--> /home/harryr/.cargo/registry/src/github.com-1ecc6299db9ec823/uhyve-0.0.28/src/linux/vcpu.rs:199:14
|
199 | sregs.ss = seg;
| ^^^ expected struct `kvm_bindings::x86::bindings::kvm_segment`, found struct `kvm_bindings::kvm_segment`
error[E0308]: mismatched types
--> /home/harryr/.cargo/registry/src/github.com-1ecc6299db9ec823/uhyve-0.0.28/src/linux/vcpu.rs:495:33
|
495 | UhyveCPU::show_segment("cs ", &sregs.cs);
| ^^^^^^^^^ expected struct `kvm_bindings::kvm_segment`, found struct `kvm_bindings::x86::bindings::kvm_segment`
|
= note: expected reference `&kvm_bindings::kvm_segment`
found reference `&kvm_bindings::x86::bindings::kvm_segment`
error[E0308]: mismatched types
--> /home/harryr/.cargo/registry/src/github.com-1ecc6299db9ec823/uhyve-0.0.28/src/linux/vcpu.rs:496:33
|
496 | UhyveCPU::show_segment("ss ", &sregs.ss);
| ^^^^^^^^^ expected struct `kvm_bindings::kvm_segment`, found struct `kvm_bindings::x86::bindings::kvm_segment`
|
= note: expected reference `&kvm_bindings::kvm_segment`
found reference `&kvm_bindings::x86::bindings::kvm_segment`
error[E0308]: mismatched types
--> /home/harryr/.cargo/registry/src/github.com-1ecc6299db9ec823/uhyve-0.0.28/src/linux/vcpu.rs:497:33
|
497 | UhyveCPU::show_segment("ds ", &sregs.ds);
| ^^^^^^^^^ expected struct `kvm_bindings::kvm_segment`, found struct `kvm_bindings::x86::bindings::kvm_segment`
|
= note: expected reference `&kvm_bindings::kvm_segment`
found reference `&kvm_bindings::x86::bindings::kvm_segment`
error[E0308]: mismatched types
--> /home/harryr/.cargo/registry/src/github.com-1ecc6299db9ec823/uhyve-0.0.28/src/linux/vcpu.rs:498:33
|
498 | UhyveCPU::show_segment("es ", &sregs.es);
| ^^^^^^^^^ expected struct `kvm_bindings::kvm_segment`, found struct `kvm_bindings::x86::bindings::kvm_segment`
|
= note: expected reference `&kvm_bindings::kvm_segment`
found reference `&kvm_bindings::x86::bindings::kvm_segment`
error[E0308]: mismatched types
--> /home/harryr/.cargo/registry/src/github.com-1ecc6299db9ec823/uhyve-0.0.28/src/linux/vcpu.rs:499:33
|
499 | UhyveCPU::show_segment("fs ", &sregs.fs);
| ^^^^^^^^^ expected struct `kvm_bindings::kvm_segment`, found struct `kvm_bindings::x86::bindings::kvm_segment`
|
= note: expected reference `&kvm_bindings::kvm_segment`
found reference `&kvm_bindings::x86::bindings::kvm_segment`
error[E0308]: mismatched types
--> /home/harryr/.cargo/registry/src/github.com-1ecc6299db9ec823/uhyve-0.0.28/src/linux/vcpu.rs:500:33
|
500 | UhyveCPU::show_segment("gs ", &sregs.gs);
| ^^^^^^^^^ expected struct `kvm_bindings::kvm_segment`, found struct `kvm_bindings::x86::bindings::kvm_segment`
|
= note: expected reference `&kvm_bindings::kvm_segment`
found reference `&kvm_bindings::x86::bindings::kvm_segment`
error[E0308]: mismatched types
--> /home/harryr/.cargo/registry/src/github.com-1ecc6299db9ec823/uhyve-0.0.28/src/linux/vcpu.rs:501:33
|
501 | UhyveCPU::show_segment("tr ", &sregs.tr);
| ^^^^^^^^^ expected struct `kvm_bindings::kvm_segment`, found struct `kvm_bindings::x86::bindings::kvm_segment`
|
= note: expected reference `&kvm_bindings::kvm_segment`
found reference `&kvm_bindings::x86::bindings::kvm_segment`
error[E0308]: mismatched types
--> /home/harryr/.cargo/registry/src/github.com-1ecc6299db9ec823/uhyve-0.0.28/src/linux/vcpu.rs:502:33
|
502 | UhyveCPU::show_segment("ldt", &sregs.ldt);
| ^^^^^^^^^^ expected struct `kvm_bindings::kvm_segment`, found struct `kvm_bindings::x86::bindings::kvm_segment`
|
= note: expected reference `&kvm_bindings::kvm_segment`
found reference `&kvm_bindings::x86::bindings::kvm_segment`
error[E0308]: mismatched types
--> /home/harryr/.cargo/registry/src/github.com-1ecc6299db9ec823/uhyve-0.0.28/src/linux/vcpu.rs:503:32
|
503 | UhyveCPU::show_dtable("gdt", &sregs.gdt);
| ^^^^^^^^^^ expected struct `kvm_bindings::kvm_dtable`, found struct `kvm_bindings::x86::bindings::kvm_dtable`
|
= note: expected reference `&kvm_bindings::kvm_dtable`
found reference `&kvm_bindings::x86::bindings::kvm_dtable`
error[E0308]: mismatched types
--> /home/harryr/.cargo/registry/src/github.com-1ecc6299db9ec823/uhyve-0.0.28/src/linux/vcpu.rs:504:32
|
504 | UhyveCPU::show_dtable("idt", &sregs.idt);
| ^^^^^^^^^^ expected struct `kvm_bindings::kvm_dtable`, found struct `kvm_bindings::x86::bindings::kvm_dtable`
|
= note: expected reference `&kvm_bindings::kvm_dtable`
found reference `&kvm_bindings::x86::bindings::kvm_dtable`
Some errors have detailed explanations: E0308, E0425, E0433.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `uhyve` due to 23 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `uhyve v0.0.28`, intermediate artifacts can be found at `/tmp/cargo-installC4LKl0`
Caused by:
build failed
Following the instructions listed I get the following output when building. Have I screwed something up or could this be due to a change in rustup / cargo / a dependency?
workspace: /home/blake/rusty-hermit/Cargo.toml
Compiling hermit-sys v0.1.20 (/home/blake/rusty-hermit/hermit-sys)
error: failed to run custom build command for `hermit-sys v0.1.20 (/home/blake/rusty-hermit/hermit-sys)`
Caused by:
process didn't exit successfully: `/home/blake/rusty-hermit/target/debug/build/hermit-sys-03bff9ac0a04dba9/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-env-changed=HERMIT_IP
cargo:rerun-if-env-changed=HERMIT_GATEWAY
cargo:rerun-if-env-changed=HERMIT_MASK
Build libhermit-rs output-status: exit code: 101
Build libhermit-rs output-stdout:
Build libhermit-rs output-stderr: warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package: /home/blake/rusty-hermit/benches/netbench/Cargo.toml
workspace: /home/blake/rusty-hermit/Cargo.toml
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package: /home/blake/rusty-hermit/benches/micro/Cargo.toml
workspace: /home/blake/rusty-hermit/Cargo.toml
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package: /home/blake/rusty-hermit/examples/hello_world/Cargo.toml
workspace: /home/blake/rusty-hermit/Cargo.toml
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package: /home/blake/rusty-hermit/examples/httpd/Cargo.toml
workspace: /home/blake/rusty-hermit/Cargo.toml
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package: /home/blake/rusty-hermit/examples/demo/Cargo.toml
workspace: /home/blake/rusty-hermit/Cargo.toml
Compiling lazy_static v1.4.0
Compiling libc v0.2.81
Compiling bitflags v1.2.1
Compiling cfg-if v0.1.10
Compiling bit_field v0.10.1
Compiling libm v0.2.1
Compiling cfg-if v1.0.0
Compiling memoffset v0.6.1
Compiling scopeguard v1.1.0
Compiling unicode-width v0.1.8
Compiling strsim v0.8.0
Compiling matches v0.1.8
error[E0463]: can't find crate for `std`
--> /home/blake/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/inline_lazy.rs:9:1
|
9 | extern crate std;
| ^^^^^^^^^^^^^^^^^ can't find crate
|
= note: the `x86_64-unknown-hermit-kernel` target may not be installed
Compiling ansi_term v0.11.0
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
error: could not compile `lazy_static`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error[E0463]: can't find crate for `std`
|
= note: the `x86_64-unknown-hermit-kernel` target may not be installed
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
error[E0463]: can't find crate for `std`
|
= note: the `x86_64-unknown-hermit-kernel` target may not be installed
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
error[E0463]: can't find crate for `std`
|
= note: the `x86_64-unknown-hermit-kernel` target may not be installed
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
error: build failed
like @jbreitbart suggestion in #50, we should use criterion for the benchmarks
The simple hello-world does not work for me with the hermit-sys version published at crates.io:
[target.'cfg(target_os = "hermit")'.dependencies]
hermit-sys = "0.1.*"
> cargo build -Z build-std=std,core,alloc,panic_abort --target x86_64-unknown-hermit
> uhyve target/x86_64-unknown-hermit/debug/hermit-new
Dump state of CPU 0
Registers:
----------
kvm_regs { rax: 74639, rbx: 74352, rcx: 3110704, rdx: 2, rsi: 2133240, rdi: 73760, rsp: 73728, rbp: 1, r8: 74186, r9: 6
, r10: 0, r11: 0, r12: 2, r13: 2133240, r14: 73760, r15: 2133240, rip: 3113744, rflags: 65554 }kvm_sregs { cs: kvm_segm
ent { base: 0, limit: 0, selector: 8, type_: 11, present: 1, dpl: 0, db: 0, s: 1, l: 1, g: 0, avl: 0, unusable: 0, padd
[...]
does run the program, but I don't get any output. It only prints the registers. However, if I use hermit-sys
from the master branch, println
works.
[target.'cfg(target_os = "hermit")'.dependencies]
hermit-sys = {path = "../rusty-hermit/hermit-sys"}
> cargo build -Z build-std=std,core,alloc,panic_abort --target x86_64-unknown-hermit
> uhyve target/x86_64-unknown-hermit/debug/hermit-new
Hello World!
Rusty-demo runs fine until the end using qemu on WSL2, however it crashes after the last test has finished ( somewhere after main returns). It is then stuck and the qemu process does not end.
This does not happen when using the integration tests in libhermit-rs, however those are exited via the debug device in qemu.
I'll do some further investigating when I have the time.
Update: This seems to be a general problem, since this is also happening in CI - See https://github.com/jschwe/rusty-hermit/runs/1192410905 .
$ qemu-system-x86_64 -cpu qemu64,apic,fsgsbase,rdtscp,xsave,fxsr -display none -smp 1 -m 1G -serial stdio -kernel loader/target/x86_64-unknown-hermit-loader/debug/rusty-loader -initrd target/x86_64-unknown-hermit/debug/rusty_demo
[LOADER] Loader: [0x100000 - 0x336018]
[LOADER] Found Multiboot information at 0x9500
[LOADER] Found module: [0x338000 - 0x205af10]
[LOADER] Module length: 0x1d22f10
[LOADER] Found an ELF module at 0x338000
[LOADER] Map 200 pages at 0x338000 (page size 4 KByte)
[LOADER] Map 15 pages at 0x400000 (page size 2048 KByte)
[LOADER] Allocating 0x268 bytes at 0x133E00, index 0
[LOADER] Allocating 0x8B8 bytes at 0x134080, index 640
[LOADER] Allocating 0xD0 bytes at 0x134980, index 2944
[LOADER] Allocating 0xE0 bytes at 0x134A80, index 3200
[LOADER] This is a supported HermitCore Application
[LOADER] Found entry point: 0x197710
[LOADER] File Size: 3094321 Bytes
[LOADER] Mem Size: 3104840 Bytes
[LOADER] start 0x338000, size 0x2f6048
[LOADER] Load HermitCore Application at 0x2200000
[LOADER] Found TLS starts at 0x2469e78 (size 304 Bytes)
[LOADER] BootInfo located at 0x133140
[LOADER] Use stack address 0x3f8000
[LOADER] Jumping to HermitCore Application Entry Point at 0x597710
[0][INFO] Welcome to HermitCore-rs 0.3.40
[0][INFO] Kernel starts at 0x400000
[0][INFO] BSS starts at 0x6f3780
[0][INFO] TLS starts at 0x2469e78 (size 304 Bytes)
[0][INFO] Found Multiboot info at 0x9500
[0][INFO] Found cmdline at 0x33703e (size 62)
[0][INFO] Total memory size: 1023 MB
[0][INFO] Kernel region: [0x400000 - 0x800000]
[0][INFO] A pure Rust application is running on top of HermitCore!
[0][INFO] Heap: size 910 MB, start address 0x800000
[0][INFO] Heap is located at 0x800000 -- 0x39600000 (0 Bytes unmapped)
[0][INFO]
[0][INFO] ===================== PHYSICAL MEMORY FREE LIST ======================
[0][INFO] 0x00000039600000 - 0x0000003FFE0000
[0][INFO] ======================================================================
[0][INFO]
[0][INFO]
[0][INFO] ================== KERNEL VIRTUAL MEMORY FREE LIST ===================
[0][INFO] 0x00000039600000 - 0x00800000000000
[0][INFO] ======================================================================
[0][INFO]
[0][INFO]
[0][INFO] ========================== CPU INFORMATION ===========================
[0][INFO] Model: QEMU Virtual CPU version 2.5+
[0][INFO] Frequency: 2589 MHz (from Measurement)
[0][INFO] SpeedStep Technology: Not Available
[0][INFO] Features: MMX SSE SSE2 SSE3 MCE FXSR XSAVE RDTSCP CLFLUSH HYPERVISOR FSGSBASE
[0][INFO] Physical Address Width: 40 bits
[0][INFO] Linear Address Width: 48 bits
[0][INFO] Supports 1GiB Pages: No
[0][INFO] ======================================================================
[0][INFO]
[0][INFO] HermitCore-rs booted on 2020-10-01 at 09:28:46
[0][WARN] PCI Device @8086:7000 has multiple functions! Currently only one is handled.
[0][INFO]
[0][INFO] ======================== PCI BUS INFORMATION =========================
[0][INFO] 00:00 Host bridge [0600]: Intel Corporation 440FX - 82441FX PMC [Natoma] [8086:1237]
[0][INFO] 00:01 ISA bridge [0601]: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II] [8086:7000]
[0][INFO] 00:02 VGA compatible controller [0300]: Unknown Vendor Unknown Device [1234:1111], MemoryBar: 0xfd000000 (size 0x1000000), MemoryBar: 0xfebb0000 (size 0x1000)
[0][INFO] 00:03 Ethernet controller [0200]: Intel Corporation 82540EM Gigabit Ethernet Controller [8086:100E], IRQ 11, MemoryBar: 0xfeb80000 (size 0x20000), IOBar: 0xc000 (size 0x40)
[0][INFO] ======================================================================
[0][INFO]
[0][INFO] Found an ACPI revision 0 table at 0xF5AD0 with OEM ID "BOCHS "
[0][INFO] IOAPIC v32 has 24 entries
[0][INFO] Disable IOAPIC timer
[0][INFO]
[0][INFO] ===================== MULTIPROCESSOR INFORMATION =====================
[0][INFO] APIC in use: xAPIC
[0][INFO] Initialized CPUs: 1
[0][INFO] ======================================================================
[0][INFO]
[0][INFO] HermitCore is running on common system!
[INFO] Spawn network thread with id 2
[WARN] Ethernet interface not available
Hello, world!
Привет мир!
こんにちは世界
你好,世界
สวัสดีชาวโลก
Chào thế giới
Crab emoji: 🦀
Test hello ... ok
x = 23.87, e^x = 23259977111.3123, ln(e^x) = 23.87
Test arithmetic ... ok
argument[0] = {name}
Test print_argv ... ok
Test print_env ... ok
[0][INFO] Trying to open file on non-existing mount point 'etc'!
Test read_file ... failed!
[0][INFO] Trying to open file on non-existing mount point 'tmp'!
Test create_file ... failed!
this is thread number 0
this is thread number 1
Test threading ... ok
Pi: 3.141592653589587 (sequential)
Test pi_sequential ... ok
Pi: 3.1415926535897665 (with 2 threads)
Test pi_parallel ... ok
Time to solve 18.27907 s, iterations 1000, residuum 0.000804262515677571
Test laplace ... ok
Time to multiply matrix 24.962718 s
Test test_matmul_strassen ... ok
Time to create and to join a thread: 88880003 ticks
Test thread_creation ... ok
[0][ERROR] General Protection (#GP) Exception: ExceptionStackFrame {
instruction_pointer: 0xf000ff53f000ff53,
code_segment: 0x8,
cpu_flags: 0x1206,
stack_pointer: 0x39645d28,
stack_segment: 0x10,
}, error 0x0
[0][ERROR] fs = 0x802340, gs = 0x6F4C80
Since LLVM 12 (rust-lang/rust#84230) ExceptionStackFrame
has to be taken by value. See rust-lang/rust#40180 (comment).
Current output of ud2
:
[0][ERROR] Invalid Opcode (#UD) Exception: ExceptionStackFrame {
instruction_pointer: 0xc35b30c483480b0f,
code_segment: 0xee9d058af2894850,
cpu_flags: 0x3d8d48f76348ffff,
stack_pointer: 0x7e8ffffffcc,
stack_segment: 0xccccccccccc35900,
}
Expected:
[0][ERROR] Invalid Opcode (#UD) Exception: ExceptionStackFrame {
instruction_pointer: 0x501738,
code_segment: 0x8,
cpu_flags: 0x11206,
stack_pointer: 0x373be30,
stack_segment: 0x10,
}
Some annoying warnings show up in the CI. Should be easy to fix
Github has a new feature, that you can specify how to cite a project. I guess this totally makes sense for all Hermitcore Projects.
Tested with master branch at a2d6425:
netbench
in workspace members in top level Cargo.toml
with_submodule
feature from hermit-sys dependencies in demo/Cargo.toml
cargo build -Z build-std=std,core,alloc,panic_abort --target x86_64-unknown-hermit
qemu-system-x86_64 -display none -smp 2 -m 128M -serial stdio -kernel loader/target/x86_64-unknown-hermit-loader/debug/rusty-loader -initrd target/x86_64-unknown-hermit/debug/rusty_demo -cpu qemu64,apic,fsgsbase,rdtscp,xsave,fxsr
This results in a bootloop:
[LOADER] Started
[LOADER] Found Multiboot information at 0x9500
[LOADER] Found module: [0x115000 - 0x1cb31c8]
[LOADER] Found an ELF module at 0x115000
[LOADER] This is a supported HermitCore Application
[LOADER] Found TLS starts at 0x47e2e8 (size 304 Bytes)
[LOADER] File Size: 2627912 Bytes
[LOADER] Mem Size: 2638256 Bytes
[LOADER] Use 2 large pages for the application.
[LOADER] Clear BSS from 0x481948 to 0x4841b0
[LOADER] BootInfo located at 0x111420
[LOADER] Use stack address 0x1f8000
[LOADER] Jumping to HermitCore Application Entry Point at 0x3DC950
[LOADER] Started
[LOADER] Found Multiboot information at 0x9500
[LOADER] Found module: [0x115000 - 0x1cb31c8]
[LOADER] Found an ELF module at 0x115000
[LOADER] This is a supported HermitCore Application
[LOADER] Found TLS starts at 0x47e2e8 (size 304 Bytes)
[LOADER] File Size: 2627912 Bytes
[LOADER] Mem Size: 2638256 Bytes
[LOADER] Use 2 large pages for the application.
[LOADER] Clear BSS from 0x481948 to 0x4841b0
[LOADER] BootInfo located at 0x111420
[LOADER] Use stack address 0x1f8000
[LOADER] Jumping to HermitCore Application Entry Point at 0x3DC950
[LOADER] Started
[LOADER] Found Multiboot information at 0x9500
[LOADER] Found module: [0x115000 - 0x1cb31c8]
[LOADER] Found an ELF module at 0x115000
[LOADER] This is a supported HermitCore Application
[LOADER] Found TLS starts at 0x47e2e8 (size 304 Bytes)
[LOADER] File Size: 2627912 Bytes
[LOADER] Mem Size: 2638256 Bytes
[LOADER] Use 2 large pages for the application.
[LOADER] Clear BSS from 0x481948 to 0x4841b0
[LOADER] BootInfo located at 0x111420
[LOADER] Use stack address 0x1f8000
[LOADER] Jumping to HermitCore Application Entry Point at 0x3DC950
[LOADER] Started
Due changes to Rust, we have to revise the mutex interface. A pull request is already created (rust-lang/rust#77610) and we have to wait for the review.
As reported in #7 building the rusty-demo with LTO doesn't work with rust nightlies newer than 2020-04-29. If this doesn't resolve by itself we should investigate what changed and if this requires any changes on our end in order to reenable LTO.
The error that gets printed when linking is the following:
error: failed to get bitcode from object file for LTO (Bitcode section not found in object file)
As a temporary workaround LTO was disabled in the release profile in #14
Just as proposed in hermit-os/kernel#46 . This is the twin issue for rusty-hermit
Currently it seems that all tests only use rusty-hermit on Qemu. Travis CI has nested virtualization enabled by default (seems to be a recent change). This enables us to test rusty-hermit using uhyve.
I'm currently working on a travis pipeline and I'll be opening a pull request for this.
Meanwhile I'd like to link the following two uhyve issues here, which are important for CI.
I noticed that when building rusty-hermit with -vv
there are some errors reported on stdout, that however don't cause the build to fail, and are only visible when running with very verbose.
The errors seem to originate from the crossbeam dependency in hermit-sys. Should this be investigated, or can these errors be safely ignored?
Running `C:\Dev\rs-hermit\target\release\build\crossbeam-utils-1a9866fe0fb2eff0\build-script-build`
[crossbeam-utils 0.7.2] error[E0463]: can't find crate for `std`
[crossbeam-utils 0.7.2] |
[crossbeam-utils 0.7.2] = note: the `x86_64-unknown-hermit` target may not be installed
[crossbeam-utils 0.7.2]
[crossbeam-utils 0.7.2] error: aborting due to previous error
[crossbeam-utils 0.7.2]
[crossbeam-utils 0.7.2] For more information about this error, try `rustc --explain E0463`.
[crossbeam-utils 0.7.2] error[E0463]: can't find crate for `core`
[crossbeam-utils 0.7.2] |
[crossbeam-utils 0.7.2] = note: the `x86_64-unknown-hermit` target may not be installed
[crossbeam-utils 0.7.2]
[crossbeam-utils 0.7.2] error: aborting due to previous error
[crossbeam-utils 0.7.2]
[crossbeam-utils 0.7.2] For more information about this error, try `rustc --explain E0463`.
[crossbeam-utils 0.7.2] warning: autocfg could not probe for `std`
[crossbeam-utils 0.7.2] cargo:rustc-cfg=has_min_const_fn
[crossbeam-utils 0.7.2] error[E0463]: can't find crate for `std`
[crossbeam-utils 0.7.2] |
[crossbeam-utils 0.7.2] = note: the `x86_64-unknown-hermit` target may not be installed
[crossbeam-utils 0.7.2]
[crossbeam-utils 0.7.2] error: aborting due to previous error
[crossbeam-utils 0.7.2]
[crossbeam-utils 0.7.2] For more information about this error, try `rustc --explain E0463`.
[crossbeam-utils 0.7.2] error[E0463]: can't find crate for `std`
[crossbeam-utils 0.7.2] |
[crossbeam-utils 0.7.2] = note: the `x86_64-unknown-hermit` target may not be installed
[crossbeam-utils 0.7.2]
[crossbeam-utils 0.7.2] error: aborting due to previous error
[crossbeam-utils 0.7.2]
[crossbeam-utils 0.7.2] For more information about this error, try `rustc --explain E0463`.
[crossbeam-utils 0.7.2] error[E0463]: can't find crate for `std`
[crossbeam-utils 0.7.2] |
[crossbeam-utils 0.7.2] = note: the `x86_64-unknown-hermit` target may not be installed
[crossbeam-utils 0.7.2]
[crossbeam-utils 0.7.2] error: aborting due to previous error
[crossbeam-utils 0.7.2]
[crossbeam-utils 0.7.2] For more information about this error, try `rustc --explain E0463`.
[crossbeam-utils 0.7.2] error[E0463]: can't find crate for `std`
[crossbeam-utils 0.7.2] |
[crossbeam-utils 0.7.2] = note: the `x86_64-unknown-hermit` target may not be installed
[crossbeam-utils 0.7.2]
[crossbeam-utils 0.7.2] error: aborting due to previous error
[crossbeam-utils 0.7.2]
[crossbeam-utils 0.7.2] For more information about this error, try `rustc --explain E0463`.
[crossbeam-utils 0.7.2] error[E0463]: can't find crate for `std`
[crossbeam-utils 0.7.2] |
[crossbeam-utils 0.7.2] = note: the `x86_64-unknown-hermit` target may not be installed
[crossbeam-utils 0.7.2]
[crossbeam-utils 0.7.2] error: aborting due to previous error
[crossbeam-utils 0.7.2]
[crossbeam-utils 0.7.2] For more information about this error, try `rustc --explain E0463`.
Running `C:\Dev\rs-hermit\target\release\build\memoffset-7d1f0fba7a901b85\build-script-build`
[memoffset 0.5.4] error[E0463]: can't find crate for `std`
[memoffset 0.5.4] |
[memoffset 0.5.4] = note: the `x86_64-unknown-hermit` target may not be installed
[memoffset 0.5.4]
[memoffset 0.5.4] error: aborting due to previous error
[memoffset 0.5.4]
[memoffset 0.5.4] For more information about this error, try `rustc --explain E0463`.
[memoffset 0.5.4] error[E0463]: can't find crate for `core`
[memoffset 0.5.4] |
[memoffset 0.5.4] = note: the `x86_64-unknown-hermit` target may not be installed
[memoffset 0.5.4]
[memoffset 0.5.4] error: aborting due to previous error
[memoffset 0.5.4]
[memoffset 0.5.4] For more information about this error, try `rustc --explain E0463`.
[memoffset 0.5.4] warning: autocfg could not probe for `std`
[memoffset 0.5.4] cargo:rustc-cfg=allow_clippy
[memoffset 0.5.4] cargo:rustc-cfg=maybe_uninit
[memoffset 0.5.4] cargo:rustc-cfg=doctests
Running `C:\Dev\rs-hermit\target\release\build\crossbeam-epoch-56bdabe6dd0cfc32\build-script-build`
[crossbeam-epoch 0.8.2] error[E0463]: can't find crate for `std`
[crossbeam-epoch 0.8.2] |
[crossbeam-epoch 0.8.2] = note: the `x86_64-unknown-hermit` target may not be installed
[crossbeam-epoch 0.8.2]
[crossbeam-epoch 0.8.2] error: aborting due to previous error
[crossbeam-epoch 0.8.2]
[crossbeam-epoch 0.8.2] For more information about this error, try `rustc --explain E0463`.
[crossbeam-epoch 0.8.2] error[E0463]: can't find crate for `core`
[crossbeam-epoch 0.8.2] |
[crossbeam-epoch 0.8.2] = note: the `x86_64-unknown-hermit` target may not be installed
[crossbeam-epoch 0.8.2]
[crossbeam-epoch 0.8.2] error: aborting due to previous error
[crossbeam-epoch 0.8.2]
[crossbeam-epoch 0.8.2] For more information about this error, try `rustc --explain E0463`.
[crossbeam-epoch 0.8.2] warning: autocfg could not probe for `std`
[crossbeam-epoch 0.8.2] cargo:rustc-cfg=has_min_const_fn
git LFS is an additional dependancy that needs to be installed. Considering that the gif was removed and the remaining image stored using LFS is only 10 KB in size, we should consider removing LFS.
On windows using powershell cloning a repo with LFS fails, apparently due to a bug in (windows) openssh.
when i build demo with latest nightly rust, i got build fail like this
Caused by:
process didn't exit successfully: `/home/maxtnt/workspace/uni_kernel_test/target/debug/build/hermit-sys-13f6625d237250fc/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-env-changed=HERMIT_IP
cargo:rerun-if-env-changed=HERMIT_GATEWAY
cargo:rerun-if-env-changed=HERMIT_MASK
Build libhermit-rs output-status: exit code: 101
Build libhermit-rs output-stdout:
Build libhermit-rs output-stderr: Updating crates.io index
Blocking waiting for file lock on package cache
error: Package `test v0.0.0 (/home/maxtnt/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/test)` does not have the feature `compiler-builtins-asm`
it looks like problem with compiler-builtins-asm feature in test mod
I found that compiler-builtins-asm feature is removed in nightly-2021-01-22(1.51.0)
check out this commit
when i downgrade the nightly version, it works!!
so i think we need specify nightly version in toolchain or modify source code
The hermit-sys build script works fine in most cases, however I have run into some issues.
Failure to build libhermit-rs does not result in immediate failure of the build. This is due to the expect only checking if the build command was executed. Additionally it should be asserted that the build command returned with the success code.
In case of an error when building libhermit-rs, the stdout/stderr output of the build command should be printed, to make debugging a bit easier.
There currently is some issue on windows on my machine when using the build script. Compiling libhermit on it's own works fine. Update: This problem is due to hitting the maximum Path length of a file on windows (defaults to 260). I think we should a note about this in the Readme.
[hermit-sys 0.1.10] Build libhermit-rs output-status: exit code: 101
[hermit-sys 0.1.10] Build libhermit-rs output-stdout:
[hermit-sys 0.1.10] Build libhermit-rs output-stderr: Compiling compiler_builtins v0.1.27
[hermit-sys 0.1.10] Compiling core v0.0.0 (C:\Users\jschw\.rustup\toolchains\nightly-2020-04-21-x86_64-pc-windows-msvc\lib\rustlib\src\r
ust\src\libcore)
[hermit-sys 0.1.10] Compiling semver-parser v0.7.0
[hermit-sys 0.1.10] Compiling bitflags v1.2.1
[hermit-sys 0.1.10] Compiling cc v1.0.52
[hermit-sys 0.1.10] Compiling x86 v0.33.0
[hermit-sys 0.1.10] Compiling log v0.4.8
[hermit-sys 0.1.10] Compiling rusty-hermit v0.3.27 (C:\Users\jschw\CLionProjects\rusty-hermit\libhermit-rs)
[hermit-sys 0.1.10] error: failed to write `C:\Users\jschw\CLionProjects\rusty-hermit\target\x86_64-unknown-hermit\debug\build\hermit-sys-f
10a33a6e7524b2a\out\target\x86_64-unknown-hermit-kernel\debug\.fingerprint\compiler_builtins-51f1076d61ffa99a\run-build-script-build_script
_build-51f1076d61ffa99a.json`
[hermit-sys 0.1.10]
[hermit-sys 0.1.10] Caused by:
[hermit-sys 0.1.10] Das System kann den angegebenen Pfad nicht finden. (os error 3)
[hermit-sys 0.1.10] warning: build failed, waiting for other jobs to finish...
[hermit-sys 0.1.10] error: build failed
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.