From 3d2ddaeb9bd57095cd1990d9a701fe48bcbeb985 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Wed, 24 May 2023 23:49:41 +0200 Subject: xpost: mini kvm --- content/2023-01-15-xpost-mini-kvm-rs.md | 51 +++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 content/2023-01-15-xpost-mini-kvm-rs.md (limited to 'content') diff --git a/content/2023-01-15-xpost-mini-kvm-rs.md b/content/2023-01-15-xpost-mini-kvm-rs.md new file mode 100644 index 0000000..709050d --- /dev/null +++ b/content/2023-01-15-xpost-mini-kvm-rs.md @@ -0,0 +1,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 -- cgit v1.2.3