Project Structure
The project’s directory structure is relatively simple, with the following layout:
/kernel- Platform-agnostic kernel components (e.g. page allocation, task logic)/include- Platform-agnostic header files/arch/<arch>/kernel- Platform-specific kernel code (e.g. Intel 8259 PIC code, architecture-specific paging details)/arch/<arch>/include/arch- Platform-specific header files/build/iso- Files used for compiling the final image (e.g. GRUB configuration)/build/output- Files produced during compilation, such as the final ISO and binary images, and linker mappings/test- Test suites for kernel components/user- User-space application code
In an attempt to make the project support multiple architectures in future, each architecture will have its own directory under /arch, and may have more bespoke directory structure within it.
As such, x86-specific code should only ever be found under the /arch/x86 directory. Code within the /kernel directory should always be architecture-independent, however it will call upon functions and macros defined within the architecture-specific code.
Architecture and Platform-specific Compilation
The majority of the project’s compilation instructions can be found in the top-level Makefile, found in the root directory. This Makefile includes architecture and platform-specific Makefiles from arch/$(ARCH)/Makefile and arch/$(ARCH)/platforms/$(PLATFORM)/Makefile respectively.
This allows the majority of the compilation logic to be included in one top-level Makefile, while architecture or platform-specific compilation and build activities can be performed as well.