summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2014-09-03 18:26:07 +0200
committerMichal Idziorek <m.i@gmx.at>2014-09-03 18:26:07 +0200
commit4a46c2e07a9b79af01bbc984f20e01b12e98129f (patch)
tree2496e43aa046c74493f0a5a10e9594920a3e7488 /Makefile
parentadccdaa096506319be60879767a5a973d012e758 (diff)
Improved assembling FoolOs.img
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 9 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 306ea65..3fdad89 100644
--- a/Makefile
+++ b/Makefile
@@ -13,18 +13,15 @@
############ some constants ############
-#lets use the size of a 1.44 floppy for a start for our boot img
-IMAGE_SIZE=1474560 #floppy
+USB_STICK=/dev/sdf
#ap bin :
-MP_IMG_START=26112 #multiboot is initially at 0x6600
+MP_IMG_START=26112 #code for the other processors intialllly at 0x6600
#font data starts here:
FONT_DATA_START=26624 #fool font initially at 0x6800
-
-USB_STICK=/dev/sdf
-
+#here our kernel will be loaded by the bootloader.
KERNEL_START=0x10000
@@ -96,14 +93,13 @@ binfont.bin: data/binfont.src
# master boot record, kernel binary and fool-font
-FoolOS.img: mbr_kernel_mp.img binfont.img $(FILLUP)
- cat $^ | head -c $(IMAGE_SIZE) > $@
-
-mbr_kernel_mp.img: mbr_kernel.img $(MP_BIN) $(FILLUP)
- cat $^ | head -c $(FONT_DATA_START) > $@
+FoolOS.img: $(MBR) kernel.bin $(MP_BIN) binfont.img $(FILLUP)
+ 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=$(MP_BIN) of=$@ bs=1 seek=$(MP_IMG_START) conv=notrunc
+ dd if=binfont.img of=$@ bs=1 seek=$(FONT_DATA_START) conv=notrunc
-mbr_kernel.img: $(MBR) kernel.bin $(FILLUP)
- cat $^ | head -c $(MP_IMG_START) > $@
binfont.img: binfont.bin
cat $^ > $@