setup qemu + VNC + monitor + gdb on WSL

This commit is contained in:
secXsQuared 2018-10-04 01:02:33 -04:00
parent 5a001169cb
commit eb33f2c35c
5 changed files with 34 additions and 6 deletions

View File

@ -1,8 +1,29 @@
AS := nasm
CC := clang
LD := clang
LD := lld
DAS := llvm-objdump
ifneq '$(AS_ENV)' ''
AS := $(AS_ENV)
endif
$(info Using AS=$(AS))
ifneq '$(CC_ENV)' ''
CC := $(CC_ENV)
endif
$(info Using CC=$(CC))
ifneq '$(LD_ENV)' ''
LD := $(LD_ENV)
endif
$(info Using LD=$(LD))
ifneq '$(DAS_ENV)' ''
DAS := $(DAS_ENV)
endif
$(info Using DAS=$(DAS))
INC_COMMON := inc
MK := mk
OUT := out

View File

@ -27,13 +27,13 @@ DUMP_FLAGS = -x86-asm-syntax=intel \
-t \
-triple=x86_64-pc-none-elf
LD_FLAGS = -fuse-ld=lld \
LD_FLAGS = -fuse-ld=$(LD) \
-nostdlib \
-Wl,-T,$(LD_SCRIPT) \
-Wl,--fatal-warnings
$(TGT): $(OBJ) $(LD_SCRIPT)
$(LD) $(LD_FLAGS) -o $@ $^
$(CC) $(LD_FLAGS) -o $@ $^
$(DMP): $(TGT)
$(DAS) $(DUMP_FLAGS) $< > $@

7
bootstrap_deb.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/bash
# Bootstrap debian 9 + clang-6.0 backport environment
# Personal use only
export CC_ENV=clang-6.0
export LD_ENV=lld-6.0
export DAS_ENV=llvm-objdump-6.0
export AS_ENV=nasm

View File

@ -1,8 +1,6 @@
#define ASM_FILE
#include "mlayout.h"
OUTPUT_FORMAT(elf64-x86-64)
OUTPUT_ARCH(i386:x86-64)
ENTRY(sys_entry)
SECTIONS

View File

@ -1,2 +1,4 @@
#!/bin/bash
qemu-system-x86_64 -bios qemu_bios.bin -vnc :1235 -monitor stdio -cdrom out/secxkrnl.iso -s -S
qemu-system-x86_64 -bios qemu_bios.bin -vnc :10 -monitor stdio -cdrom out/secxkrnl.iso -s -S