You compile the C files using GCC, my makefile uses a compilation line something like:
Code:
i586-elf-gcc -march=i586 -fomit-frame-pointer -O2 -mno-fancy-math-387 -mno-sse2 -mno-3dnow -mno-ieee-fp -msoft-float -mno-sse -mno-mmx -nostdlib -fno-builtin -fno-exceptions -c -Wall -Werror -nostdinc -I./Include -ffreestanding file.c -o bin/file.o
(I overkilled on the "no floating point math" parameters, especially since I don't even use floats or doubles
)
I suggest you get a copy of the docs for the command line parameters, I figured them out by just using "gcc --help" and googling the ones that weren't described properly.
Once you've compiled all the files, you link then using LD:
Code:
i586-elf-ld --strip-all -T LinkScript.ld -Map Bin/Link.txt -o Bin/Kernel.elf Bin/file.o Bin/file2.o Bin/file3.o
An example linkscript (LinkScript.ld parameter) can be found in BareBones in the Wiki. This will create a complete executable image based on the parameters in the linkscript.
The Bootloader should probably be a combination of 16 and 32 bit code, it'll be responsible for displaying the "which/how boot menu" (if you want one), loading the kernel and any associated files, and creating the desired environment for the kernel (Getting the memory bitmap from the BIOS, protected mode, paging, set video mode, etc) then jumping into the Kernel.
The Kernel initalisation should all revolve around the Kernel's runtime (preparing the scheduler, memory managers, starting the first process, etc). Code that has to configure and prepare the environment [that is only run once at startup] will simply waste RAM after it's no longer needed (unless you devise a way to drop that memory when it's no longer needed)
[NOTE: How or what you do is up to you, I'm only making suggestions based on common practices, you can do it anyway you want]