All Projects → mark-i-m → Os2

mark-i-m / Os2

Licence: apache-2.0
x86_64 OS kernel with completely async userspace and single address space [WIP; but basic kernel functionality implemented]

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Os2

Wingos
a little 64bit operating system written in c++ with smp support
Stars: ✭ 361 (+1344%)
Mutual labels:  x86-64, kernel, os, osdev
KnutOS
An x86_64 hobbyist OS written in C and Assembly
Stars: ✭ 16 (-36%)
Mutual labels:  kernel, x86-64, os, osdev
Monkos
an experimental 64-bit operating system
Stars: ✭ 100 (+300%)
Mutual labels:  x86-64, kernel, os, 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 (+18648%)
Mutual labels:  kernel, os, osdev, x86-64
Dennix
Dennix is a unix-like hobbyist operating system written from scratch.
Stars: ✭ 53 (+112%)
Mutual labels:  x86-64, kernel, os, osdev
Cyjon
A simple, clean code, multi-tasking operating system written in pure assembly language for 64-bit processors from the AMD64 family.
Stars: ✭ 184 (+636%)
Mutual labels:  x86-64, kernel, os, osdev
biefircate
Running x86-16 or x86-32 code from x86-64 UEFI; _very experimental_ • mirror of https://gitlab.com/tkchia/biefircate • developer notes at https://gitlab.com/tkchia/biefircate/-/blob/main/doc/NOTES.asciidoc
Stars: ✭ 47 (+88%)
Mutual labels:  kernel, x86-64, os, osdev
kernel
Main kernel tree
Stars: ✭ 28 (+12%)
Mutual labels:  kernel, os, osdev
os
x86-64 assembly µkernel
Stars: ✭ 15 (-40%)
Mutual labels:  kernel, os, osdev
poplar
Microkernel and userspace written in Rust exploring modern ideas
Stars: ✭ 217 (+768%)
Mutual labels:  kernel, os, osdev
utero
The Operating System (for x86_64) written in Crystal as much as possible
Stars: ✭ 55 (+120%)
Mutual labels:  x86-64, os, osdev
Sigma
Abandoned overcomplicated Microkernel using modern x86_64 features
Stars: ✭ 36 (+44%)
Mutual labels:  kernel, os, osdev
Aquila
AquilaOS: UNIX-like Operating System
Stars: ✭ 413 (+1552%)
Mutual labels:  kernel, os, osdev
ktf
Kernel Test Framework
Stars: ✭ 125 (+400%)
Mutual labels:  kernel, x86-64, os
beeos
A simple "Unix-like" kernel trying to be POSIX compliant
Stars: ✭ 103 (+312%)
Mutual labels:  kernel, os, osdev
rust-kernel-barebones
A minimal 64-bit rust kernel and a bunch of configuration scripts that can be used to bootstrap Operating system development using Nightly-Rust compiler.
Stars: ✭ 42 (+68%)
Mutual labels:  kernel, x86-64, osdev
MandelbrotOS
A community driven OS by the youth
Stars: ✭ 172 (+588%)
Mutual labels:  kernel, os, osdev
nightingale
A small operating system where I experiment and learn osdev.
Stars: ✭ 86 (+244%)
Mutual labels:  kernel, os, 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 (-8%)
Mutual labels:  kernel, os, osdev
LudOS
A toy monolithic kernel written in C++
Stars: ✭ 38 (+52%)
Mutual labels:  kernel, os, osdev

OS2 [WIP]

This is a small hobby OS to play around with stuff I have never done before... it's not intended to be functional, useful, secure, or reliable. It is meant to be approximately fun to implement.

If you want to see the latest things I am up to, check out the dev branch on this repo. Generally, master should compile and run.

WIP

  • Start on librs (the equivalent of libc for this project).

    • See user/src/main.rs as an example userspace program.
    • Compile userspace progs with cargo xbuild --target target.json
  • Paging

    • memory::paging::map_region
    • Need some way of registering valid memory mappings.
    • Page fault handler should check that register and allocate a new page if needed.
  • Zero-copy message passing for IPC. To send a message,

    • Remove from sender page tables
    • Remove from sender TLB
    • Insert page into receiver page tables
    • Allow the receiver to fault to map the page. Process receives message via the normal future polling.
  • I am toying with the idea of not having processes at all, just DAGs of continuations which may or may not choose to pass on their capabilities.

Already implemented

Currently its a little over 1500 LOC (not including comments + whitespace + dependencies). Not bad!

  • The kernel itself is continuation-based, rather than using something like kthreads. In the first pass, I am just making things work. Later, I might go back and make it efficient.

  • No timer-based preemption in kernelspace or userspace (though timer interrupts do occur so that timers can work). No locks, no multi-threading in userspace. Every process is single-threaded and continuation-based. Each Continuation can return a set of additional continuations to be run in any order, an error, or nothing. Continuations can also wait for events, such as I/O or another process's termination.

  • Single address space. Everything lives in the same address space. Page table entry bits are used to disable certain portions of the address space for some continuations.

  • Small kernel heap for dynamic memory allocation.

  • Buddy allocator for physical frame allocation.

  • Buddy allocator for virtual address space regions.

  • Simple capability system for managing access to resources in the system, such as memory regions.

  • Switching to usermode and back.

  • System calls via syscall and sysret instructions.

  • Loading a position-independent ELF binary as a user-mode task, running it, and exiting via a syscall.

TODO

Now that I have a mostly functioning basic kernel, I can start playing around with stuff!

  • Need a coherent programming model... how does a user process load other tasks?
  • Need to fill out the set of reasonable events.
  • Networking? I've never done that before...

Building

  • rust, nightly

    rustc 1.45.0-nightly (99cb9ccb9 2020-05-11)
    
  • llvm-tools-preview rust distribution component via rustup component add llvm-tools-preview

  • cargo xbuild and cargo bootimage via cargo install cargo-xbuild bootimage

  • build-essentials and standard utils: gcc, make, ld, objcopy, dd

  • qemu to run

To build and run

$ cd os2/user
$ cargo xbuild --target x86_64-unknown-elf.json --release
$ cd ../kernel
$ bootimage run

bootimage can optionally be passed --release for optimized builds.

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].