Home

Awesome

mOS

license MIT By Vietnamese

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

Work-in-process features

šŸ€ Optional features

Get started

MacOS

āœšŸ» If you get this error hdiutil: attach failed - no mountable file systems, installing extFS for MAC might help

Ubuntu

āœļø 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

Debugging

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

Monitoring

by default, mOS logs output 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 save in the IDE to get latest changes

References

Tutorials

Ebooks