All Projects → MQuy → Mos

MQuy / Mos

Licence: mit
A hobby operating system developed from scratch

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Mos

Reactos
A free Windows-compatible Operating System
Stars: ✭ 10,216 (+5944.97%)
Mutual labels:  x86, operating-system, os, osdev
Toaru Nih
NOTICE: The ToaruOS-NIH Project has been MERGED UPSTREAM. This repository is now archived.
Stars: ✭ 66 (-60.95%)
Mutual labels:  x86, operating-system, 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 (+2673.37%)
Mutual labels:  x86, operating-system, 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 (-86.39%)
Mutual labels:  os, osdev, operating-system, x86
kora-kernel
Kernel for my operating system KoraOS
Stars: ✭ 15 (-91.12%)
Mutual labels:  os, osdev, operating-system, x86
Macaron
A sweet hobby made operating system written in C++ for x86 CPUs with GUI
Stars: ✭ 34 (-79.88%)
Mutual labels:  os, osdev, operating-system, x86
Aqeous
(Inactive, Checkout AvanaOS, Rewrite of this) This is a New Operating System (Kernel right now). Made completely from scratch, We aim to make a complete OS for Learning purpose
Stars: ✭ 23 (-86.39%)
Mutual labels:  os, osdev, operating-system, x86
Dennix
Dennix is a unix-like hobbyist operating system written from scratch.
Stars: ✭ 53 (-68.64%)
Mutual labels:  x86, operating-system, os, osdev
utero
The Operating System (for x86_64) written in Crystal as much as possible
Stars: ✭ 55 (-67.46%)
Mutual labels:  os, osdev, operating-system
poplar
Microkernel and userspace written in Rust exploring modern ideas
Stars: ✭ 217 (+28.4%)
Mutual labels:  os, osdev, operating-system
nightingale
A small operating system where I experiment and learn osdev.
Stars: ✭ 86 (-49.11%)
Mutual labels:  os, osdev, operating-system
KnutOS
An x86_64 hobbyist OS written in C and Assembly
Stars: ✭ 16 (-90.53%)
Mutual labels:  os, osdev, operating-system
TravorOS
A simple OS running on Intel x86 architecture | No longer updating
Stars: ✭ 24 (-85.8%)
Mutual labels:  os, operating-system, x86
kernel
Main kernel tree
Stars: ✭ 28 (-83.43%)
Mutual labels:  os, osdev, x86
MandelbrotOS
A community driven OS by the youth
Stars: ✭ 172 (+1.78%)
Mutual labels:  os, osdev, operating-system
LudOS
A toy monolithic kernel written in C++
Stars: ✭ 38 (-77.51%)
Mutual labels:  os, osdev, operating-system
Osinysuhomework
🚪Own experiments operating systems🚪
Stars: ✭ 8 (-95.27%)
Mutual labels:  operating-system, os, file-system
Aquila
AquilaOS: UNIX-like Operating System
Stars: ✭ 413 (+144.38%)
Mutual labels:  operating-system, os, osdev
Emerald
An operating system written in C
Stars: ✭ 118 (-30.18%)
Mutual labels:  operating-system, os, osdev
beeos
A simple "Unix-like" kernel trying to be POSIX compliant
Stars: ✭ 103 (-39.05%)
Mutual labels:  os, osdev, operating-system

mOS

license MIT By Vietnamese

mOS is the unix-like operating system developed from scratch and aims to POSIX compliant.

Work-in-process features

  • [x] Filesystem
  • [x] Program loading
  • [x] UI (X11)
  • [x] Log
  • [x] Networking
  • [x] Signal
  • [x] Terminal
  • [x] mOS toolchain
  • [x] Port figlet
  • [x] Libc
  • [x] Port GNU Bash, Coreutils
  • [ ] Unit testing
  • [ ] Dynamic linker
  • [ ] Port GCC (the GNU Compiler Collection)
  • [ ] Browser
  • [ ] Sound
  • [ ] Symmetric multiprocessing

🍀 Optional features

  • [ ] Setup 2-level paging in boot.asm

Get started

MacOS

  • install packages

    $ brew install qemu nasm gdb i386-elf-gcc i386-elf-grub bochs e2fsprogs xorriso
    
  • open your bash config and add lines below. Depends on your bash, config file might be different. I use ohmyzsh, so it is .zshrc

    # .zshrc
    alias grub-file=i386-elf-grub-file
    alias grub-mkrescue=i386-elf-grub-mkrescue
    
  • run emulator

    $ cd src && mkdir logs
    $ ./create_image.sh && ./build.sh qemu iso
    
  • open another terminal

    $ cd src
    $ gdb isodir/boot/mos.bin
    # in gdb
    (gdb) target remote localhost:1234
    (gdb) c
    

✍🏻 If you get this error hdiutil: attach failed - no mountable file systems, installing extFS for MAC might help

Ubuntu

  • Install packakges

    $ sudo apt install build-essential autopoint bison gperf texi2html texinfo qemu automake-1.15 nasm xorriso qemu-system-i386
    
  • Install gcc cross compilier via https://wiki.osdev.org/GCC_Cross-Compiler#The_Build

  • Install GCC (Version 9.1.0) & Binutils (Version 2.32).

  • Open src/toolchain/build.sh and modify SYSROOT and PREFIX variables to fit in your case

    PREFIX="$HOME/opt/cross"
    TARGET=i386-pc-mos
    # SYSROOT cannot locate inside PREFIX
    SYSROOT="$HOME/Projects/mos/src/toolchain/sysroot"
    JOBCOUNT=$(nproc)
    
  • Install mos toolchain

    $ cd src/toolchain
    $ ./build.sh
    
  • Run Emulator

    $ cd src && mkdir logs
    $ ./create_image.sh
    $ cd ports/figlet && ./package.sh && cd ../..
    $ cd ports/bash && ./package.sh make && cd ../..
    $ cd ports/coreutils && ./package.sh make && cd ../..
    $ ./build.sh qemu iso
    
  • Open another terminal

    $ cd src
    $ gdb isodir/boot/mos.bin
    # in gdb
    (gdb) target remote localhost:1234
    (gdb) c
    

✍️ To get userspace address for debugging

$ i386-mos-readelf -e program
# find the line below and copy Addr
# [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
# [ x] .text             PROGBITS        xxx      xxx    xxx    00 AX   0   0  4

Unit Test

$ cd test && git clone https://github.com/ThrowTheSwitch/Unity.git unity
$ make clean && make

Debuging

in build.sh, adding -s -S right after qemu to switch to debug mode. Currently, I use vscode + native debuge -> click Run -> choose "Attach to QEMU"

Monitoring

by default mOS log outputs to terminal. If you want to monitor via file, doing following steps

# src/build.sh#L71
-serial stdio
↓
-serial file:logs/uart1.log
$ tail -f serial.log | while read line ; do echo $line ; done

✍🏻 Using tail in pipe way to color the output (like above) causes a delay -> have to manually saving in ide to get latest changes

References

Tutorials

Ebooks

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