summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2014-09-04 23:38:33 +0200
committerMichal Idziorek <m.i@gmx.at>2014-09-04 23:38:33 +0200
commit467e19b262d435f1820539bc0c85ed4fa31b9687 (patch)
treec3ee7690b089713614309857ecfc046d6a13d160 /Makefile
parent487ecc1615ccc0368f1520c1146b2b43cdab6577 (diff)
Finally we have a 2 stage bootloader !
This one can load the ramdis up to 0xfffff :)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 11 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 426ae78..f12c36f 100644
--- a/Makefile
+++ b/Makefile
@@ -42,7 +42,10 @@ KERNEL_ENTRY=./boot/kernel_entry.o
#master boot record asm
-MBR=./boot/mbr.bin
+MBR=./boot0/mbr.bin
+
+#stage 2 bootloader
+STAGE2=./boot/stage2.bin
#multiprocessor binary entry
@@ -88,16 +91,17 @@ binfont.bin: data/binfont.src
# master boot record, kernel binary and fool-font
-FoolOS.img: $(MBR) kernel.bin $(FILLUP)
+FoolOS.img: $(MBR) $(STAGE2) kernel.bin $(FILLUP) FoolData.img
cp $(FILLUP) $@
- dd if=$(MBR) of=$@ bs=1 seek=0 conv=notrunc
- dd if=kernel.bin of=$@ bs=1 seek=512 conv=notrunc
+ dd if=$(MBR) of=$@ bs=512 seek=0 conv=notrunc
+ dd if=$(STAGE2) of=$@ bs=512 seek=1 conv=notrunc
+ dd if=kernel.bin of=$@ bs=512 seek=10 conv=notrunc
+ dd if=FoolData.img of=$@ bs=512 seek=906 conv=notrunc
binfont.img: binfont.bin
cat $^ > $@
-FoolData.img: $(FILLUP) binfont.bin $(MP_BIN)
- cp $(FILLUP) $@
+FoolData.img: binfont.bin $(MP_BIN)
dd if=$(MP_BIN) of=$@ bs=512 seek=0 conv=notrunc
dd if=binfont.bin of=$@ bs=512 seek=1 conv=notrunc
@@ -112,7 +116,7 @@ run: all
############ cleanup ############
clean:
- -rm *.bin *.img bochs.log $(KERNEL_ENTRY) $(ASMOBJECTS) $(OBJECTS) $(FILLUP) $(MBR) $(MP_BIN) bochs.out ne2k-tx.log ne2k-txdump.txt
+ -rm *.bin *.img bochs.log $(KERNEL_ENTRY) $(ASMOBJECTS) $(OBJECTS) $(FILLUP) $(MBR) $(MP_BIN) bochs.out ne2k-tx.log ne2k-txdump.txt $(STAGE2)
############ test stuff ############
stick: FoolOS.img