Skip to content

Herbstein/kernel-of-truth

 
 

Repository files navigation

Kernel of Truth build_status

A simple kernel written in C.

The goal of this project is to build a simple kernel with memory protection and interrupts which can run simple programs.

This project currently targets the x86 architecture. Perhaps someday I will port it to ARM so it can run on the Raspberry Pi, but right now I'm focused on implementing the fundamentals of a system.

Tutorials & Resources

In OS development, nothing compares to the manufacturer's manuals, especially the Intel x86 manuals. However, a variety of other resources have proven useful when first getting started.

Here are some resources which may prove helpful for the future raspberry pi port:

It can be helpful to refer to implementations of other hobbyist and professional kernels such as:

If you prefer reading textbooks, Tanenbaum's Operating Systems Design and Implementation is quite useful. Copies can be found floating around the internet. The FreeBSD developer's handbook can also offer interesting insights from more of a userland perspective. The Little OS Book is approachable, but hardly thorough.

Bug Reports & Contributing

Advice, ideas, bug reports and pull requests are all welcome! Please take a look at the issue tracker on GitHub. Please submit PRs via GitHub, although I will also take patches via email.

Getting Started

First build an x86 GCC and binutils. If you're not familiar with how to do this you should consult the Bare Bones Tutorial. Then install qemu with your favorite package manager. We'll need qemu-system-i386 to run the kernel. Once you have all this installed building and running this little kernel is quite easy:

# Build the kernel
$ make
# Start it with qemu
$ make start

The Makefile also has some targets to make debugging easier.

  • make start-log: log all assembly instructions executed and interrupts fired to the file qemu.log. Careful, this file can grow to be tens of megabytes in a few seconds!
  • make start-debug: Start qemu in debug mode so you can connect to it with GDB. To connect with GDB run:
$ gdb
(gdb) target remote localhost:1234
(gdb) continue

About

A simple kernel written in C

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 89.0%
  • Makefile 5.2%
  • Assembly 3.7%
  • Shell 1.8%
  • C++ 0.3%