1
5
mirror of https://github.com/vinc/moros.git synced 2024-06-19 07:27:06 +00:00
MOROS: Obscure Rust Operating System 🦉
Go to file
Vincent Ollivier 892b697bd3
Add BigInt support to Lisp (#415)
* Add bigint support to Lisp

* Remove Box

* Replace BigInt by i64

* Add back big int

* Work around big int errors

* Print floats with a dot

* Add conversion to f64

* Use Number#parse instead of double

* Add trigo functions to Number

* Add conversion from number to byte

* Add addition to Number

* Add multiplication to Number

* Add negation and substraction to Number

* Add division to Number

* Add reminder to Number

* Add pow to Number

* Fix tests

* Re-enable BigInt

* Add parsing and printing of BigInt

* Add sign

* Add operations on BigInt

* Fix compilation issues

* Add support for add and mul overflow

* Fix bigint conversion to and from str

* Add number-type function

* Add tests

* Add support for pow overflow

* Fix tests

* Add more checks for overflow

* Add check for division by zero

* Fix typo

* Return inf for large exponential operations

* Check for division by zero in modulo

* Add shift operations

* Rewrite comparisons

* Add lazy eval to cond expressions

* Add set fonction

* Add loop function

* Add pi example

* Add builtin pi example to shell

* Update allocation error messages

* Rewrite number conversions

* Remove debug output from pi example

* Move pi command to a dedicated file

* Rewrite bytes->number and number->bytes

* Update doc

* Move op impl to Number

* Add macros to dry code

* Add more macros

* Run clippy
2022-10-17 20:58:08 +02:00
.cargo Remove dependency on rlibc (#115) 2020-11-12 23:07:02 +01:00
.github Read command line args from userspace programs (#351) 2022-06-14 22:43:33 +02:00
doc Add BigInt support to Lisp (#415) 2022-10-17 20:58:08 +02:00
dsk Add BigInt support to Lisp (#415) 2022-10-17 20:58:08 +02:00
run Improve FUSE driver with write and delete (#292) 2022-04-15 13:00:54 +02:00
src Add BigInt support to Lisp (#415) 2022-10-17 20:58:08 +02:00
www Add socket command (#341) 2022-05-21 10:46:16 +02:00
.gitignore Update gitignore 2020-07-03 23:49:58 +02:00
.static Add website (#261) 2021-11-01 08:58:22 +01:00
Cargo.lock Add BigInt support to Lisp (#415) 2022-10-17 20:58:08 +02:00
Cargo.toml Add BigInt support to Lisp (#415) 2022-10-17 20:58:08 +02:00
CHANGELOG.md Update changelog 2022-09-20 20:13:46 +02:00
LICENSE Update copyright year 2022-04-05 15:02:39 +02:00
Makefile Exit from alloc errors after page fault in userspace (#404) 2022-09-03 15:36:53 +02:00
README.md Improve http timeout (#397) 2022-08-28 17:26:13 +02:00
rust-toolchain.toml Fix args ptr alignment (#359) 2022-06-23 20:49:29 +02:00
x86_64-moros.json Add password hashing 2020-01-03 22:01:48 +01:00

MOROS: Obscure Rust Operating System

screenshot

MOROS is a hobby operating system written in Rust by Vincent Ollivier.

It targets computers with a x86-64 architecture and a BIOS, so mostly from 2005 to 2020, but it also runs well on most emulators (Bochs, QEMU, and VirtualBox).

This project started from the seventh post of the second edition of Writing an OS in Rust by Philipp Oppermann and by reading the OSDev wiki along with many open source kernels.

Travis Crates.io

Features

  • External bootloader (using bootloader)
  • x86 CPU support (using x86_64)
  • Hardware interrupts (using pic8259)
  • PS/2 Keyboard with customizable layout (using pc-keyboard)
  • VGA Text mode with customizable font and color palette
  • Serial output (using uart_16550)
  • Paging
  • Heap allocation (using linked_list_allocator)
  • ACPI shutdown (using acpi and aml)
  • RTC clock
  • PCI devices
  • ATA PIO mode
  • Random number generator (using rand_hc)
  • RTL8139 network card
  • AMD PCNET network card
  • DHCP/IP/TCP/UDP/DNS/HTTP network protocols (using smoltcp)
  • Basic filesystem
  • Basic shell
  • Basic text editor
  • Basic lisp interpreter
  • Basic file and network commands
  • Basic userspace for NASM and Rust programs without alloc
  • Multitasking
  • C standard library port

Documentation

Documentation is available here

Setup

Clone the repo:

$ git clone https://github.com/vinc/moros
$ cd moros

Install the required tools with make setup or the following commands:

$ curl https://sh.rustup.rs -sSf | sh
$ rustup install nightly
$ rustup default nightly
$ cargo install bootimage

Usage

Build the image to disk.img:

$ make image output=video keyboard=qwerty

Run MOROS in QEMU:

$ make qemu output=video nic=rtl8139

Run natively on a x86 computer by copying the bootloader and the kernel to a hard drive or USB stick (but there is currently no USB driver so the filesystem will not be available in that case):

$ sudo dd if=target/x86_64-moros/release/bootimage-moros.bin of=/dev/sdx && sync

MOROS will open a console in diskless mode after boot if no filesystem is detected. The following command will setup the filesystem on a hard drive, allowing you to exit the diskless mode and log in as a normal user:

> install

Be careful not to overwrite the hard drive of your OS when using dd inside your OS, and install or disk format inside MOROS if you don't use an emulator.

Tests

Run the test suite in QEMU:

$ make test

License

MOROS is released under MIT.