I already wrote this but my computer crashed, so I won't write as much as before. Now the bootloader is divided in stage1 and stage2, I added and edited some makefiles, stage 2 is written in Asm and C, the kernel isn't loaded into memory. PS: after this commit I'll add another branch called "coding", the code in that branch won't work 100% because it's missing something, but I don't want to do a "mega commit" every time (those commits will still be in the main branch). To everyone who wants to try XanvicOS or """using""" it, use the main branch, because the main branch's code is working. I'll write this in the README.md right after this commit.
59 lines
1.2 KiB
Makefile
59 lines
1.2 KiB
Makefile
ASM=nasm
|
|
CC=gcc
|
|
CC16=/usr/bin/watcom/binl/wcc
|
|
LD16=/usr/bin/watcom/binl/wlink
|
|
|
|
SRC_DIR=src
|
|
BUILD_DIR=build
|
|
|
|
.PHONY: all immagine_floppy kernel bootloader clean always
|
|
|
|
|
|
#Immagine floppy
|
|
|
|
immagine_floppy: $(BUILD_DIR)/main_floppy.img
|
|
|
|
$(BUILD_DIR)/main_floppy.img: bootloader kernel
|
|
dd if=/dev/zero of=$(BUILD_DIR)/main_floppy.img bs=512 count=2880
|
|
mkfs.fat -F 12 -n "XANVOS" $(BUILD_DIR)/main_floppy.img
|
|
dd if=$(BUILD_DIR)/stage1.bin of=$(BUILD_DIR)/main_floppy.img conv=notrunc
|
|
mcopy -i $(BUILD_DIR)/main_floppy.img $(BUILD_DIR)/stage2.bin "::stage2.bin"
|
|
mcopy -i $(BUILD_DIR)/main_floppy.img $(BUILD_DIR)/kernel.bin "::kernel.bin"
|
|
|
|
|
|
#Kernel
|
|
|
|
kernel: $(BUILD_DIR)/kernel.bin
|
|
|
|
$(BUILD_DIR)/kernel.bin: always
|
|
$(MAKE) -C $(SRC_DIR)/kernel BUILD_DIR=$(abspath $(BUILD_DIR))
|
|
|
|
|
|
#Bootloader
|
|
|
|
bootloader: stage1 stage2
|
|
|
|
stage1: $(BUILD_DIR)/stage1.bin
|
|
|
|
$(BUILD_DIR)/stage1.bin: always
|
|
$(MAKE) -C $(SRC_DIR)/bootloader/stage1 BUILD_DIR=$(abspath $(BUILD_DIR))
|
|
|
|
|
|
stage2: $(BUILD_DIR)/stage2.bin
|
|
|
|
$(BUILD_DIR)/stage2.bin: always
|
|
$(MAKE) -C $(SRC_DIR)/bootloader/stage2 BUILD_DIR=$(abspath $(BUILD_DIR))
|
|
|
|
|
|
#Always
|
|
|
|
always:
|
|
mkdir -p $(BUILD_DIR)
|
|
|
|
|
|
#Clean
|
|
|
|
clean:
|
|
rm -rf $(BUILD_DIR)/*
|
|
|
|
#Strumenti
|