Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

V01D-NULL/MoonOS

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

405 Commits
405 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Moon OS

Moon OS is a modular micro-kernel targeting the x86_64 and armv6 architecture, aiming to be POSIX-like in the future.

Screenshots:

Bootsplash:
Verbose boot:
Kernel panic:

Features

  • Support for multiple architectures:
    • x86_64 PCs with acpi support
      • 4 level paging
      • Stacktrace/symbol backtrace
      • zoned buddy and slab allocator.
      • System calls via syscall (No support for int based system calls)
    • Nintendo 3ds (armv6)
      • I2C driver
      • Bootrom IVT
      • Render strings to the display

Shared features (both architectures support this):

  • ubsan
  • Parsable boot arguments (quiet/verbose)
  • Elf loader
  • Primitive scheduler (Will be improved overtime, for now the my focus is on getting everything up and running (IPC, servers, libc, etc))

Future features:

  • Threads
  • kasan
  • ACPI
  • SMBIOS
  • Multitasking
  • Many hardware drivers including but not limited to:
    • Network cards
    • Storage drivers
    • GPU's
    • And much more
  • A libc for the userland

Near future todo list

  • Make better use of the APIC (currently it's used for the timer only)
  • virtual memory subsystem
  • New physical memory manager? (Unsure.)

This is currently being working on:

  • Scheduler
  • IPC
  • Porting mlibc
  • Initrd
    • In kernel decompression library to decompress the initrd
    • Native (build machine) program to build and add files (to maintain decent modularity) to the initrd.
    • Load and render an image from the initrd (tga, bmp)
  • New additions to make the armv6 port a lot more usable (SD Card driver, gpu, vblank)

Directory walkthrough:

  • libs/ -- Utilities not strictly related to a kernel (Scheduler, memory manager, etc), but required for it to function.
  • kernel/ -- Kernel source code
  • boot/ -- Everything Moon needs in order to boot
  • service/ -- Special micro-kernel servers + libc
  • userspace/ -- Bootloader files, configs, modules, etc. Many files are automatically added at build-time.

Installation

Building: (assuming you are using a debian based distro)

  • Install needed tools:

    • sudo apt update
    • sudo apt install gcc nasm qemu-system-x86 libfuse-dev ruby ruby-rubygems
    • sudo gem install ceedling # Testing
  • Build kernel

    • make all -- Build the kernel
    • make run -- Run the kernel in qemu and build it if necessary (x86_64 only)
    • make kvm -- Run the kernel in qemu with kvm and build it if necessary (x86_64 only)
    • Command line options for kvm and run:
      • modern=yes -- Emulate modern features (x86_64 only)
  • Configure architecture:

    • Simply edit two variables in Make.conf:
      • ARCH and BOARD. Permitted values are documented in a comment.

My journey: (Inspiration for newcomers)

I have always wanted to make an OS, so one day I decided to build one. Turns out it is a lot of work and back then it totally overwhelmed me to the point where I took long breaks (for months) because information was so scarce, and what little information there is is outdated.

I have written about 4 "kernels" during my OS development learning experience, and each time I started over because I was far too overwhelmed- none have gotten past a GDT :/ (heck, some where just bootloaders that called a kernel entry and looped)

If you are a beginner looking to understand what this code is doing and how you can write your own kernel with up-to-date information, please do join the OSDEV discord server (linked in the osdev wiki at the bottom) and don't give up when it gets hard at first.

I have started developing kernels about 8 months ago at the time of writing (with multiple month-long of breaks in between), and I still have many things to learn, however my try harder mindset proved useful in helping me get through the struggles and write a kernel for which I did not have to steal or copy code from tutorials or other projects out of a lack of knowledge.

I hope this inspired you to use this mindset when things seem too difficult to manage.

Best of luck ~ V01D (Tim).

Special thanks

  • Thanks go out to websites like lowlevel.eu or the osdev wiki but also some cool and really helpful os developers on github and discord.

Finishing touch (resources I use)

About

MoonOS (just a kernel atm) is a micro kernel designed for the x86_64 and arm architecure.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.