aboutsummaryrefslogtreecommitdiffhomepage
path: root/guest/guest64.S
diff options
context:
space:
mode:
authorjohannst <johannes.stoelp@gmail.com>2021-05-30 02:03:21 +0200
committerjohannst <johannes.stoelp@gmail.com>2021-05-30 02:03:21 +0200
commit659cd8adbd940c4a7566cdc4a461ba05b5d2177c (patch)
treedcd49ec45a4216418a16df6d1c88020e3a2416c6 /guest/guest64.S
parent85d55ca8f2539a5f766aa375b011163832d5a592 (diff)
downloadmini-kvm-rs-659cd8adbd940c4a7566cdc4a461ba05b5d2177c.tar.gz
mini-kvm-rs-659cd8adbd940c4a7566cdc4a461ba05b5d2177c.zip
added long mode example with 4 level paging
Diffstat (limited to 'guest/guest64.S')
-rw-r--r--guest/guest64.S17
1 files changed, 17 insertions, 0 deletions
diff --git a/guest/guest64.S b/guest/guest64.S
new file mode 100644
index 0000000..1862749
--- /dev/null
+++ b/guest/guest64.S
@@ -0,0 +1,17 @@
+.intel_syntax noprefix
+
+.section .boot, "ax", @progbits
+ // Trigger `KVM_EXIT_IO:KVM_EXIT_IO_OUT` by writing string to output port.
+ mov rdx, 0x1000 // Output port.
+ lea rsi, [rip + msg] // Address of string.
+ mov rcx, [rip + msg_len] // Len of string.
+ rep outsb // Write ds:rsi to output port rdx.
+
+ // Trigger `KVM_EXIT_HLT`.
+ hlt
+
+.section .rodata, "a", @progbits
+msg:
+ .asciz "Hello from Long Mode!\n"
+msg_len:
+ .byte .-msg