* Add e1000 network card support * Read MAC from EEPROM * Read MAC without EEPROM * Add device id for ThinkPad X200 * Fix makefile merge * Add todo list * Add WIP implementation * Add qemu trace to makefile * Rewrite parts of the implementation * Fix descriptor cloning * Return received buffer * Break from loop when transmitted * Comment out debug code * Comment out more code * Rename allocator variables * Fix debug issue * Add more device ids * Reset RxDesc status when done * Process packet even if ICR_RXT0 is set * Remove debug output * Refactor code * Fix typo * Fix RDT updates * Update documentation * Update makefile to match doc * Group network cards in readme * Refactor code * Avoid using ICR to check for new packets * Fix panic on invalid datagram size * Refactor code to stay below 80 chars * Increase buffer size * Add FIXME to test for EOP * Clean up code * Add PCI id for I217-LM * Update hardware page * Add PCI id for the Intel PRO/1000 GT * Update hardware page * Fix init_tx for Intel I217-LM * Refactor comments * Update website * Fix whitespace * Update doc for VirtualBox * Reorder cards in doc * Reorder cards in doc * Restore signal * Move makefile trace option to qemu * Add ThinkCentre M83 to hardware list * Increase receive buffer back to 64 * Refactor reset * Print MAC address in uppercase * Disable interrupts * Add TODO comment
3.5 KiB
MOROS: Obscure Rust Operating System
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.
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)
- Intel PRO/1000, RTL8139, and AMD PCNET network cards
- DHCP/IP/TCP/UDP/DNS/HTTP network protocols (using smoltcp)
- Basic filesystem
- Basic shell
- Basic text editor
- Basic lisp interpreter
- Basic userspace for NASM and Rust programs
- Some file and network commands
- Some games
Documentation
Documentation is available here
Setup
You will need git
, gcc
, make
, curl
, qemu-img
,
and qemu-system-x86_64
on the host system.
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 -s -- -y --default-toolchain none
$ rustup show
$ 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
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.