DIR := arch/x86/ CXXFLAGS += -fno-omit-frame-pointer -march=i686 $(BUILDDIR)/kernel: $(OBJS) $(DIR)linker-script @echo $(COMP): Linking kernel: $@ @$(MKDIR) $(dir $@) @$(CXX) $(OBJS) -lgcc -lsupc++ -nostdlib -o "$@" -Wl,-T$(DIR)linker-script # GRUB refuses to use the addresses in the multiboot header if it # finds a valid ELF header, so the dd hacks a zero into the high byte # of the physical address field. I tried using AT() in the linker # script to properly generate separate physical and virtual # addresses, but that caused the strip command to issue a warning and # wipe out the BSS (setting memsz to filesz). $(BUILDDIR)/kernel.stripped: $(BUILDDIR)/kernel @echo $(COMP): Stripping kernel: $@ @$(STRIP) $(BUILDDIR)/kernel -o "$@" @dd if=/dev/zero of=$(BUILDDIR)/kernel.stripped conv=notrunc \ bs=1 count=1 seek=67