Current 42 project : KFS-4
Discover the world of "Kernel Programming" and learn how to create your very own Kernel from scratch.
32bit very simple kernel
Functionalities:
- Boot (yes!)
- VGA printing
- GDT + stack dump function
- IDT - ISR + IRQ
- Keyboard management
- PIT
- RTC time
- Memory paging
- A heap + kernel virtual memory allocator
- A kernel you can boot via GRUB
- An ASM bootable base
- A basic kernel library, with basics functions and types
- Some basic code to print some stuff on the screen
- A basic "Hello world" kernel
Bonus
- Add scroll and cursor support to your I/O interface.
- Add colors support to your I/O interface.
- Add helpers like printf / printk in order to print information / debug easily.
- Handle keyboard entries and print them.
- Handle different screens, and keyboard shortcuts to switch easily between then.
- Create a Global Descriptor Table
- The GDT must contain:
- Kernel Code
- Kernel Data
- Kernel stack
- User code
- User data
- User stack
- Declare the GDT to the BIOS
- The GDT must be set at address 0x00000800
- Code a tool to print the kernel stack, in a human-friendly way
Bonus
- Code a minimalistic shell with a few commands, for debugging pur-poses.
- For example :
- the print-kernel-stack-thing
- reboot
- halt
- more
- Enable memory paging in your Kernel
- Code a memory structure that handle paging and memory rights
- Define Kernel and User space
- Implement a function to create/get memory pages
- Implement functions to allocate,free and get size of a variable
- Implement those functions for virtual and physical memory
- Handle "kernel panics" (Print, stop the kernel)
- Create an Interrupts Descriptor Table
- A signal-callback system on your Kernel API
- An interface to schedule signals
- An interface to clean registers before a panic / halt
- An interface to save the stack before a panic
- Implement a IDT keyboard handling system
Bonus
- [] Coding the base functions for the futures syscalls
- Add some features to the keyboard handler, for example :
- multi layouts (qwerty, azerty)
- base functions like get_line
./generate_sources.sh
make
make run
The Bible: https://wiki.osdev.org/Main_Page
James Molloy: http://www.jamesmolloy.co.uk/tutorial_html
With the osdev complement: https://wiki.osdev.org/James_Molloy's_Tutorial_Known_Bugs
Brandon Friesen - osdever: http://www.osdever.net/bkerndev/Docs/intro.htm
introduction : https://www.linuxjournal.com/content/what-does-it-take-make-kernel-0
bad : https://www.codeproject.com/Articles/1225196/Create-Your-Own-Kernel-In-C-2
Operating Systems: Three Easy Pieces : https://pages.cs.wisc.edu/~remzi/OSTEP/