Live data from Hacker News

MotorOS: a Rust-first operating system for x64 VMs

github.com

51–60 of 125 posts

Re: MotorOS: a Rust-first operating system for x64 VMs

#51

Earlier quoted context omitted.

You don't need very many device drivers to run in a VM. The real question is, how useful is a non-C-compatible, non-Linux-compatible, VM-only OS. Maybe a little bit, for microservices?

According to The American Heritage Dictionary an operating system is: "Software designed to control the hardware of a specific data-processing system in order to allow users and application programs to make use of it." The question is how much Operating System is a software that delegates all "control the hardware" parts to the layer below. I know there are wider definitions of OS, but my point is this is not going t…

[deleted]

Re: MotorOS: a Rust-first operating system for x64 VMs

#53
post #9

It sounds like a cool project and I hope it continues development, but there is such a huge graveyard of such projects that have never gone anywhere that I struggle to get excited about them anymore. Replacing Linux is really hard, even for specific uses like cloud.

Replacing Linux is hard even for the BSDs, and those are very well established and considered basically next-in-line for similar tasks.

You think BSDs are next-in-line? Why is that? I have the distinct impression BSDs will remain niche. Something radical (like MotorOS?) seems more likely.

Re: MotorOS: a Rust-first operating system for x64 VMs

#54
post #53

Earlier quoted context omitted.

Replacing Linux is hard even for the BSDs, and those are very well established and considered basically next-in-line for similar tasks.

You think BSDs are next-in-line? Why is that? I have the distinct impression BSDs will remain niche. Something radical (like MotorOS?) seems more likely.

What do you think is running on your favorite game consoles (that aren't Xbox)? I'll give you a hint, it isn't Linux.

Nintendo is using a custom OS but with a huge chunk of user space borrowed from FreeBSD. Sony on the other hand just went and forked FreeBSD outright.

You might also want to look into what OS are being used for server environments. A lot more BSD there than you might have initially guessed.

Re: MotorOS: a Rust-first operating system for x64 VMs

#55

Sounds interesting, but it also reminds me of what Linus once said when asked about fearing competition. From my memory his answer was something like: I really like writing device drivers. Few people like that and until someone young and hungry comes along who likes that I'm not afraid of competition.

You don't need very many device drivers to run in a VM. The real question is, how useful is a non-C-compatible, non-Linux-compatible, VM-only OS. Maybe a little bit, for microservices?

It's relatively trivial to have a `FROM scratch` dockerised microservice in Rust. I'm not convinced having an entire OS brings that much to the table.

Re: MotorOS: a Rust-first operating system for x64 VMs

#56
post #43

> Nix OS all exist because of Linux's complexity That said, I would be thrilled to build this and other alt OSes and their userlands with Nix / Nixpkgs :).

> because of Linux's complexity Linux is not complex but there are some design issues with C ABI and glibc stability and symlinks.

Indeed I would say Linux is as simple as possible given various goals ... however, 'simple as possible' can still be complex!

Re: MotorOS: a Rust-first operating system for x64 VMs

#59
post #36

> a simple multi-processor round robin (SMP) > the kernel is very small and does not block, so does not need to be preemptible I don't believe you and I don't even need to look at the code to know this is false.

Care to elaborate?

From the docs at the top of scheduler.rs

    // The scheduler.
    //
    // As the kernel supports wait/wake/swap, and no blocking in the kernel
    // other than wait, any kind of more sophisticated scheduling policy
    // can be implemented in the userspace (in theory; maybe tweaks are needed
    // to make things perform well in practive).
    //
    // So the default scheduler here is rather simple, but should work
    // for a lot of use cases.
    //
    // Priorities: see enum Priority
    // Cpu affinity: a single CPU hint
    // Sched groups: none: everything within a priority is round robin, so
    // a process with many threads will negatively affect a process with few threads.
    //
    // This should be OK for most situations: if there is a need for isolation,
    // just use another VM.
That's elaboration enough I think?

Re: MotorOS: a Rust-first operating system for x64 VMs

#60
post #45

Earlier quoted context omitted.

In general, lots of hardware requires long waits to initialize. As in, program a value then you must wait 50 ms before querying the registers or the hardware will give you non-deterministic garbage with no error indication. So, it depends on the hardware, though you are unlikely to need more than 1 second on anything other than truly degenerate hardware assuming you are initializing devices in parallel.

But it’s only for VMs. So what hardware are you initializing?

I pass through a GPU and USB hub to a VM running on a machine in the garage. An optical video cable and network compatible USB extender brings the interface to a different room making it my primary “desktop” computer (and an outdated laptop as a backup device). Doesn’t get more silent and cool than this. Another VM on the garage machine gets a bunch of hard drives passed through to it.

That said, hardware passthrough/VFIO is likely out of the current realistic scope for this project. VM boot times can be optimized if you never look for hardware to initialize in the first place. Though they are still likely initializing a network interface of some sort.

“MicroVM” seems to be a term used when as much as possible is stripped from a VM, such as with https://github.com/firecracker-microvm/firecracker

Post reply on HN