As there are quite a lot approaches to building a kernel, applications and whatever is necessary to form your OS, I'd like to open this thread so that everyone can write a little about their build process. I think it's quite interesting to see what other people do and what steps their process involves, and maybe we can share ideas and discuss the methods.
So I'm going to start out!
About the design: My kernel is a microkernel, and everything runs in userspace, launched by now from the ramdisk. I'm building the parts using my buildtool Capri. As toolchain I'm using a OS-specific toolchain, the setup instructions can be found here (thats how you build it yourself, I'll add downloadable binaries one day).
To the build process itself, my projects folder structures (a little simplified) looks like this:
Code: Select all
/GhostKernel (the kernel itself)
/src-api (global stuff that the API needs, like systemcall definition headers)
/src-kernel (actual kernel sources)
/src-loader (loader sources)
/src-shared (stuff thats shared between kernel and loader)
/ramdisk
/iso (contains GRUB files)
/GhostAPI (kernel API wrapper userspace library)
/GhostLibrary (high-level userspace library)
/GhostApps (repository with all applications)
/GhostApp-XX1
/GhostApp-XX2
Code: Select all
1. API library
a) compiles it's sources, including /GhostKernel/src-api and creates the archive "libghostapi.a"
b) compiles the crts
c) copies all headers from /GhostKernel/src-api and all its own headers to the toolchains "include" directory
d) copies "libghostapi.a" and the crt*.o's to the toolchains "lib" directory
2. GhostLibrary, this is just a normal build process creating the archive "libghostlib.a"
3. The applications are built, resulting binaries are copied to the /GhostKernel/ramdisk folder
4. The kernel is built:
a) compiles the sources from src-loader, including src-shared, creating the loader binary
b) compiles the sources from src-kernel, including src-shared and src-api, creating the kernel binary
c) builds the ramdisk
d) packs the kernel, loader and ramdisk to an .iso with GRUB
5. Optionally, launches the .iso in QEMU
Greets,
Max