improved some targets of the Makefiles used for debugging and testing

This commit is contained in:
Steffen Vogel 2014-11-28 01:49:03 +01:00
parent c46cdfe5b2
commit c96973cf03
2 changed files with 22 additions and 5 deletions

View file

@ -20,9 +20,18 @@ OBJCOPY_FOR_TARGET = $(CROSSCOMPREFIX)objcopy
RANLIB_FOR_TARGET = $(CROSSCOMPREFIX)ranlib
STRIP_FOR_TARGET = $(CROSSCOMPREFIX)strip
READELF_FOR_TARGET = $(CROSSCOMPREFIX)readelf
NASM = nasm
GDB = gdb
QEMU = qemu-system-i386
NASMFLAGS = -felf32 -g -i$(TOPDIR)/include/eduos/
GDBFLAGS = -x debug.gdb
QEMUFLAGS = -smp 2 -monitor stdio \
-net nic,model=rtl8139 \
-net user,hostfwd=tcp::12345-:7 \
-serial tcp::12346,server,nowait
INCLUDE = -I$(TOPDIR)/include -I$(TOPDIR)/arch/$(ARCH)/include
# Compiler options for final code
CFLAGS = -g -m32 -march=i586 -Wall -O2 -fno-builtin -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc $(INCLUDE) -fno-stack-protector
@ -62,14 +71,15 @@ veryclean: clean
@echo Very cleaned
qemu: $(NAME).elf
qemu-system-i386 -monitor stdio -smp 2 -net nic,model=rtl8139 -net user,hostfwd=tcp::12345-:7 -net dump -kernel $(NAME).elf
$(QEMU) $(QEMUFLAGS) -kernel $(NAME).elf
qemu-dbg: $(NAME).elf
qemu-system-i386 -monitor stdio -s -S -smp 2 -net nic,model=rtl8139 -net user,hostfwd=tcp::12345-:7 -net dump -kernel $(NAME).elf
debug: $(NAME).elf
$(TERM) -e $(GDB) $(GDBFLAGS) &
$(QEMU) $(QEMUFLAGS) -s -S -kernel $(NAME).elf
doc:
@doxygen
@echo Create documentation...
@doxygen
%.o : %.c
@echo [CC] $@
@ -91,5 +101,5 @@ include/eduos/config.inc: include/eduos/config.h
$Q$(CC_FOR_TARGET) $(CFLAGS) -c -o $@ $<
.PHONY: default all clean emu gdb newlib tools
include $(addsuffix /Makefile,$(SUBDIRS))

7
debug.gdb Normal file
View file

@ -0,0 +1,7 @@
# Constant part of the script
symbol-file eduos.sym
target remote localhost:1234
set architecture i386
break main
continue