summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile47
-rw-r--r--font/Makefile5
-rw-r--r--font/binarize.py (renamed from tools/binarize.py)0
-rw-r--r--font/fill.asm11
4 files changed, 30 insertions, 33 deletions
diff --git a/Makefile b/Makefile
index 93e06ab..090e85f 100644
--- a/Makefile
+++ b/Makefile
@@ -56,40 +56,45 @@ newrun: clean run
include Makefile.common
-include $(DEPS)
-#master boot record
+######### RECURSIVE MAKES ########################
+
+# master boot record
MBR=./boot1/mbr.bin
$(MBR):
- make -C boot1
+ make -C boot1 mbr.bin
-#stage 2 bootloader
+# stage 2 bootloader
STAGE2=./boot2/stage2.bin
$(STAGE2):
- make -C boot2
+ make -C boot2 stage2.bin
-#multiprocessor binary entry
+# multiprocessor binary entry
MP_BIN=./boot2/mp.bin
$(MP_BIN):
make -C boot2 mp.bin
-#some fillup data (zeros)
-FILLUP=./data/fill.bin
+# fonts
+FOOLFONT=./font/binfont.bin
+$(FOOLFONT):
+ make -C font binfont.bin
-####### userspace #########
-userspace/ext2.img:
- make -C userspace
+# userspace
+USERSPACE=./userspace/ext2.img
+$(USERSPACE):
+ make -C userspace ext2.img
############ linking kernel binary ############
+FILLUP=fill.img
+$(FILLUP):
+ dd if=/dev/zero of=$(FILLUP) bs=512 count=50000
+
+
# the kernel_entry.o needs to be FIRST!!
kernel.bin: $(KERNEL_ENTRY) $(ASMOBJECTS) $(OBJECTS)
$(CC) $(CFLAGS) -o $@ -Wl,-Ttext,$(KERNEL_START),--oformat,binary $^
-############ fool-font ############
-binfont.bin: data/binfont.src
- python tools/binarize.py $< $@
-
-
############ assembling of final image ############
# master boot record, kernel binary and fool-font
@@ -101,13 +106,10 @@ FoolOS.img: $(MBR) $(STAGE2) kernel.bin $(FILLUP) FoolData.img
dd if=kernel.bin of=$@ bs=512 seek=10 conv=notrunc #will end up at 0x100000 in ram (this is what the booloader starts loading secotr: 10)
dd if=FoolData.img of=$@ bs=512 seek=842 conv=notrunc #data starts at 0x168000
-binfont.img: binfont.bin
- cat $^ > $@
-
-FoolData.img: binfont.bin $(MP_BIN) userspace/ext2.img
+FoolData.img: $(FOOLFONT) $(MP_BIN) $(USERSPACE)
dd if=$(MP_BIN) of=$@ bs=512 seek=0 conv=notrunc
- dd if=binfont.bin of=$@ bs=512 seek=1 conv=notrunc
- dd if=userspace/ext2.img of=$@ bs=512 seek=4 conv=notrunc #will end up at 0x80800 in ram
+ dd if=$(FOOLFONT) of=$@ bs=512 seek=1 conv=notrunc
+ dd if=$(USERSPACE) of=$@ bs=512 seek=4 conv=notrunc #will end up at 0x80800 in ram
############ virtual machines stuff ############
@@ -130,10 +132,11 @@ stick: FoolOS.img
############ cleanup ############
clean_release:
- -rm *.bin FoolData.img binfont.img bochs.log $(KERNEL_ENTRY) $(ASMOBJECTS) $(OBJECTS) $(FILLUP) $(MBR) $(MP_BIN) bochs.out ne2k-tx.log ne2k-txdump.txt $(STAGE2) $(DEPS)
+ -rm *.bin FoolData.img bochs.log $(KERNEL_ENTRY) $(ASMOBJECTS) $(OBJECTS) $(FILLUP) $(MBR) $(MP_BIN) bochs.out ne2k-tx.log ne2k-txdump.txt $(STAGE2) $(DEPS)
make -C boot1 clean
make -C boot2 clean
make -C userspace clean
+ make -C font clean
clean: clean_release
-rm FoolOS.img FoolOS.vdi
diff --git a/font/Makefile b/font/Makefile
new file mode 100644
index 0000000..f758bfd
--- /dev/null
+++ b/font/Makefile
@@ -0,0 +1,5 @@
+############ fool-font ############
+binfont.bin: binfont.src
+ python binarize.py $< $@
+clean:
+ -rm binfont.bin
diff --git a/tools/binarize.py b/font/binarize.py
index 6dcbdef..6dcbdef 100644
--- a/tools/binarize.py
+++ b/font/binarize.py
diff --git a/font/fill.asm b/font/fill.asm
deleted file mode 100644
index ce9cb5f..0000000
--- a/font/fill.asm
+++ /dev/null
@@ -1,11 +0,0 @@
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;;;;; Miguel's FoolOS Helper Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;
-;
-; fill an empty floppy disk
-;
-;
-
-;times 1474560 db 0x69
-times 14745600 db 0x69