All Projects → sonald → Sos

sonald / Sos

Licence: other
Sian's Operating System

Projects that are alternatives of or similar to Sos

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 (+11617.5%)
Mutual labels:  kernel, operating-system
Aquila
AquilaOS: UNIX-like Operating System
Stars: ✭ 413 (+932.5%)
Mutual labels:  kernel, operating-system
Rust Raspberrypi Os Tutorials
📚 Learn to write an embedded OS in Rust 🦀
Stars: ✭ 7,275 (+18087.5%)
Mutual labels:  kernel, operating-system
Lemonos
The Lemon Operating System https://lemonos.org
Stars: ✭ 260 (+550%)
Mutual labels:  kernel, operating-system
Libhermit Rs
libhermit-rs: A Rust-based library operating system
Stars: ✭ 558 (+1295%)
Mutual labels:  kernel, operating-system
Harmonyos
A curated list of awesome things related to HarmonyOS. 华为鸿蒙操作系统。
Stars: ✭ 18,385 (+45862.5%)
Mutual labels:  kernel, operating-system
Qword
Operating system for x86_64 based around a "keep it simple and make it work" philosophy.
Stars: ✭ 367 (+817.5%)
Mutual labels:  kernel, operating-system
LudOS
A toy monolithic kernel written in C++
Stars: ✭ 38 (-5%)
Mutual labels:  kernel, operating-system
Powernex
An operating system written in D
Stars: ✭ 460 (+1050%)
Mutual labels:  kernel, operating-system
Gramado
Gramado OS - 32bit operating system
Stars: ✭ 420 (+950%)
Mutual labels:  kernel, operating-system
Blog os
Writing an OS in Rust
Stars: ✭ 8,120 (+20200%)
Mutual labels:  kernel, operating-system
Smash
A unix like kernel
Stars: ✭ 40 (+0%)
Mutual labels:  kernel, operating-system
Tock
A secure embedded operating system for microcontrollers
Stars: ✭ 3,258 (+8045%)
Mutual labels:  kernel, operating-system
Rust Os Comparison
A comparison of operating systems written in Rust
Stars: ✭ 292 (+630%)
Mutual labels:  kernel, operating-system
fpos
Free Pascal Operating System (FPOS) is a operating system consists of a minimal kernel built on FreePascal. It contains a Scheme implementation of a hard drive (ATA) driver, keyboard (PS2), serial (8250 UART), FAT32 filesystem and a small real time clock manager. The project was built to experiment with developement of operating system using a h…
Stars: ✭ 36 (-10%)
Mutual labels:  kernel, operating-system
Wingos
a little 64bit operating system written in c++ with smp support
Stars: ✭ 361 (+802.5%)
Mutual labels:  kernel, operating-system
meetup
Cat System Workshop is a regular meet-up focusing on “system software”. We would like to gather all developers to share their experience regarding system software and learn from each other, making system software more perfect and complete!
Stars: ✭ 52 (+30%)
Mutual labels:  kernel, operating-system
oneiric
A small kernel + OS based on how dreams work
Stars: ✭ 11 (-72.5%)
Mutual labels:  kernel, operating-system
Phantomuserland
Phantom: Persistent Operating System
Stars: ✭ 412 (+930%)
Mutual labels:  kernel, operating-system
Tantra
Hobby x86 unix-like kernel. Curiously under development to answer "How to write an OS".
Stars: ✭ 23 (-42.5%)
Mutual labels:  kernel, operating-system

logo

sos

Sian's experimenting Operating System written in C++. it's a 32bit os kernel and runs on uniprocessor.

screenshot

BUILD

Like makefile indicated, this is a x86 kernel, and you need a i686 gcc cross compiler for building and running it. see here for the information. I think it also works under a 32bit GNU/Linux distribution. you may need to specify -Wl,--build-id=none for successful compiling. The kernel follows multiboot protocol and need a hd img with grub2 preinstalled. Here is a premade image for testing.

Refs

xv6 is a great reference implementation of a unix style kernel. linux 0.11 is also worth reading, and I learned a lot from these projects. You can find a lot of info about writing an small os kernel here.

Notes

One of the hardest as far as I can tell is memory management. I do implement my own kmalloc/kfree based on a simple algorithm. The way I choose to manage memory (both physical and virtual) makes some thing hard to implement, i.e shared memory region.

Another thing is task switch. There are many ways to do this, xv6's way or old linux way or your own method.

When design other parts of the kernel, you can stick to the unix tradition or just go bold and invent your own.

How to make a hd.img

This works under modern GNU/Linux (tested on Deepin 15). make disk image, then use parted (or fdisk to format as msdos)

dd if=/dev/zero of=hd.img bs=1M count=500
sudo parted hd.img mklabel msdos
sudo parted hd.img mkpart primary fat32 0% 100%

bind loop device (fat32 partition will be /dev/loop0p1) and mkfs

sudo losetup -f -P -v hd.img
sudo mkfs.vfat -F 32 /dev/loop0p1

then mount fat32 partition and install grub2:

sudo mount /dev/loop0p1 /mnt
sudo grub-install --modules="fat biosdisk normal part_msdos ext2 multiboot" --root-directory=/mnt /dev/loop0

TODOs

  • tty and io partially works
  • enough syscalls for sh
  • write support of vfs & block io layers
  • signal handling (partially)
  • simple GUI and software renderer (may port mesa if possible)
  • port newlib as userland libc

ISSUSE

  • physical mm is not good enough, and it's impossible to do va->pa & pa->va convertion.
  • userspace alloc will make some virtual address in kernel space can not be mapped (by adding KERNEL_VIRTUAL_BASE). which in turn may cause kernel has no mem to alloc.
  • sos use trap gate for syscalls, which leaves IF as it was(not cleared). must be very careful.
  • spinlock can not used in irq context in uniprocess system.
  • take care of the IF state, sleep can only happen with IF enabled context and wakeup from irq context leave IF disabled.
  • about spinlock: busy-waiting isn't enough when access syscall is a trap gate (IF enabled). we need to make sure cli'ed so fork / exec will not be preempted before finished.
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].