diff options
| author | Michal Idziorek <m.i@gmx.at> | 2014-11-14 11:28:08 +0100 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2014-11-14 11:28:08 +0100 |
| commit | bcc833522cc25b7217e81644b804675ab19c1a63 (patch) | |
| tree | 4619a5fe5a3b0d41d600715e67388b2a56080430 /Makefile | |
| parent | 81c84c9cd22e0b6c56b90fa470dad55b9bb716e0 (diff) | |
cleaning up directories and build system
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 47 |
1 files changed, 25 insertions, 22 deletions
@@ -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 |
