Git Product home page Git Product logo

b-xiang / soso Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ozkl/soso

0.0 1.0 0.0 14.54 MB

A Simple Unix-like operating system

License: BSD 2-Clause "Simplified" License

Makefile 11.57% C 77.67% Assembly 4.42% C++ 3.10% Objective-C 0.38% Shell 0.70% M4 0.91% Batchfile 0.01% Emacs Lisp 0.04% Mathematica 0.01% Python 0.05% TeX 0.81% Perl 0.18% Roff 0.10% Yacc 0.02% Awk 0.01% XSLT 0.01% DIGITAL Command Language 0.01% Scala 0.02% RPC 0.03%

soso's Introduction

soso

Soso is a simple unix-like operating system written in Nasm assembly and mostly in C. It supports multiboot, so it is started by Grub. It can be built using Nasm and Clang. You can use GCC instead of Clang, if you want. Tested build environments are Linux, FreeBSD, and Windows 10 (Windows Subsystem for Linux).

Soso is a 32-bit x86 operating system and its features are

  • Multitasking with processes and threads
  • Memory Paging with 4MB pages
  • Kernelspace (runs in ring0) and userspace (runs in ring3) are separated
  • Virtual File System
  • FAT32 filesystem using FatFs
  • System calls
  • Libc (Newlib is ported with only basic calls like open, read,..)
  • Userspace programs as ELF files
  • mmap support
  • Framebuffer graphics (userspace can access with mmap)
  • Shared memory

Paging is written for 4MB page support, since it is easier to implement. In this way, a Page Directory Entry points directly to a 4MB Page Frame. In 4KB mechanism, a Page Directory Entry points to a Page Table Entry which then points to a 4KB Page Frame. Downside of using 4MB pages is, each process has to use at least 4MB memory.

Soso has Libc, so existing applications depending only on a small part of Libc can easly be ported to Soso. I have managed to build and run Lua and Doom on Soso!

running

You can download a CD image (ISO file) from releases and try in a virtualization software like VirtualBox or in a PC emulator like QEMU. When it is started, you can run: "doom", "ls", "lua". Executables are in /initrd.

To try Soso in QEMU, just run:

qemu-system-i386 -cdrom soso.iso

Lua

Soso

Doom

To demonstrate multitasking, two doom processes running at the same time:

Doom on Soso

building

To build kernel just run:

make

this will build only kernel (kernel.bin).

To build userspace binaries (while in userspace directory):

make

this will build userspace binaries in userspace/bin directory.

Now an initrd (initial ramdisk) image is needed to put userspace binaries. To create it, run as root (linux specific):

./create-initrd.sh

This will create initrd.fat file. This is a mountable FAT32 initrd image. Once kernel initialization is complete, initrd contents are copied into /dev/ramdisk1 and it is mounted to /initrd. After that kernel runs the /initrd/shell ELF file.

./create-cd-image.sh

This will create soso.iso cd image.

soso's People

Contributors

ozkl avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.