aboutsummaryrefslogtreecommitdiffhomepage
path: root/guest/guest64.S
diff options
context:
space:
mode:
authorjohannst <johannes.stoelp@gmail.com>2021-06-01 22:53:52 +0200
committerjohannst <johannes.stoelp@gmail.com>2021-06-01 22:53:52 +0200
commit9d2859957408b4c719760a7073e54cd3729561f6 (patch)
treecd926d4f94185af5807213ec2e52c68a0d6db65b /guest/guest64.S
parent387dd9e27b9425f23ff0eb0c6e9ea785a762fd48 (diff)
downloadmini-kvm-rs-9d2859957408b4c719760a7073e54cd3729561f6.tar.gz
mini-kvm-rs-9d2859957408b4c719760a7073e54cd3729561f6.zip
adapted examples with new exit reasons
Diffstat (limited to 'guest/guest64.S')
-rw-r--r--guest/guest64.S8
1 files changed, 8 insertions, 0 deletions
diff --git a/guest/guest64.S b/guest/guest64.S
index 1862749..6629273 100644
--- a/guest/guest64.S
+++ b/guest/guest64.S
@@ -7,6 +7,11 @@
mov rcx, [rip + msg_len] // Len of string.
rep outsb // Write ds:rsi to output port rdx.
+ // Trigger `KVM_EXIT_IO:KVM_EXIT_IO_IN` by reading byte to memory from input port.
+ mov dx, 0x1000 // Input port.
+ lea di, [in_dest] // Destination address.
+ insb // Read byte from input port dx to ds:di.
+
// Trigger `KVM_EXIT_HLT`.
hlt
@@ -15,3 +20,6 @@ msg:
.asciz "Hello from Long Mode!\n"
msg_len:
.byte .-msg
+
+in_dest:
+ .byte 0x00