2021-09-14 15:34:14 +00:00
|
|
|
@echo off
|
|
|
|
|
|
|
|
set loader_name=loader
|
|
|
|
set nasm_path=C:\nasm
|
2021-09-14 15:46:50 +00:00
|
|
|
set djgpp_path=C:\mingw\bin
|
2021-09-14 15:34:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
@echo ***************** CTA KERNEL *****************
|
|
|
|
|
|
|
|
goto KernelEntry
|
|
|
|
|
|
|
|
:error
|
|
|
|
@echo.
|
|
|
|
@echo There have been build errors. Building halted.
|
|
|
|
@pause
|
|
|
|
exit
|
|
|
|
|
|
|
|
:KernelEntry
|
|
|
|
del objects\%loader_name%.o
|
|
|
|
del objects\main.o
|
|
|
|
|
|
|
|
@echo.
|
|
|
|
@echo Building Kernel entry...
|
|
|
|
@echo * Compiling kernel loader...
|
|
|
|
%nasm_path%\nasm.exe -f aout -o ./objects/%loader_name%.o %loader_name%.asm
|
|
|
|
|
|
|
|
@echo * Compiling kernel main...
|
|
|
|
%djgpp_path%\gcc.exe -Wall -O -fstrength-reduce -fomit-frame-pointer -nostdinc -fno-builtin -I./include -c -o ./objects/main.o main.c
|
|
|
|
if not exist objects\%loader_name%.o goto error
|
|
|
|
if not exist objects\main.o goto error
|
|
|
|
|
|
|
|
@echo.
|
|
|
|
|
|
|
|
:KernelSTDLIB
|
|
|
|
cd lib
|
2021-09-14 15:46:50 +00:00
|
|
|
rem call compile.bat
|
|
|
|
@echo.
|
2021-09-14 15:34:14 +00:00
|
|
|
cd..
|
|
|
|
|
|
|
|
:KernelMemoryManager
|
|
|
|
cd memory
|
2021-09-14 15:35:52 +00:00
|
|
|
rem call compile.bat
|
2021-09-14 15:46:50 +00:00
|
|
|
@echo.
|
2021-09-14 15:35:52 +00:00
|
|
|
cd..
|
|
|
|
|
2021-09-14 15:46:50 +00:00
|
|
|
:KernelDrivers
|
|
|
|
cd drivers
|
|
|
|
rem call makeall.bat
|
|
|
|
cd..
|
|
|
|
|
2021-09-14 15:35:52 +00:00
|
|
|
:KernelVIDEO
|
|
|
|
cd video
|
2021-09-14 15:34:14 +00:00
|
|
|
call compile.bat
|
|
|
|
cd..
|
|
|
|
|
2021-09-14 15:35:52 +00:00
|
|
|
:KernelSHELL
|
|
|
|
cd shell
|
|
|
|
call compile.bat
|
|
|
|
cd..
|
2021-09-14 15:46:50 +00:00
|
|
|
|
2021-09-14 15:34:14 +00:00
|
|
|
rem here go other sources:
|
|
|
|
|
|
|
|
rem here go other sources ^
|
|
|
|
|
|
|
|
:Finish
|
|
|
|
cd objects
|
|
|
|
@echo Linking...
|
|
|
|
del kernel.bin
|
|
|
|
%djgpp_path%\ld -T link.ld
|
|
|
|
if not exist kernel.bin goto error
|
|
|
|
|
|
|
|
@echo.
|
|
|
|
|
|
|
|
echo Copying to floppy drive...
|
|
|
|
copy KERNEL.BIN A:\KERNEL.CTA >nul
|
|
|
|
cd..
|