Moving on from DJGPP
Posted: Thu Feb 12, 2015 4:00 pm
Howdy,
I would like to move myself towards a sustainable build environment. I need some input on how to do that.
Currently I am following bran's kernel development build steps which utilizes DJGPP (I am running on a 64bit machine, I am using dosbox for DJGPP which works but I am hitting hard limits with character amounts that are hindering me)
I know about the article to set up a cross compiler. If I completed this, how would I translate the existing build structure to follow this? (GCC would work, curious about if linking would go the same?)
build script:
I would like to move myself towards a sustainable build environment. I need some input on how to do that.
Currently I am following bran's kernel development build steps which utilizes DJGPP (I am running on a 64bit machine, I am using dosbox for DJGPP which works but I am hitting hard limits with character amounts that are hindering me)
I know about the article to set up a cross compiler. If I completed this, how would I translate the existing build structure to follow this? (GCC would work, curious about if linking would go the same?)
build script:
Code: Select all
cd src
echo Now assembling, compiling, and linking your kernel:
nasm -f aout -o start.o start.asm
rem Remember this spot here: We will add 'gcc' commands here to compile C sources
gcc -w -Wall -O -finline-functions -nostdinc -fno-builtin -I../include -c -o main.o main.c
gcc -w -Wall -O -finline-functions -nostdinc -fno-builtin -I../include -c -o scrn.o scrn.c
gcc -w -Wall -O -finline-functions -nostdinc -fno-builtin -I../include -c -o gdt.o gdt.c
gcc -w -Wall -O -finline-functions -nostdinc -fno-builtin -I../include -c -o idt.o idt.c
gcc -w -Wall -O -finline-functions -nostdinc -fno-builtin -I../include -c -o isrs.o isrs.c
gcc -w -Wall -O -finline-functions -nostdinc -fno-builtin -I../include -c -o irq.o irq.c
gcc -Wall -O -finline-functions -nostdinc -fno-builtin -I../include -c -o timer.o timer.c
gcc -w -Wall -O -finline-functions -nostdinc -fno-builtin -I../include -c -o kb.o kb.c
gcc -w -Wall -O -finline-functions -nostdinc -fno-builtin -I../include -c -o string.o string.c
rem This links all your files. Remember that as you add *.o files, you need to
rem add them after start.o. If you don't add them at all, they won't be in your kernel!
ld -T link.ld -o kernel.bin start.o main.o scrn.o gdt.o idt.o isrs.o irq.o timer.o kb.o string.o
echo Cleaning up object files...
copy kernel.bin ..\kernel.bin
del *.o
del *.bin
echo Done!
pause
exit