Molly Kernel
Molly kernel is a bare kernel (32kB size) for x86 based on JamesM's kernel development tutorials for learning purpose. It also adds keyboard support from Bran's kernel development tutorials.
Build
The original version of the code is in master branch. The modifications (bug fixes + enhancements) are in dev branch.
;; Pre-requisites
sudo apt install nasm gcc make kvm bochs
git clone https://gitlab.com/atamariya/molly.git
make -C src
./update_image.sh
./run.sh
;; Optional
;; Run floppy image
kvm -fda floppy.img
;; Run kernel binary
kvm -kernel src/kernel -initrd initrd.img
Debugging
You can use GDB to debug the kernel while executing it under qemu. Start qemu with "-s -S" flags and attach GDB remote session using "target remote localhost:1234". Make sure you match the architecture (i386 in this case) for qemu command and the kernel.
qemu-system-i386 -kernel src/kernel -initrd initrd.img -s -S
References
- Debugging 16-bit in QEMU with GDB on Windows
- Display devices in Qemu
- About ELF Auxiliary Vector
- vsyscall - "system" call that avoids crossing the userspace-kernel boundary
Comments
Post a Comment