Kernel Design
Kernel Design
I am writing my kerel in ASM, and have different fils for video, the console, etc... I dont know how to compile all these files in to one. Can i just use an include call like you cn in C++??
Re: Kernel Design
You could do, but the long-term solution is to use a linker.
1) Assemble each .ASM file to .OBJ or .O files
2) Compile each .C file to .OBJ or .O files
3) Use your linker to link all the .OBJs or .Os into one executable
A good linker will let you link to either flat binary (i.e. just raw code and data) or to some format (such a ELF or PE).
1) Assemble each .ASM file to .OBJ or .O files
2) Compile each .C file to .OBJ or .O files
3) Use your linker to link all the .OBJs or .Os into one executable
A good linker will let you link to either flat binary (i.e. just raw code and data) or to some format (such a ELF or PE).
Re: Kernel Design
Tim's right. If you're using NASM compile each file like this:
nasm -f coff yourfile.asm
Then link all of the files toget with LD like this:
ld --oformat binary yourfile.o yourfile2.o -o yourkernel.bin
K.J.
nasm -f coff yourfile.asm
Then link all of the files toget with LD like this:
ld --oformat binary yourfile.o yourfile2.o -o yourkernel.bin
K.J.