EPIC is a small kernel/OS experiment with the goal of running a precompiled 32-bit Linux ELF executable of echo
to learn what it takes to do that.
The kernel can currently only run in 32-bit protected mode on x86 (i386) machines.
Development is streamed on my Twitch channel.
- Simple memory management (physical page allocator and malloc)
- Serial port output
- VGA text mode driver
- Basic interrupt-driven keyboard driver
- Simple terminal emulator
- ATA hard drive driver
- Custom read-only file system - EPICFS
- Linux-compatible syscalls
- Flat and ELF32 binary execution
- Simple C program support
- OSDev Wiki - Tons of tutorials about anything OS Dev related
- JamesM's kernel development tutorials - This tutorial has some known issues.
- Linux x86 Syscall Reference
- x86 ISA Reference
- And others...
(Note: this also works perfectly on Ubuntu WSL with an X Server for QEMU)
You have to clone this repository recursively because there are submodules:
git clone --recurse-submodules https://github.com/Nufflee/epic
- git
- i686 gcc8
- nasm
- make
- python3 (for mkfs.epic tool that generates an EPICFS image)
- qemu (for testing and debugging)
- xorriso (optional, only needed for ISO creation)
sudo apt install git gcc-8-i686-linux-gnu nasm make python3 qemu xorriso # Ubuntu/Debian
# Feel free to add dependency instructions for your distro/OS
Compile epic-musl:
bash ./tools/build_musl.sh
In case you want to rebuild epic-musl, you have to clean it up first:
bash ./tools/build_musl.sh clean
Build the kernel itself:
make build
Or build the kernel and then create a full .iso disk image (xorriso is needed for this to succeed):
make iso
There are a couple of different options to test run using qemu you can either build and run the kernel directly by using:
make run
Alternatively you can build a full cd disk image and run qemu off of that using:
make run_iso
Running the kernel in a debugger (gdb) can be done using:
make debug