Note: Development on this project has stopped, and new development happens at https://github.com/khaledh/fusion.
This is my attempt at creating a modern 64-bit kernel in Nim.
- Nim 1.9.3
- MinGW-w64
- QEMU
- UEFI BIOS image:
- Arch:
sudo pacman -S edk2-ovmf
- Ubuntu:
sudo apt install ovmf
- Arch:
$ nim c --os:any --out:fatimg/EFI/BOOT/BOOTX64.EFI src/boot/boot.nim
$ qemu-system-x86_64 \
-bios /usr/share/edk2-ovmf/x64/OVMF_CODE.fd \
-drive format=raw,file.driver=vvfat,file.rw=on,file.dir=fatimg \
-nic none \
-machine q35 \
-debugcon stdio -global isa-debugcon.iobase=0x402
Note that the above path for OVMF_CODE.fd
is the default install path on Arch Linux. For Ubuntu
use the path /usr/share/OVMF/OVMF_CODE.fd
instead.
- UEFI bootloader
- Simple Text Protocol
- Graphics Output Protocol (GOP)
- Kernel loader
- Hardware Detection
- UEFI Memory Map
- ACPI: I/O APIC
- ACPI: Local APICs
- PCI bus enumeratoin
- VGA
- AHCI storage controller
- SMBIOS information
- Graphics Output
- Bochs Graphics Adaptor (BGA)
- Framebuffer
- Font rendering
- Segment Descriptors
- Global Descriptor Table (GDT)
- 64-bit flat memory model
- Interrupts
- Interrupt Descriptor Table (IDT)
- Fault and Trap handlers
- Memory Management
- Page frame allocator
- Paging (Virtual Memory)
- Kernel memory allocator
- Preemptive Multitasking
- Kernel threads
- User threads
- Timer IRQ handler
- Scheduler
- Multiprocessor Support
- SMP
- Scheduler
- Keyboard Input
- Keyboard IRQ handler
- Scancode conversion
- Key event packet
- Buffering
- Storage
- SATA ACHI driver
- File System
- TBD
- System Calls
- TBD
MIT