Skip to content
/ EPIC Public

Tiny kernel experiment with the goal of running a precompiled 32-bit Linux ELF executable of `echo` as-is.

License

Notifications You must be signed in to change notification settings

Nufflee/EPIC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EPIC

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.

Features

  • 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

Resources used

Building

(Note: this also works perfectly on Ubuntu WSL with an X Server for QEMU)

Cloning

You have to clone this repository recursively because there are submodules:

git clone --recurse-submodules https://github.com/Nufflee/epic

Dependencies

  • 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

Building

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

Running

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

Debugging

Running the kernel in a debugger (gdb) can be done using:

make debug

About

Tiny kernel experiment with the goal of running a precompiled 32-bit Linux ELF executable of `echo` as-is.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published