VSBL is a Very Simple BootLoader and a set of fundamental modules that can load kernel written in C++.
Kernel is loaded in long 64-bit mode.
Entry point for C++ code is void kmain()
function in src/Kernel.cpp
. You can find loaders for each stage(Real mode,
Protected mode and Long mode) here.
- Physical memory scanning
- Dynamic memory allocation
- C++ global constructors calling
- PS/2 controller support
- APIC and I/O APIC support
- ACPI basic system tables parsing
- PS/2 keyboard handling
- Terminal printing like cout in C++
- PCI management
- AHCI driver
- CMake build system
- AM79C970A network driver
cmake
, yasm
, g++
, ld
and objcopy
mkdir cmake-build-release
cd cmake-build-release
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --target VSBL
There are two versions of compiled kernel image: ./out/boot.img
(Version for VirtualBox. Aligned to 1MB size)
or ./out/boot/img.old
(Version for booting on real machine)
You can test your kernel in VirtualBox virtual machine.
./init.sh
cmake --build . --target VSBL_VBox_Medium_Create
cmake --build . --target VSBL_VBox_Update