AI prompts
base on A simple, fast, and secure operating system for the cloud. # Motor OS
[Motūrus](https://moturus.com) project (Motor OS) is a simple,
fast, and secure operating system built for the cloud.
Designed specifically for virtualized workloads such as web serving, serverless computing,
and edge caching, it addresses inefficiencies found in traditional operating systems
like Linux when running in virtual environments.
[Motor OS](https://motor-os.org) is built entirely in Rust. It supports x64 KVM-based virtual machines
and can run on Qemu, Cloud Hypervisor, or Alioth VMMs. The system, including
its libraries and syscalls, is implemented in Rust and optimized for Rust-based client applications.
## Why?
At the moment, most virtualized production workloads run Linux.
While Linux has many advanced features that in many
situations mean it is the only reasonable OS choice, there are
several complications that make it not ideal, in theory,
for some virtualized workloads:
* Linux is optimized for baremetal, which leads to inefficiencies
when it is used inside a VM that is running on a Linux host:
* duplicate block caches
* duplicate page table walks
* the host scheduler can preempt the VCPU holding a spinlock in the VM's kernel
* Linux is difficult to use:
* Docker, Nix OS, "serverless", etc. all exist because of Linux's complexity
* Linux has, historically, not been very secure
A new operating system built from ground-up with the focus
on virtualized workloads can be made much simpler and more
secure than Linux, while matching or exceeding its
performance and/or efficiency.
## What?
Motor OS is a microkernel-based operating system, built in Rust, that targets virtualized workloads exclusively.
It currently supports x64 KVM-based virtual machines, and can run in Qemu, Cloud Hypervisor, or Alioth VMMs.
Rust is the language of Motor OS: not only it is implemented in Rust, it also exposes its ABI in Rust, not C.
### What works
Motor OS is under active development, and should not be used for sensitive workloads.
It is, however, ready for trials/experiments/research. In fact, Motor OS
[web site](https://motor-os.org) is served from inside a couple of Motor OS VMs (proxied via Cloudflare).</p>
More specifically, these things work:
* boots via MBR (Qemu) or PVH (Alioth, Cloud Hypervisor) in 100ms (Alioth) or 200ms (CHV, Qemu)
* himem micro-kernel
* scheduling:
* a simple multi-processor round robin (SMP)
* in-kernel scheduling is cooperative:
* the kernel is very small and does not block, so does not need to be preemptible
* the userspace is preemptible
* memory management:
* only 4K pages at the moment
* * stacks are guarded
* * page faults in the userspace work and are properly handled (only stack memory allocations are currently lazy)
* I/O subsystem (in the userspace)
* VirtIO-BLK and VirtIO-NET <a href="https://github.com/moturus/motor-os/tree/main/src/sys/lib/virtio">drivers</a>
* two simple filesystems (<a href="https://crates.io/crates/srfs">srfs</a> and <a href="https://crates.io/crates/flatfs">flatfs</a>)
* <a href="https://crates.io/crates/smoltcp">smoltcp</a>-based networking (TCP only at the moment)
* max host-guest TCP throughput is about 10Gbps at the moment
* the userspace:
* multiple processes, with preemption
* threads, thread local storage
* Rust's standard library mostly ported
* Rust programs that use Rust standard library and do not depend, directly or indirectly, on Unix or Windows FFI,
will cross-compile for Motor OS and run, subject to "what does not work" below
* a simple TLS-enabled <a href="https://github.com/moturus/motor-os/tree/main/src/bin/httpd">httpd</a> is provided
* a simple <a href="https://github.com/moturus/rush">unix-like</a> shell in the serial console
* a simle <a href="https://github.com/moturus/motor-os/tree/main/src/bin/kibim">text editor</a>
* basic commands like free, ps, ls, top, cat, ss, etc. (do `ls bin` to list all commands)
### What does not work
Most pieces are not yet ready for production use. No security audit has been made.
More specifically:
* Filesystem: most Rust std::fs APIs have been implemented as proof-of-concept,
but are slow (synchronous) and will have to be reimplemented using Motor OS async I/O
* Networking:
* DHCP not implemented: static IP addresses only at the moment
* DNS lookup not implemented yet
* UDP not implemented yet
* The ecosystem outside Rust std:
* "sans-io" crates and crates like rand or rustls can be compiled and used with minor tweaks
* crates depending on specific async runtimes (e.g. Tokio) will not compile at the moment
* [Tokio Mio](https://github.com/tokio-rs/mio) will soon be ported
* crates that are wrappers around native Linux or Windows APIs will not work, obviously
## How can I build/run it?
See [docs/build.md](docs/build.md).
## Examples and recipes
see [docs/recipes/index.md](docs/recipes/index.md).
", Assign "at most 3 tags" to the expected json: {"id":"6807","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"