Skip to content

Qix-/kernel-of-truth

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

134 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kernel of Truth

A simple kernel written in C.

The goal of this project is to build a simple kernel with memory protection and iterrupts 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

The following tutorials have proven useful in developing this kernel:

The following resources may also prove useful:

After a certain point the tutorials become significantly less useful. It is helpful to refer to implementations of several hobbyist and professional kernels including:

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 useful insights. The Little OS Book is approachable, but hardly thorough.

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

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C 73.7%
  • Assembly 14.2%
  • Makefile 4.4%
  • Shell 4.2%
  • C++ 3.5%