daily pastebin goal
42%
SHARE
TWEET

Untitled

a guest Mar 22nd, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CFLAGS := -g -std=c99 -Wall -Wextra -Wpedantic
  2. CFLAGS += -m32 -O1 -fasm -ffreestanding
  3. ASFLAGS = $(CFLAGS)
  4.  
  5. SRCS := $(wildcard *.c)
  6. OBJS := $(patsubst %.c,%.o, $(SRCS))
  7.  
  8. kern0: boot.o $(OBJS)
  9.     ld -m elf_i386 -Ttext 0x100000 --entry comienzo $^ -o $@
  10.     # Verificar imagen Multiboot v1.
  11.     grub-file --is-x86-multiboot $@
  12.  
  13. clean:
  14.     rm -f kern0 *.o core
  15.  
  16. .PHONY: clean
  17.  
  18.  
  19. QEMU := qemu-system-i386 -serial mon:stdio
  20. KERN := kern0
  21. BOOT := -kernel $(KERN)
  22.  
  23. qemu: $(KERN)
  24.     $(QEMU) $(BOOT)
  25.  
  26. qemu-gdb: $(KERN)
  27.     $(QEMU) -kernel kern0 -S -gdb tcp:127.0.0.1:7508 $(BOOT)
  28.  
  29. gdb:
  30.     gdb -q -s kern0 -n -ex 'target remote 127.0.0.1:7508'
  31.  
  32. .PHONY: qemu qemu-gdb gdb
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top