2020-01-29 22:16:15 +00:00
|
|
|
# MOROS: Obscure Rust Operating System
|
2019-12-28 17:08:11 +00:00
|
|
|
|
2020-01-04 17:21:16 +00:00
|
|
|
```
|
2020-01-06 21:46:15 +00:00
|
|
|
.100 110. .1100. 111110. .1001. .01000.
|
|
|
|
00'1001`11 .11 01. 00 `00 .10 00. 10' 11
|
|
|
|
01 00 10 10 00 001101' 01 00 `100.
|
|
|
|
10 01 10 01 11 01`00 01 11 `100.
|
|
|
|
00 01 01 `00 11' 10 `11. `00 11' 01 00
|
|
|
|
11 10 10 `1001' 00 01 `0110' `01101'
|
2020-01-04 17:21:16 +00:00
|
|
|
```
|
2019-12-28 17:08:11 +00:00
|
|
|
|
2020-02-02 17:55:20 +00:00
|
|
|
MOROS is a toy operating system written in Rust for the x86 architecture.
|
|
|
|
|
2020-02-02 18:22:27 +00:00
|
|
|
This project started from the [seventh post][1] of the second edition of
|
|
|
|
[Writing an OS in Rust][2] by Philipp Oppermann and by reading the
|
|
|
|
[OSDev wiki][3] along with many open source kernels.
|
|
|
|
|
|
|
|
## Features
|
2020-02-02 17:55:20 +00:00
|
|
|
|
2020-02-02 18:22:27 +00:00
|
|
|
- [x] External bootloader (using [bootloader](https://github.com/rust-osdev/bootloader))
|
|
|
|
- [x] x86 CPU support (using [x86_64](https://crates.io/crates/x86_64))
|
|
|
|
- [x] Hardware interrupts (using [pic8259_simple](https://crates.io/crates/pic8259_simple))
|
|
|
|
- [x] PS/2 Keyboard (using [pc-keyboard](https://crates.io/crates/pc-keyboard))
|
|
|
|
- [x] VGA Text mode output
|
|
|
|
- [x] Serial output (using [uart_16550](https://crates.io/crates/uart_16550))
|
2020-02-02 17:55:20 +00:00
|
|
|
- [x] Paging
|
2020-02-02 18:22:27 +00:00
|
|
|
- [x] Heap allocation (using [linked_list_allocator](https://crates.io/crates/linked_list_allocator))
|
2020-02-02 17:55:20 +00:00
|
|
|
- [x] RTC clock
|
|
|
|
- [x] PCI enumeration
|
|
|
|
- [x] ATA PIO mode
|
|
|
|
- [x] Random number generator
|
|
|
|
- [x] RTL8139 network card
|
2020-02-02 18:22:27 +00:00
|
|
|
- [x] DHCP/IP/TCP/UDP/DNS/HTTP protocols (using [smoltcp](https://crates.io/crates/smoltcp))
|
2020-02-02 17:55:20 +00:00
|
|
|
- [x] Basic filesystem
|
|
|
|
- [x] Basic shell
|
|
|
|
- [x] Basic text editor
|
|
|
|
- [x] Basic file and network commands
|
|
|
|
- [x] A LOT OF SHORTCUTS TO GET EVERYTHING WORKING
|
|
|
|
- [x] HERE BE DRAGONS
|
|
|
|
- [ ] Processes
|
|
|
|
- [ ] Multitasking
|
|
|
|
- [ ] A real userspace
|
2019-12-29 10:16:59 +00:00
|
|
|
|
2019-12-28 17:08:11 +00:00
|
|
|
## Usage
|
|
|
|
|
|
|
|
Install tools:
|
|
|
|
|
2019-12-29 10:16:59 +00:00
|
|
|
curl https://sh.rustup.rs -sSf | sh
|
|
|
|
rustup install nightly
|
|
|
|
rustup default nightly
|
2020-01-14 22:54:46 +00:00
|
|
|
rustup component add rust-src
|
2020-02-02 17:55:20 +00:00
|
|
|
rustup component add llvm-tools-preview
|
2019-12-28 17:08:11 +00:00
|
|
|
cargo install cargo-xbuild bootimage
|
|
|
|
|
2020-01-17 18:52:48 +00:00
|
|
|
Create disk:
|
|
|
|
|
|
|
|
qemu-img create disk.img 128M
|
|
|
|
|
2019-12-28 17:08:11 +00:00
|
|
|
Run with:
|
|
|
|
|
2020-01-15 21:33:48 +00:00
|
|
|
cargo xrun --release -- \
|
2020-02-02 17:55:20 +00:00
|
|
|
-cpu phenom \
|
2020-01-15 21:33:48 +00:00
|
|
|
-nic model=rtl8139 \
|
|
|
|
-hdc disk.img
|
|
|
|
|
|
|
|
Or with a serial console:
|
|
|
|
|
2020-02-02 17:55:20 +00:00
|
|
|
cargo xrun --release --no-default-features --features serial,dvorak -- \
|
|
|
|
-cpu phenom \
|
2020-01-15 21:33:48 +00:00
|
|
|
-nic model=rtl8139 \
|
2020-02-02 17:55:20 +00:00
|
|
|
-serial stdio \
|
2020-01-15 21:33:48 +00:00
|
|
|
-display none \
|
2020-02-02 17:55:20 +00:00
|
|
|
-hdc disk.img
|
2020-01-15 21:33:48 +00:00
|
|
|
|
|
|
|
Or with `cool-retro-term` for a retro console look:
|
|
|
|
|
|
|
|
sh run/cool-retro-term.sh
|
2019-12-29 10:16:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
## LICENSE
|
|
|
|
|
|
|
|
MOROS is released under MIT.
|
|
|
|
|
|
|
|
[1]: https://github.com/phil-opp/blog_os/tree/post-07
|
|
|
|
[2]: https://os.phil-opp.com
|
2020-02-02 18:22:27 +00:00
|
|
|
[3]: https://wiki.osdev.org
|