Skip to content

The Hux x86 32-bit Toy Operating System Kernel (with full wiki pages)

License

Notifications You must be signed in to change notification settings

Jittor-Image-Models/hux-kernel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Hux Kernel

languages top-lang code-size license

Hux - An x86 32-bit toy operating system kernel built from scratch, following the OSTEP book structure and terminology.

Author Kernel Src LoC (temp) Tutorial LoC (temp)
Guanzhou Hu C + x86 ASM Markdown
Jun. 2021 4975 4397

Tutorial / Development Doc

I document the whole development process of Hux - its skeleton, related theories, practice pitfalls, plus everything I reckon important as a complete set of tutorials. They can be found at:

  • The WIKI pages 📝 of this repo
  • The Hux kernel dev doc PDF (identical, WIP)

If there are any typos / mistakes / errors, please raise an issue!

Playing with Hux

With QEMU (recommended), download the CDROM image hux.iso and do:

$ qemu-system-i386 -cdrom hux.iso

# Or, if you clone the repo and build Hux yourself:
$ make
$ make qemu

You will see the QEMU GUI popping up with GRUB loaded. Choose the "Hux" option with Enter to boot into Hux.

For development setup & instructions, please check out the wiki pages (recommended). I have every single detail documented there.

Goals

The main goal of Hux is to be Understandable: structured in a way that is easy to understand (not mimicking existing UNIX-like systems). OS development seems scary at first glance for beginners mostly because it involves too many hairy technical details. I admit that, in real-world systems, we must face the complexity to ensure compatibility, performance, robustness, security, etc. Yet, a toy kernel project would help demonstrate the key concepts of an operating system, including its most essential steps of development, layers of abstractions, and the ideas of virtualization, concurrency, and persistence.

Goals of the Hux kernel include:

  1. Understandability: as stated above
  2. Minimalism: a minimal workable core design
  3. Code clarity: though monolithic kernel, I will try to keep the code structure modularized
  4. Experimentalism: not mimicking existing UNIX flavor, not targeting at practical use

I choose to write it in C language with i386-IA32 architecture, since beginners tend to be more comfortable with this combination. More up-to-date system programming languages like Rust are great choices for modern 64-bit OS dev (Philipp is making his Rust OS kernel here), but I will start with easier settings for now to maintain better understandability. Rust itself is still "niche" (maybe not?) and you have to incorporate some of its "dark magics" to succeed in OS dev. It definitely confuses new learners.

These are general and long-term goals which I will (hopefully) follow throughout the project. I hope this can lead towards a full HuxOS which we can install on real devices and play with in the future (kept simple, of course 😁)

References

Main references:

OS conceptual materials:

Check the "References" section here for the full list.

TODO List

  • The basic kernel skeleton
  • VGA text mode driver
  • Debugging utilities stack
  • Interrupts & timer
  • Keyboard input support
  • Global descriptors table
  • Virtual memory (paging)
  • Heal memory allocator
  • Process isolation
  • Context switch & scheduling
  • Multi-threading concurrency
  • Synchronization primitives
  • Basic IDE disk driver
  • Very simple file system
  • Wiki pages & README
  • Extend Hux to Rux with Rust

About

The Hux x86 32-bit Toy Operating System Kernel (with full wiki pages)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 87.6%
  • Assembly 10.6%
  • Makefile 1.8%