From 3ebd8b163dc8d5679d90927de1c2fcd639882362 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Fri, 14 Mar 2025 02:13:23 +0100 Subject: guest: add 64bit guest to toy with msr Guest to toy with msr register and the swapgs instruction. --- guest/Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'guest/Makefile') 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 -- cgit v1.2.3