aboutsummaryrefslogtreecommitdiffhomepage
path: root/guest/Makefile
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2025-03-14 02:13:23 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2025-03-14 02:14:56 +0100
commit3ebd8b163dc8d5679d90927de1c2fcd639882362 (patch)
treef9a8c33265371606d93ddf5b350fe4e095afb3f8 /guest/Makefile
parentb16851fb799b880c31cc65a9fa1aba592b4ce5b4 (diff)
downloadmini-kvm-rs-3ebd8b163dc8d5679d90927de1c2fcd639882362.tar.gz
mini-kvm-rs-3ebd8b163dc8d5679d90927de1c2fcd639882362.zip
guest: add 64bit guest to toy with msrHEADmain
Guest to toy with msr register and the swapgs instruction.
Diffstat (limited to 'guest/Makefile')
-rw-r--r--guest/Makefile12
1 files changed, 7 insertions, 5 deletions
diff --git a/guest/Makefile b/guest/Makefile
index 635759a..61d7790 100644
--- a/guest/Makefile
+++ b/guest/Makefile
@@ -1,14 +1,16 @@
ARCH16 := i8086
ARCH64 := i386:x86-64
-guest: guest16 guest64
-disasm: disasm16 disasm64
+bits = $(word 1, $(subst -, ,$(1)))
+
+guest: guest16 guest64 guest64-msr
+disasm: disasm16 disasm64 disasm64-msr
guest%: guest.ld guest%.S
- $(CC) $(CFLAGS) -m$* -o $@ -nostdlib -ffreestanding -Wpedantic -Wall -Wextra -Werror -T guest.ld guest$*.S
+ $(CC) $(CFLAGS) -m$(call bits, $*) -o $@ -nostdlib -ffreestanding -Wpedantic -Wall -Wextra -Werror -T guest.ld guest$*.S
disasm%: guest%
- objdump -D -b binary -m $(ARCH$*) -M intel $^
+ objdump -D -b binary -m $(ARCH$(call bits, $*)) -M intel $^
clean:
- $(RM) guest16 guest64
+ $(RM) guest16 guest64 guest64-msr