Today I did some cleaning on directory structure. The current structure consists of a bootloader deeply embedded into the kernel that cannot be unloadable or exchanged to other loader, so I completely changed the directory structure for the loader to be easily loadable/exchangeable.
New directory structure
Now kernel can have multiple loaders and can choose what loader to compile from the global_variables.mk folder.
global_variables.mk :
...
################ customizable! ################
ARCH = x86_64
LOADER = loader_1
...
In loader folder, I made a very rudimentary makefile that just compiles the designated loader :
loader/Makefile
ROOTDIR = ..
include $(ROOTDIR)/global_variables.mk
include $(ROOTDIR)/common_compilers.mk
clean:
make -C $(LOADER) clean
all:
make -C $(LOADER) all
.PHONY: clean all
Each folders of loader have an individual makefile that compiles the final operating system image using the create kernel binary. I also changed the output file of operating system image to be stored at an individual directories for each loaders, because each loader outputs different types of image. (Check this github commit for details!)
Also, now there are individual directory for the resulting image of the respecting loader. (Also check the commit!)