Here are the dependencies you'll need to build this project:
- gcc-multilib
- grub2
- libisoburn
- find
Here's a quick look at the important files and directories:
Makefile- Top-level Makefileconfig.mk- Build-system configurationk/- Kernel source folderelf.h- ELF headercrt0.S- CRT0 for the kernelk.c- Kernel entry pointmultiboot.h- Multiboot Specification headerk.lds- LD script for the kernel binarymemory.c- Kernel memory allocatorinclude/k/- Kernel includesatapi.h- ATAPI definitionskstd.h- K standard definitionskfs.h- KFS structures definitionstypes.h- Kernel types definitions
roms/- ROMs folderchichepong/- Chichepong folderroms.lds- LD script for ROM binaries
libs/- SDK folderlibc/- Basic libc available everywherelibk/- Userland functions
tools/- Tools foldermkksf- Generate your own soundsmkkfs- Create KFS ROMscreate-iso.sh- Generate the ISO image
For detailed information on the processor and system programming, check out the Intel Manuals on the Intel website. The "Volume 3A: System Programming Guide" is especially useful for OS development.
Here's how to build and run the project:
make|make k.iso- Create an ISO with all the ROMsmake k- Compile the kernelmake rom/GAME- Compile the ROM in the folderrom/$(GAME)make clean- Clean the tree
To boot the kernel in QEMU, use:
qemu-system-x86_64 -cdrom k.iso [ -enable-kvm ]To debug the kernel with GDB, use:
- Run QEMU with a GDB server and stop the CPU at the first instruction:
qemu-system-x86_64 -cdrom k.iso -s -S- Run GDB with the kernel binary:
gdb k/k- Connect GDB to the QEMU GDB server:
target remote localhost:1234- Set a breakpoint and continue execution:
b my_symbol- Run the simulation in GDB:
continue