Commits

prabirshrestha  committed 5f2391b

build boot0.elf

  • Participants
  • Parent commits 5a917dd
  • Branches mk

Comments (0)

Files changed (3)

 toolchain
 
 *.o
-*.out
+*.elf
 *.bin
-*.img
+*.img

File boot/boot.mk

 boot: $(BOOTSRCPATH)boot.img
 
 clean_boot:
-	rm $(BOOTSRCPATH)*.o
+	rm $(BOOTSRCPATH)*.o $(BOOTSRCPATH)*.elf $(BOOTSRCPATH)*.img
 
 $(BOOTSRCPATH)boot.img: $(BOOTSRCPATH)boot0.bin
 
 $(BOOTSRCPATH)boot0.bin: $(BOOTSRCPATH)boot0.elf
 
 $(BOOTSRCPATH)boot0.elf: $(BOOTSRCPATH)boot0.o
+	$(LD) -nostartfiles -nostdlib -o $@ $^ -T $(BOOTSRCPATH)boot0.ld
 
 $(BOOTSRCPATH)boot0.o: $(BOOTSRCPATH)boot0.S
 	$(AS) -o $@ $^

File boot/boot0.ld

 SECTIONS
 {
-    . = 0x7c00;
-    .text:
-    {
-        _ftext = .; /* program loads at 0x7c00 */
-    } = 0
-}
+   .text 0x7c00:
+   {
+      *(.text);
+   }
+}