barrettotte / enki-os

A basic x86 kernel to learn how operating systems get from BIOS to userland

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

enki-os

A basic x86 kernel to learn how operating systems get from BIOS to userland.

This is my first dive into the deep world of operating systems. I hope to make another kernel in the future using the things I learned here. This one still needs a lot of love and care it probably won't get.

Named after Enki, Sumerian god of water, knowledge, crafts, and creation.

Features / Goals

  • Custom bootloader
  • FAT-16 file system (except fwrite)
  • PS/2 keyboard driver
  • Static ELF file loading
  • Partial LibC
  • Process create/manage via TSS
  • Userland with basic shell
  • Basic Multitasking (timer based)

docs/enki-test.png

Building Locally

  • Install dependencies and build cross compiler: make toolchain
  • Build OS image: make
  • Build OS image and launch in QEMU: make qemu
  • Build OS image and launch with GDB connected to QEMU: make debug

TODO Items

  • Proper trapping/exception handling
  • Shift key
  • Scrolling terminal
  • Cursor support
  • Clear terminal
  • Init Floating Point Unit (FPU)
  • Reboot command
  • ACPI
  • PC speaker support
  • Terminal color support
  • Abstraction over PIC
  • Abstraction over timer
  • Gather system info and print on startup (memory, timer, etc)
  • Stack smash protector
  • Multiboot header
  • Dockerfile with toolchain installed? Github action?

Limitations

  • Lazy A20 line enable; Could potentially fail on some systems
  • Memory fragmentation
  • Only one drive supported (master - drive 0)
  • Missing FAT16 write
  • ELF file loading loads entire file into heap memory...
  • Only supports loading static ELF files
  • Simple multitasking via timer
  • Limited process control (no fork or exec)
  • No threading
  • Probably a lot more I'm forgetting...

References

About

A basic x86 kernel to learn how operating systems get from BIOS to userland

License:MIT License


Languages

Language:C 71.3%Language:Assembly 21.3%Language:Makefile 6.6%Language:Shell 0.9%