blob: 709050d28b588f8053e184f468e3de341e85c4f6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
+++
title = "xpost: KVM studies in rust (mini-kvm-rs)"
[taxonomies]
tags = ["kvm", "linux", "x86"]
+++
This is a cross post to a **KVM playground** in rust that I created in the past
and hosted on github [>> mini-kvm-rs <<][mini-kvm].
The [README][mini-kvm-readme] in the root of the repository gives an overview
over the project organization. Additionally, it shows instructions for how to
run two examples provided in the project, a guest running in [16 bit real
mode][mini-kvm-16bit] and a guest running in [64 bit long
mode][mini-kvm-64bit].
The rustdoc is [here][mini-kvm-doc].
## Example: 16 bit real mode
The following shows the 16 bit guest code example.
```nasm
{{ fetch_url(url="https://raw.githubusercontent.com/johannst/mini-kvm-rs/main/guest/guest16.S") }}
```
The following creates a VM and runs the 16 bit example guest image.
```rust
{{ fetch_url(url="https://raw.githubusercontent.com/johannst/mini-kvm-rs/main/examples/real_mode.rs") }}
```
## Example: 64 bit long mode
The following shows the 64 bit guest code example.
```nasm
{{ fetch_url(url="https://raw.githubusercontent.com/johannst/mini-kvm-rs/main/guest/guest64.S") }}
```
The following creates a VM and runs the 64 bit example guest image.
```rust
{{ fetch_url(url="https://raw.githubusercontent.com/johannst/mini-kvm-rs/main/examples/long_mode.rs") }}
```
[mini-kvm]: https://github.com/johannst/mini-kvm-rs
[mini-kvm-readme]: https://github.com/johannst/mini-kvm-rs/blob/main/README.md
[mini-kvm-doc]: https://johannst.github.io/mini-kvm-rs/kvm_rs/index.html
[mini-kvm-16bit]: https://github.com/johannst/mini-kvm-rs#real-mode-16bit-example
[mini-kvm-64bit]: https://github.com/johannst/mini-kvm-rs#long-mode-64bit-example
|