|
24 | 24 |
|
25 | 25 | <img src="meta/screenshots/desktop.png" alt="Desktop Screenshot" /> |
26 | 26 |
|
27 | | -**PatchworkOS** is a modular non-POSIX operating system for the x86_64 architecture that rigorously follows an "everything is a file" philosophy, in the style of Plan9. Built from scratch in C and assembly, it's intended to be an educational and experimental operating system. |
| 27 | +**PatchworkOS** is a modular non-POSIX operating system for the x86_64 architecture that rigorously follows an "everything is a file" philosophy. Built from scratch in C and assembly. |
28 | 28 |
|
29 | | -While primarily a project made for fun, the goal is still to make a "real" operating system, one that runs on real hardware and has the performance one would expect from a modern operating system without jumping ahead to user space features or drivers, a floppy disk driver and a round-robin scheduler are not enough. |
| 29 | +While primarily a project made for fun, the goal is still to make a "real" operating system, one that runs on real hardware and has the performance one would expect from a modern operating system without jumping ahead to user space features or drivers, a floppy disk driver with a round-robin scheduler is not enough. |
30 | 30 |
|
31 | 31 | PatchworkOS is not a UNIX clone, it's intended to be a (hopefully) interesting experiment in operating system design by attempting to use unique algorithms and designs over tried and tested ones. Sometimes this leads to bad results, and sometimes, with a bit of luck, good ones. |
32 | 32 |
|
@@ -55,7 +55,7 @@ Will this project ever reach its goals? Probably not, but that's not the point. |
55 | 55 |
|
56 | 56 | - Preemptive and tickless [EEVDF scheduler](https://kainorberg.github.io/PatchworkOS/html/d7/d85/group__kernel__sched.html) based upon the [original paper](https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=805acf7726282721504c8f00575d91ebfd750564) and implemented using an [Augmented Red-Black tree](https://kainorberg.github.io/PatchworkOS/html/da/d90/group__kernel__utils__rbtree.html) to achieve `O(log n)` worst case complexity. EEVDF is the same algorithm used in the modern Linux kernel, but ours is obviously **a lot** less mature. |
57 | 57 | - Multithreading and Symmetric Multi Processing with fine-grained locking. |
58 | | -- Physical and virtual memory management is `O(1)` per page and `O(n)` where `n` is the number of pages per allocation/mapping operation, see [benchmarks](#benchmarks) for more info. |
| 58 | +- Optimized memory management, featuring object caching and `O(1)` per page physical and virtual memory managers. See [benchmarks](#benchmarks) for more info. |
59 | 59 | - File based IPC including [pipes](https://kainorberg.github.io/PatchworkOS/html/d7/d64/group__modules__ipc__pipe.html), [shared memory](https://kainorberg.github.io/PatchworkOS/html/df/d3f/group__modules__ipc__shmem.html), [sockets](https://kainorberg.github.io/PatchworkOS/html/d4/db0/group__kernel__fs__netfs.html) and Plan9 inspired "signals" called [notes](https://kainorberg.github.io/PatchworkOS/html/d8/db1/group__kernel__ipc__note.html). |
60 | 60 | - File based device API [abstractions](https://kainorberg.github.io/PatchworkOS/html/de/d7b/group__kernel__drivers__abstract.html), including framebuffers, input devices, etc. |
61 | 61 | - [Synchronization primitives](https://kainorberg.github.io/PatchworkOS/html/dd/d6b/group__kernel__sync.html) including Read-Copy-Update, mutexes, R/W locks, sequential locks, futexes and others. |
@@ -92,6 +92,24 @@ Will this project ever reach its goals? Probably not, but that's not the point. |
92 | 92 | - Fully Asynchronous I/O and syscalls (io_uring?). |
93 | 93 | - USB support. |
94 | 94 |
|
| 95 | +## Setup |
| 96 | + |
| 97 | +```bash |
| 98 | +# Install dependencies |
| 99 | +sudo dnf install gcc make mtools qemu-system-x86 # For Fedora |
| 100 | +sudo apt install build-essential mtools qemu-system-x86 # For Debian/Ubuntu |
| 101 | + |
| 102 | +# Clone this repository, you can also use the green Code button at the top of the Github. |
| 103 | +git clone https://github.com/KaiNorberg/PatchworkOS |
| 104 | +cd PatchworkOS |
| 105 | + |
| 106 | +# Build (creates PatchworkOS.img in bin/) |
| 107 | +make all |
| 108 | + |
| 109 | +# Run using QEMU |
| 110 | +make run |
| 111 | +``` |
| 112 | + |
95 | 113 | --- |
96 | 114 |
|
97 | 115 | ## Doxygen Documentation |
@@ -635,7 +653,9 @@ The scheduler has not yet been properly benchmarked. However, testing using the |
635 | 653 |
|
636 | 654 | ## Shell Utilities |
637 | 655 |
|
638 | | -PatchworkOS includes its own shell utilities designed around its [file flags](#file-flags) system, when file flags are used we also demonstrate the short form. Included is a brief overview with some usage examples. For convenience the shell utilities are named after their POSIX counterparts, however they are not drop-in replacements. |
| 656 | +PatchworkOS includes its own shell utilities designed around its [file flags](#file-flags) system, allowing all shell utilities to be "dumb" and rely on the virtual file system to provide more complex behavior. |
| 657 | + |
| 658 | +Included is a brief overview with some usage examples. For convenience the shell utilities are named after their POSIX counterparts, however they are not drop-in replacements. When file flags are used we also demonstrate the short form. |
639 | 659 |
|
640 | 660 | ### touch |
641 | 661 |
|
@@ -734,28 +754,7 @@ There are other utils available that work as expected, for example `symlink` and |
734 | 754 |
|
735 | 755 | --- |
736 | 756 |
|
737 | | -## Setup |
738 | | - |
739 | | -### Requirements |
740 | | - |
741 | | -| Requirement | Details | |
742 | | -|:------------|:--------| |
743 | | -| **OS** | Linux (WSL might work, but I make no guarantees) | |
744 | | -| **Tools** | GCC, make, mtools, QEMU (optional) | |
745 | | - |
746 | | -### Build and Run |
747 | | - |
748 | | -```bash |
749 | | -# Clone this repository, you can also use the green Code button at the top of the Github. |
750 | | -git clone https://github.com/KaiNorberg/PatchworkOS |
751 | | -cd PatchworkOS |
752 | | - |
753 | | -# Build (creates PatchworkOS.img in bin/) |
754 | | -make all |
755 | | - |
756 | | -# Run using QEMU |
757 | | -make run |
758 | | -``` |
| 757 | +## Development |
759 | 758 |
|
760 | 759 | ### Additional commands |
761 | 760 |
|
@@ -855,6 +854,10 @@ If you are unsure where to start, check the [Todo List](https://kainorberg.githu |
855 | 854 |
|
856 | 855 | Check out the [contribution guidelines](CONTRIBUTING.md) to get started. |
857 | 856 |
|
| 857 | +## License |
| 858 | + |
| 859 | +Distributed under the MIT License. See [LICENSE](https://github.com/KaiNorberg/PatchworkOS/blob/main/LICENSE) for more information. |
| 860 | + |
858 | 861 | ## Nostalgia |
859 | 862 |
|
860 | 863 | [The first Reddit post and image of PatchworkOS](https://www.reddit.com/r/osdev/comments/18gbsng/a_little_over_2_years_ago_i_posted_a_screenshot/) from back when getting to user space was a massive milestone and the kernel was supposed to be a UNIX-like microkernel. |
0 commit comments