DIR := arch/x86/ $(BUILDDIR)/kernel: $(OBJS) $(LIBS) $(DIR)linker-script @echo $(COMP): Linking kernel: $@ $(V)$(MKDIR) $(dir $@) $(V)$(CXX) $(LDFLAGS) $(OBJS) $(LIBS) -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: $@ $(V)$(STRIP) $(BUILDDIR)/kernel -o "$@" $(V)dd if=/dev/zero of=$(BUILDDIR)/kernel.stripped conv=notrunc \ bs=1 count=1 seek=67