README.md 3.35 KB
Newer Older
Steffen Vogel's avatar
Steffen Vogel committed
1
2
<img width="100" align="right" src="img/hermitcore_logo.png" />

Jonathan Klimt's avatar
Jonathan Klimt committed
3
# RustyHermit: libhermit-rs
Stefan Lankes's avatar
Stefan Lankes committed
4

Stefan Lankes's avatar
Stefan Lankes committed
5
[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://hermitcore.github.io/libhermit-rs/hermit/)
Stefan Lankes's avatar
Stefan Lankes committed
6
[![License](https://img.shields.io/crates/l/rusty-hermit.svg)](https://img.shields.io/crates/l/rusty-hermit.svg)
7
[![Slack Status](https://matrix.osbyexample.com:3008/badge.svg)](https://matrix.osbyexample.com:3008)
Stefan Lankes's avatar
Stefan Lankes committed
8

Jonathan Klimt's avatar
Jonathan Klimt committed
9
_libhermit-rs_ is the kernel of the [RustyHermit](https://github.com/hermitcore/rusty-hermit) unikernel project.
10

Jonathan Klimt's avatar
Jonathan Klimt committed
11
## Building the kernel
Stefan Lankes's avatar
Stefan Lankes committed
12

Jonathan Klimt's avatar
Jonathan Klimt committed
13
Usually the kernel will be linked as static library to your applications.
Jonathan Klimt's avatar
Jonathan Klimt committed
14

Jonathan Klimt's avatar
Jonathan Klimt committed
15
16
17
18
19
20
21
22
23
- **Rust applications:** Instructions can be found in the [rusty-hermit](https://github.com/hermitcore/rusty-hermit) repository.
- **For C/C++ applications:** Instructions can be found in the [hermit-playground](https://github.com/hermitcore/hermit-playground) repository.
 

### Standalone static library build

If this does not fit your needs and you want to build the kernel as static library to link afterwards, you need the following:

The Rust **nightly** toolchain ([official webpage](https://www.rust-lang.org/)), the source code of the Rust runtime, and llvm-tools:
24
25

```sh
Jonathan Klimt's avatar
Jonathan Klimt committed
26
27
rustup toolchain install nightly
rustup component add rust-src llvm-tools-preview
28
29
```

Jonathan Klimt's avatar
Jonathan Klimt committed
30
You can then build `libhermit-rs` with the following command
31
32

```sh
33
cargo build -Z build-std=core,alloc,panic_abort --target x86_64-unknown-none-hermitkernel
34
35
```

36
The resulting library then can be found in `target/x86_64-unknown-none-hermitkernel/debug/libhermit.a`
37

Stefan Lankes's avatar
Stefan Lankes committed
38

Jonathan Klimt's avatar
Jonathan Klimt committed
39
### Control the kernel messages verbosity
40

41
_libhermit-rs_ uses the lightweight logging crate [log](https://github.com/rust-lang/log) to print kernel messages.
Jonathan Klimt's avatar
Jonathan Klimt committed
42
43
44
The environment variable `HERMIT_LOG_LEVEL_FILTER` controls the verbosity. 
You can change it by setting it at compile time to a string matching the name of a [LevelFilter](https://docs.rs/log/0.4.8/log/enum.LevelFilter.html).
If the variable is not set, or the name doesn't match, then `LevelFilter::Info` is used by default.
45
46

```sh
47
$ HERMIT_LOG_LEVEL_FILTER=Debug cargo build -Z build-std=core,alloc,panic_abort --target x86_64-unknown-none-hermitkernel
48
49
```

Stefan Lankes's avatar
Stefan Lankes committed
50
## Credits
Stefan Lankes's avatar
Stefan Lankes committed
51

52
_libhermit-rs_ is derived from following tutorials and software distributions:
53
54
55

1. Philipp Oppermann's [excellent series of blog posts][opp].
2. Erik Kidd's [toyos-rs][kidd], which is an extension of Philipp Opermann's kernel.
56
3. The Rust-based teaching operating system [eduOS-rs][eduos].
57
58
59
60
61

[opp]: http://blog.phil-opp.com/
[kidd]: http://www.randomhacks.net/bare-metal-rust/
[eduos]: http://rwth-os.github.io/eduOS-rs/

62
HermitCore's Emoji is provided for free by [EmojiOne](https://www.gfxmag.com/crab-emoji-vector-icon/).
63
64
65
66
67

## License

Licensed under either of

Jens Breitbart's avatar
Jens Breitbart committed
68
69
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
70
71
72

at your option.

Jens Breitbart's avatar
Jens Breitbart committed
73
## Contribution
74
75
76

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

77
libhermit-rs is being developed on [GitHub](https://github.com/hermitcore/libhermit-rs).
Martin Kröning's avatar
Martin Kröning committed
78
Create your own fork, send us a pull request, and chat with us on [Slack](https://matrix.osbyexample.com:3008)