Skip to content

Commit

Permalink
docs(readme): enable command highlighting, remove prompt
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Kröning <[email protected]>
  • Loading branch information
mkroening committed Apr 12, 2024
1 parent 89deddc commit 89a0059
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This project is a bootloader to run the [Hermit kernel](https://github.com/hermi
## Building

```bash
$ cargo xtask build --target <TARGET> --release
cargo xtask build --target <TARGET> --release
```

With `<TARGET>` being either `x86_64`, `x86_64-uefi`, or `aarch64`.
Expand All @@ -22,8 +22,8 @@ Afterward, the loader is located at `target/<TARGET>/release/hermit-loader`.

On x86-64 Linux with KVM, you can boot Hermit like this:

```
$ qemu-system-x86_64 \
```bash
qemu-system-x86_64 \
-enable-kvm \
-cpu host \
-smp 1 \
Expand All @@ -46,17 +46,17 @@ If you want to benchmark Hermit, make sure to enable the _invariant TSC_ (`invts

Unikernel arguments can be provided like this:

```
$ qemu-system-x86_64 ... \
```bash
qemu-system-x86_64 ... \
-append "[KERNEL_ARGS] [--] [APP_ARGS]"
```

### AArch64

On AArch64, the base command is as follows:

```
$ qemu-system-aarch64 \
```bash
qemu-system-aarch64 \
-machine virt,gic-version=3 \
-cpu cortex-a76 \
-smp 1 \
Expand Down Expand Up @@ -126,8 +126,8 @@ Microvms have a smaller memory footprint and a faster boot time.
To use this VM type, PCI and ACPI support have to be disabled for your app (using `no-default-features`).
```
$ qemu-system-x86_64 ... \
```bash
qemu-system-x86_64 ... \
-M microvm,x-option-roms=off,pit=off,pic=off,rtc=on,auto-kernel-cmdline=off \
-nodefaults -no-user-config \
-append "-freq 2800"
Expand All @@ -140,24 +140,24 @@ Depending on the virtualized processor, the processor frequency has to be passed
To enable an Ethernet device, we have to set up a tap device on the host system.
The following commands establish the tap device `tap10` on Linux:

```
# ip tuntap add tap10 mode tap
# ip addr add 10.0.5.1/24 broadcast 10.0.5.255 dev tap10
# ip link set dev tap10 up
# echo 1 > /proc/sys/net/ipv4/conf/tap10/proxy_arp
```bash
ip tuntap add tap10 mode tap
ip addr add 10.0.5.1/24 broadcast 10.0.5.255 dev tap10
ip link set dev tap10 up
echo 1 > /proc/sys/net/ipv4/conf/tap10/proxy_arp
```

If you want Hermit to be accessible from outside the host, you have to enable IP forwarding:
```
# sysctl -w net.ipv4.ip_forward=1
```bash
sysctl -w net.ipv4.ip_forward=1
```

You need to enable the `tcp` feature of the kernel.

The network configuration can be set via environment variables during compile time.
By default, it is:

```
```bash
HERMIT_IP="10.0.5.3"
HERMIT_GATEWAY="10.0.5.1"
HERMIT_MASK="255.255.255.0"
Expand All @@ -167,8 +167,8 @@ Currently, Hermit only supports [Virtio]:

[Virtio]: https://www.redhat.com/en/blog/introduction-virtio-networking-and-vhost-net

```
$ qemu-system-x86_64 ... \
```bash
qemu-system-x86_64 ... \
-netdev tap,id=net0,ifname=tap10,script=no,downscript=no,vhost=on \
-device virtio-net-pci,netdev=net0,disable-legacy=on
```
Expand Down

0 comments on commit 89a0059

Please sign in to comment.