From be1b0def36c0ecfd0401424f70920e57c204bfd0 Mon Sep 17 00:00:00 2001 From: wescande Date: Fri, 9 Feb 2018 14:54:01 +0100 Subject: [PATCH 1/2] rectif port telnet --- kernel-rs/Makefile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/kernel-rs/Makefile b/kernel-rs/Makefile index 562fc52a..797f2288 100644 --- a/kernel-rs/Makefile +++ b/kernel-rs/Makefile @@ -1,8 +1,16 @@ +SHELL := /bin/bash + +ifeq ($(shell whoami), william) + PORT := 4321 +else + PORT := 1234 +endif + project := bluesnow arch ?= x86 NASM := nasm -f elf LD := ld -m elf_i386 -n --gc-sections -QEMU := qemu-system-x86_64 -enable-kvm -monitor telnet:127.0.0.1:1234,server,nowait +QEMU := qemu-system-x86_64 -enable-kvm -monitor telnet:127.0.0.1:$(PORT),server,nowait kernel := build/kernel-$(arch).bin iso := build/os-$(arch).iso @@ -10,7 +18,6 @@ DIRISO := build/isofiles target ?= $(arch)-$(project) rust_os := target/$(target)/debug/lib$(project).a -SHELL := /bin/bash linker_script := src/arch/$(arch)/linker.ld grub.cfg := src/arch/$(arch)/grub.cfg @@ -34,7 +41,7 @@ $(iso): $(kernel) $(grub.cfg) Makefile run: $(iso) Makefile @tmux info >&- || { echo -e "\033[38;5;16m ~~ NOT IN A VALID TMUX SESSION ~~\033[0m" ; exit 1; } - @tmux split-window "tmux resize-pane -y 20; sleep 0.5; telnet 127.0.0.1 1234" + @tmux split-window "tmux resize-pane -y 20; sleep 0.5; telnet 127.0.0.1 $(PORT)" @$(QEMU) -curses -cdrom $(iso) clean: From f2405aaa580ef6415733d9c521e46fd4cdd21204 Mon Sep 17 00:00:00 2001 From: wescande Date: Fri, 9 Feb 2018 17:00:41 +0100 Subject: [PATCH 2/2] makefile over 9000 --- kernel-rs/Makefile | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/kernel-rs/Makefile b/kernel-rs/Makefile index 797f2288..507d4ae7 100644 --- a/kernel-rs/Makefile +++ b/kernel-rs/Makefile @@ -1,16 +1,18 @@ SHELL := /bin/bash ifeq ($(shell whoami), william) - PORT := 4321 + PORT := 4242 + PORTG := 4244 else - PORT := 1234 + PORT := 4342 + PORTG := 4344 endif project := bluesnow arch ?= x86 NASM := nasm -f elf LD := ld -m elf_i386 -n --gc-sections -QEMU := qemu-system-x86_64 -enable-kvm -monitor telnet:127.0.0.1:$(PORT),server,nowait +QEMU := qemu-system-x86_64 -gdb tcp::$(PORTG) -enable-kvm -monitor telnet:127.0.0.1:$(PORT),server,nowait kernel := build/kernel-$(arch).bin iso := build/os-$(arch).iso @@ -24,6 +26,11 @@ grub.cfg := src/arch/$(arch)/grub.cfg asm_source := $(wildcard src/arch/$(arch)/*.asm) asm_object := $(patsubst src/arch/$(arch)/%.asm, build/arch/$(arch)/%.o, $(asm_source)) +KERNEL_RUN := $(QEMU) -curses -cdrom $(iso) +MONITOR := sleep 0.5; telnet 127.0.0.1 $(PORT); kill \`ps -x | grep gdb | head -n 2 | tail -n 1 | cut -d \ -f 2 \` +GDB := gdb -q -ex \"target remote localhost:$(PORTG)\" -ex \"continue\" + + all: $(kernel) build/arch/$(arch)/%.o: src/arch/$(arch)/%.asm Makefile @@ -41,8 +48,8 @@ $(iso): $(kernel) $(grub.cfg) Makefile run: $(iso) Makefile @tmux info >&- || { echo -e "\033[38;5;16m ~~ NOT IN A VALID TMUX SESSION ~~\033[0m" ; exit 1; } - @tmux split-window "tmux resize-pane -y 20; sleep 0.5; telnet 127.0.0.1 $(PORT)" - @$(QEMU) -curses -cdrom $(iso) + tmux new-window 'tmux split-window -h "$(MONITOR)"; tmux split-window -fv "$(GDB)"; tmux select-pane -t 1; tmux resize-pane -x 80 -y 25; $(KERNEL_RUN)' + @# @$(QEMU) -curses -cdrom $(iso) clean: @cargo clean