Live data from Hacker News

Moss: a Rust Linux-compatible kernel in 26,000 lines of code

github.com

21–30 of 163 posts

Re: Moss: a Rust Linux-compatible kernel in 26,000 lines of code

#22
post #4

Hello! For the past 8 months, or so, I've been working on a project to create a Linux-compatible kernel in nothing but Rust and assembly. I finally feel as though I have enough written that I'd like to share it with the community! I'm currently targeting the ARM64 arch, as that's what I know best. It runs on qemu as well as various dev boards that I've got lying around (pi4, jetson nano, AMD Kria, imx8, etc). It has…

Cool project, congrats. I like the idea with libkernel which makes debugging easier before going to "hardware". It's like the advantages of a microkernel achievable in a monolithic kernel, without the huge size of LKL, UML or rump kernels. Isn't Rust async/awat depending on runtime and OS features? Using it in the kernel sounds like an complex bootstrap challenge.

This has been a real help! The ability to easily verify the behavior of certain pieces of code (especially mem management code) must have saved me hours of debugging.

Regarding the async code, sibling posts have addressed this. However, if you want to get a taste of how this is implemented in Moss look at src/sched/waker.rs, src/sched/mod.rs, src/sched/uspc_ret.rs. These files cover the majority of the executor implementation.

Re: Moss: a Rust Linux-compatible kernel in 26,000 lines of code

#24
post #14

Really neat. Do you have any specific long term goals for it? Eg, provide an OS distro (using Linux drivers?) to provide memory safety for security-critical contexts? Also, are there any opportunities to make this kernel significantly faster than Linux’s?

Eventually, It'd be amazing to use Moss as my daily driver OS. That means targeting the specific hardware that I have, but in doing so, I hope to build up enough of the abstractions to allow easier porting of hardware.

A more concrete mid-term goal is for it to be 'self-hosting'. By that I mean you could edit the code, download dependencies and compile the kernel from within Moss.

Re: Moss: a Rust Linux-compatible kernel in 26,000 lines of code

#25

Very cool project! I do have to admit - looking far, far into the future - I am a bit scared of a Linux ABI-compatible kernel with an MIT license.

Why?

because otherwise big tech companies will take it and modify and release hardware with it without releasing patches etc? Basically being selfish and greedy?

Re: Moss: a Rust Linux-compatible kernel in 26,000 lines of code

#26

Very cool project! I do have to admit - looking far, far into the future - I am a bit scared of a Linux ABI-compatible kernel with an MIT license.

Too late? https://docs.freebsd.org/en/books/handbook/linuxemu/

Somewhere there is a dark timeline where the BSDs won, there are 50 commercial and open source variants all with their own kernel and userland. The only promise of interoperability is in extremely ossified layers like POSIX. There is, however, something terrible gathering its strength. A colossus. The great Shade that will eat the net. In boardroom meetings across the land, CTOs whisper its name and tremble... "OS/2."

Re: Moss: a Rust Linux-compatible kernel in 26,000 lines of code

#28
post #25

Earlier quoted context omitted.

Why?

because otherwise big tech companies will take it and modify and release hardware with it without releasing patches etc? Basically being selfish and greedy?

It is neither selfish nor greedy to accept and use a gift freely given to you.

Receiving a gift does not confer obligations on the recipient.

Re: Moss: a Rust Linux-compatible kernel in 26,000 lines of code

#29

Hello! For the past 8 months, or so, I've been working on a project to create a Linux-compatible kernel in nothing but Rust and assembly. I finally feel as though I have enough written that I'd like to share it with the community! I'm currently targeting the ARM64 arch, as that's what I know best. It runs on qemu as well as various dev boards that I've got lying around (pi4, jetson nano, AMD Kria, imx8, etc). It has…

Congratulations on the progress. If I may ask, I'm curious what considerations have motivated your choice of licence (especially since pushover licences seem extremely popular with all kinds of different Rust projects, as opposed to copyleft).

Re: Moss: a Rust Linux-compatible kernel in 26,000 lines of code

#30
post #28
post #25

Earlier quoted context omitted.

because otherwise big tech companies will take it and modify and release hardware with it without releasing patches etc? Basically being selfish and greedy?

It is neither selfish nor greedy to accept and use a gift freely given to you. Receiving a gift does not confer obligations on the recipient.

True, but you would probably still be pissed if somebody took your gift and hit you over the head with it.
Post reply on HN