Permalink
Browse files

Change linking to ELF/objcopy

  • Loading branch information...
1 parent bd521f0 commit 2dab3a8ca693a1754b498f05472670e15343bb07 @jvns committed Dec 7, 2013
Showing with 7 additions and 3 deletions.
  1. +5 −1 Makefile
  2. +2 −2 src/linker.ld
View
@@ -29,10 +29,14 @@ $(BUILDDIR)/loader.bin: src/loader.asm
mkdir -p $(BUILDDIR)
$(NASM) -o $@ -f bin $<
-$(BUILDDIR)/main.bin: src/linker.ld $(OBJS)
+$(BUILDDIR)/main.elf: src/linker.ld $(OBJS)
mkdir -p $(BUILDDIR)
$(LD) -o $@ -T $^
+$(BUILDDIR)/main.bin: $(BUILDDIR)/main.elf
+ mkdir -p $(BUILDDIR)
+ objcopy -O binary $< $@
+
$(BUILDDIR)/floppy.img: $(BUILDDIR)/loader.bin $(BUILDDIR)/main.bin
cat $^ > $@
View
@@ -1,6 +1,6 @@
ENTRY(start)
-OUTPUT_FORMAT(binary)
-
+OUTPUT_FORMAT("elf32-i386")
+OUTPUT_ARCH(i386)
SECTIONS {
. = 0x7e00;
.text : {

0 comments on commit 2dab3a8

Please sign in to comment.