From 6305e91acccbfbd7cbb31aefbb1dc9175c342c83 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Sat, 16 Apr 2022 21:57:13 +0200 Subject: guest: remove fPIC from makefile --- guest/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guest/Makefile b/guest/Makefile index a2eea1b..5dca740 100644 --- a/guest/Makefile +++ b/guest/Makefile @@ -5,7 +5,7 @@ guest16: guest.ld guest16.S $(CC) $(CFLAGS) -m16 -o $@ -nostdlib -ffreestanding -Wpedantic -Wall -Wextra -Werror -T guest.ld guest16.S guest64: guest.ld guest64.S - $(CC) $(CFLAGS) -m64 -o $@ -nostdlib -fPIC -ffreestanding -Wpedantic -Wall -Wextra -Werror -T guest.ld guest64.S + $(CC) $(CFLAGS) -m64 -o $@ -nostdlib -ffreestanding -Wpedantic -Wall -Wextra -Werror -T guest.ld guest64.S disasm16: guest16 objdump -D -b binary -m i8086 -M intel $^ -- cgit v1.2.3 From 6edfa1ba659319752cd3e0d24566a19de80cdac7 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Sat, 16 Apr 2022 22:00:40 +0200 Subject: fix vcpu/vm doc --- src/vcpu.rs | 2 +- src/vm.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vcpu.rs b/src/vcpu.rs index 239c663..f0d311e 100644 --- a/src/vcpu.rs +++ b/src/vcpu.rs @@ -5,7 +5,7 @@ use std::io; use crate::{ioctl, kvm_sys, KvmRun}; -/// Exit reasons for the [`Vcpu::kvm_run`][crate::vcpu::Vcpu::kvm_run] function. +/// Exit reasons for the [`Vcpu::run`][crate::vcpu::Vcpu::run] function. /// /// Details for the different exit reasons can be found in the [`kvm_run` /// structure][kvm-run-struct] description. diff --git a/src/vm.rs b/src/vm.rs index 95caf3c..2cd1643 100644 --- a/src/vm.rs +++ b/src/vm.rs @@ -26,7 +26,7 @@ impl Vm { /// Map memory from userspace into the VM as `guest physical` memory starting at address /// `phys_addr`. - /// The underlying operation is the [`KVM_SET_USER_MEMORY_REGION`][kmv-set-user-memory-region] + /// The underlying operation is the [`KVM_SET_USER_MEMORY_REGION`][kvm-set-user-memory-region] /// ioctl. /// /// # Safety -- cgit v1.2.3 From 38cd31ed203999122c500d389de38bb051ce979e Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Sat, 16 Apr 2022 22:23:30 +0200 Subject: README: add doc badge, add requirements --- README.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 498adec..1b66b76 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,11 @@ # kvm-rs -[![Rust](https://github.com/johannst/mini-kvm-rs/actions/workflows/rust.yml/badge.svg)](https://github.com/johannst/mini-kvm-rs/actions/workflows/rust.yml) +[![Rust][wf-badge]][wf-output] [![Rustdoc][doc-badge]][doc-html] + +[wf-output]: https://github.com/johannst/mini-kvm-rs/actions/workflows/rust.yml +[wf-badge]: https://github.com/johannst/mini-kvm-rs/actions/workflows/rust.yml/badge.svg +[doc-html]: https://johannst.github.io/mini-kvm-rs/kvm_rs/index.html +[doc-badge]: https://img.shields.io/badge/kvm__rs-rustdoc-blue.svg?style=flat&logo=rust A playground for the [`Kernel Virtual Machine (KVM)`](https://www.kernel.org/doc/html/latest/virt/kvm/index.html) in rust to @@ -11,14 +16,19 @@ The sources are structured as follows: - [`src/`](./src) provides a small library as abstraction over the raw [KVM API](https://www.kernel.org/doc/html/latest/virt/kvm/api.html#api-description). - [`examples/`](./examples) contains example VMs using the library above. -- [`guest/`](./guest) contains the guest source code. -- [`sysdeps/`](./sysdeps) helper to generate some KVM constants from the system - header (executed by [build.rs](./build.rs)). +- [`guest/`](./guest) contains the guest source code which is run inside the VMs. +- [`sysdeps/`](./sysdeps) contains helper to generate some KVM constants from + the system header (executed by [build.rs](./build.rs)). ## Documentation Rustdoc for this crate is avalable at -[johannst.github.io/mini-kvm-rs](https://johannst.github.io/mini-kvm-rs/kvm_rs/index.html). +[johannst.github.io/mini-kvm-rs][doc-html]. + +## Requirements + +- Kernel with `kvm` support and permissions to open `/dev/kvm`. +- Compiler & binuitls for generating the guest images. ## Real Mode (16bit) example -- cgit v1.2.3