All Projects → icexin → Eggos

icexin / Eggos

Licence: mit
A Go unikernel running on x86 bare metal

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Eggos

Libhermit
HermitCore: A C-based, lightweight unikernel
Stars: ✭ 190 (-84.58%)
Mutual labels:  kernel, osdev, unikernel
Unikraft
Unikraft is an automated system for building specialized POSIX-compliant OSes known as unikernels. (Core repository)
Stars: ✭ 183 (-85.15%)
Mutual labels:  kernel, osdev, unikernel
Powernex
An operating system written in D
Stars: ✭ 460 (-62.66%)
Mutual labels:  kernel, osdev
Os67
An unix-like toy kernel
Stars: ✭ 531 (-56.9%)
Mutual labels:  kernel, osdev
Soso
A Simple Unix-like operating system
Stars: ✭ 682 (-44.64%)
Mutual labels:  kernel, osdev
Wingos
a little 64bit operating system written in c++ with smp support
Stars: ✭ 361 (-70.7%)
Mutual labels:  kernel, osdev
Aquila
AquilaOS: UNIX-like Operating System
Stars: ✭ 413 (-66.48%)
Mutual labels:  kernel, osdev
Libhermit Rs
libhermit-rs: A Rust-based library operating system
Stars: ✭ 558 (-54.71%)
Mutual labels:  kernel, osdev
torokernel
This repository contains the source code of the unikernel toro
Stars: ✭ 107 (-91.31%)
Mutual labels:  kernel, unikernel
Cuteos
A 64-bit SMP-safe kernel for the PC architecture.
Stars: ✭ 51 (-95.86%)
Mutual labels:  kernel, osdev
Hidamari
Modern operating system aimed at running WebAssembly code.
Stars: ✭ 49 (-96.02%)
Mutual labels:  kernel, wasm
Dennix
Dennix is a unix-like hobbyist operating system written from scratch.
Stars: ✭ 53 (-95.7%)
Mutual labels:  kernel, osdev
Toaruos
A completely-from-scratch hobby operating system: bootloader, kernel, drivers, C library, and userspace including a composited graphical UI, dynamic linker, syntax-highlighting text editor, network stack, etc.
Stars: ✭ 4,687 (+280.44%)
Mutual labels:  kernel, osdev
Rusty Hermit
RustyHermit - A Rust-based, lightweight unikernel
Stars: ✭ 268 (-78.25%)
Mutual labels:  osdev, unikernel
Gramado
Gramado OS - 32bit operating system
Stars: ✭ 420 (-65.91%)
Mutual labels:  kernel, osdev
LudOS
A toy monolithic kernel written in C++
Stars: ✭ 38 (-96.92%)
Mutual labels:  kernel, osdev
Nanos
A kernel designed to run one and only one application in a virtualized environment
Stars: ✭ 557 (-54.79%)
Mutual labels:  osdev, unikernel
Redshirt
🧑‍🔬 Operating system
Stars: ✭ 1,082 (-12.18%)
Mutual labels:  kernel, wasm
MandelbrotOS
A community driven OS by the youth
Stars: ✭ 172 (-86.04%)
Mutual labels:  kernel, osdev
RocketOS
RocketOS is a Unix based OS that uses legacy BIOS and GRUB and is written in C17. It is being developed for educational purposes primarily, but it still is a serious project. It is currently in its infancy.
Stars: ✭ 23 (-98.13%)
Mutual labels:  kernel, osdev

EggOS

CI

A Go unikernel running on x86 bare metal

Run a single Go applications on x86 bare metal, written entirely in Go (only a small amount of C and some assembly), support most features of Go (like GC, goroutine) and standard libraries, also come with a network stack that can run most net based libraries.

The entire kernel is a go application running on ring0. There are no processes and process synchronization primitives, only goroutines and channels. There is no elf loader, but there is a Javascript interpreter that can run js script files, and a WASM interpreter will be added to run WASM files later.

Background

Go's runtime provides some basic operating system abstractions. Goroutine corresponds to processes and channel corresponds to inter-process communication. In addition, go has its own virtual memory management, so the idea of running Go programs on bare metal was born.

It turns out that Go has the ability to manipulate hardware resources, thanks to Go's controllable memory layout, the ability to directly translate hardware instructions without a virtual machine, and C-like syntax. These all make it possible for Go to write programs that run on bare metal. However, there are also some challenges. Go piling in many instructions to perform coroutine scheduling and memory GC, which brings some troubles in some places that cannot be reentrant, such as interrupt handling and system calls.

In general, writing kernel in Go is a very interesting experience. On the one hand, it gave me a deep understanding of Go's runtime. On the other hand, it also provided an attempt to write the operating system kernel on bare metal in addition to the C language.

Snapshot

js nes

Feature list

  • Basic Go features, such as GC, goroutine, channel.
  • A simple console support basic line editting.
  • Network stack support tcp/udp.
  • Go style vfs abstraction using afero
  • A nes game emulator using nes
  • A Javascript interpreter using otto
  • VBE based frame buffer.
  • Some simple network apps(httpd, sshd).

Dependencies

  • Go 1.13.x (only tested on Go1.13.x)
  • i386-elf-gcc
  • qemu

MacOS

$ brew tap nativeos/i386-elf-toolchain
$ brew install i386-elf-binutils i386-elf-gcc i386-elf-gdb
$ brew install qemu

Ubuntu

$ sudo apt-get install build-essential qemu

Quickstart

$ make
$ make qemu

Debug

You can directly use the gdb command to debug, or use vscode for graphical debugging.

First you need to install gdb, if you are under macos, execute the following command

brew install i386-elf-gdb

Use the extension Native Debug in vscode to support debugging with gdb

First execute the make qemu-debug command to let qemu start the gdb server, and then use the debug function of vscode to start a debug session. The debug configuration file of vscode is built into the project.

Go provides simple support for gdb, see Debugging Go Code with GDB for details

vscode-gdb

Running on bare metal

If you want eggos to run on bare metal, it is recommended to use grub as the bootloader.

The multiboot.elf generated after executing the make command is a kernel image conforming to the multiboot specification, which can be directly recognized by grub and booted on a bare metal. The sample configuration file refer to boot/grub.cfg

Documentation

For some design details see docs/internal.md

Roadmap

  • [ ] WASM runner
  • [ ] GUI support
  • [ ] 3D graphic
  • [ ] x86_64 support
  • [ ] SMP support

Bugs

The program still has a lot of bugs, and often loses response or panic. If you are willing to contribute, please submit a PR, thank you!

Special thanks

The birth of my little daughter brought a lot of joy to the family. This project was named after her name xiao dan dan. My wife and mother also gave me a lot of support and let me update this project in my spare time. ❤️ ❤️ ❤️

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].