stos is a monolithic kernel written in a modular way, used at EPITA in order
to teach basic kernel programming.
Some of the assignments are:
- Memory protection
- Protected mode
- 8259A PIC
- i8254 PIT
- Virtual memory
- 32-bit x86 paging
- Page mapping
- IO mapping
KVM is the Linux Hypervisor that exposes an API for virtualization. It’s
usually split in two parts:
KVM, the kernel module
QEMU, device emulation, vm setup
KVM is used for the vm, vcpu and memory management, through
It allows us to setup a booting environment for
The work done for this project is divided in multiple modules:
This consists in initializing the following parts of
- the virtual machine
- the virtual cpu
And some extras:
Going into protected mode takes care of:
Setting up all the memory segments to flat.
Setting up the
%CR3 address, pointing to a temporary page directory handling
the kernel mapping.
We would normally set up the
%CR0.PG flag, but
KVM is unable to boot with
that flag set. We will have to go through a trampoline setting the flag and
calling the kernel entry point.
Loading the kernel (
stos) ELF into the memory, then taking care of
That consists in setting up the following parts:
A boot allocator.
The boot segments, representing the memory parts that are reserved/available.
The boot modules, which are the kernel modules that should be loaded in memory for
stosto dynamically load them in the
The command line and the
This should allow
stos to boot properly using