Live data from Hacker News

Asterinas: OS kernel written in Rust and providing Linux-compatible ABI

github.com

41–50 of 234 posts

Re: Asterinas: OS kernel written in Rust and providing Linux-compatible ABI

#41

> Linux-compatible ABI There's no specification of that ABI, much less a compliance test suite. How complete is this compatibility?

Here is a list of implemented syscalls, but of course each checked one could still be slightly incompatible:

https://asterinas.github.io/book/kernel/linux-compatibility....

Re: Asterinas: OS kernel written in Rust and providing Linux-compatible ABI

#42
post #40

I'm interested in these kind of kernels to run very high performance network/IO specific services on bare metal, with minimal system complexity/overheads and hopefully better (potential) stability and security. The big concern I have however is hardware support, specifically networking hardware. I think a very interesting approach would be to boot the machine with a FreeBSD or Linux kernel, just for the purposes of h…

Couldn't you just boot the Linux kernel directly and launch a generic app as pid 1 instead of a full blown init system with a bunch of daemons? That's basically what you're getting with Docker containers and a shared kernel. AWS Lambda is doing something similar with dedicated kernels with Firecracker VMs

Yes, you can. You can even have a different Pid 1 configure whatever and then replace it's core image with the new Pid 1.

Re: Asterinas: OS kernel written in Rust and providing Linux-compatible ABI

#43
post #38

Earlier quoted context omitted.

Linux doesn't even maintain ABI compatibility with itself , nobody else is going to manage it. The possibility that might work is there's a couple projects that maintain just enough A P I compatibility to reuse driver code from Linux (IIRC FreeBSD does this for some graphics drivers). But even then you're gambling with whether Linux decides to change implementation details one day, since internal APIs explicitly aren…

The Linux kernel community takes ABI compatibility for userland very seriously. That developers in userland are frequently unwilling to understand issues surrounding ABI stability is not the fault of the Linux kernel.

Oh sure, the user-space ABI is stable; I meant kernel-space. Although I realize now that I failed to write that explicitly.

Re: Asterinas: OS kernel written in Rust and providing Linux-compatible ABI

#44
Decades ago Linus Torvalds was asked in an interview if he feared Linux to be replaced by something new. His answer was that some day someone young and hungry would come along, but unless they liked writing device drivers Linux would be safe.

This is all paraphrased from my memory, so take it with a grain of salt. I think the gist of it is still valid: Projects like Asterinas are interesting and have a place, but they will not replace Linux as we have it today.

(Asterinas, from what I understood, doesn't claim to replace Linux, but it a common expectation.)

Re: Asterinas: OS kernel written in Rust and providing Linux-compatible ABI

#45

> Linux-compatible ABI There's no specification of that ABI, much less a compliance test suite. How complete is this compatibility?

Here is a list of implemented syscalls, but of course each checked one could still be slightly incompatible: https://asterinas.github.io/book/kernel/linux-compatibility....

There's also tons of ioctls and /proc and what not.

Re: Asterinas: OS kernel written in Rust and providing Linux-compatible ABI

#46

Decades ago Linus Torvalds was asked in an interview if he feared Linux to be replaced by something new. His answer was that some day someone young and hungry would come along, but unless they liked writing device drivers Linux would be safe. This is all paraphrased from my memory, so take it with a grain of salt. I think the gist of it is still valid: Projects like Asterinas are interesting and have a place, but the…

More recently, in a similar vein:

> Torvalds seemed optimistic that "some clueless young person will decide 'how hard can it be?'" and start their own operating system in Rust or some other language. If they keep at it "for many, many decades", they may get somewhere; "I am looking forward to seeing that". Hohndel clarified that by "clueless", Torvalds was referring to his younger self; "Oh, absolutely, yeah, you have to be all kinds of stupid to say 'I can do this'", he said to more laughter. He could not have done it without the "literally tens of thousands of other people"; the "only reason I ever started was that I didn't know how hard it would be, but that's what makes it fun".

https://lwn.net/Articles/990534/

Re: Asterinas: OS kernel written in Rust and providing Linux-compatible ABI

#47
post #34

Earlier quoted context omitted.

This was true a decade ago, with modern io_uring dpdk is probably an anti-pattern.

Interesting, it's been awhile since I looked at this stuff so I did a little searching and found this: https://www.diva-portal.org/smash/get/diva2:1789103/FULLTEXT... Their conclusion is io_uring is still slower but not by much, and future improvements may make the difference negligible. So you're right, at least in part. Given the tradeoffs, DPDK may not be worth it anymore.

There are also just a bunch of operational hassles with using DPDK or SPDK. Your usual administrative commands don't work. Other operations aren't intermediated by the kernel -- instead you need 100% dedicated application devices. Device counters usually tracked by the kernel aren't. Etc. It can be fine, but if io_uring doesn't add too much overhead, it's a lot more convenient.

Re: Asterinas: OS kernel written in Rust and providing Linux-compatible ABI

#48
Super cool project. Looks like the short-term target use-case is running a Linux-compatible OS in an Intel TDX guest VM with a significantly safer and smaller TCB. Makes sense. This way you also postpone a lot of the HW driver development drudgery and instead only target VM devices.

Re: Asterinas: OS kernel written in Rust and providing Linux-compatible ABI

#49
post #35

Earlier quoted context omitted.

Rust code is usually well commented in my experience.

Instead of asking "what other languages and project (open/closed, big/small, web/mobile/desktop, game/consumerapp/bizapp) have you experience with as to come to this conclusion?" people down vote you. So lemme ask: what other languages and project (open/closed, big/small, web/mobile/desktop, game/consumerapp/bizapp) have you experience with as to come to this conclusion?

I expect the downvotes to be there because it's talking positively about rust, which is blasphemy! /j

Re: Asterinas: OS kernel written in Rust and providing Linux-compatible ABI

#50
post #27

The license choice is explained with the following: > [...] we accommodate the business need for proprietary kernel modules. Unlike GPL, the MPL permits the linking of MPL-covered files with proprietary code. Glancing at the readme, it also looks like they are treating it as a big feature: > Asterinas surpasses Linux in terms of developer friendliness. It empowers kernel developers to [...] choose between releasing t…

I'm curious about the practical aspect: Are they going to freeze a stable driver ABI, or are they going to break proprietary drivers from time to time?

Considering their OS as a framework approach I would guess they are more likely to expose a stable API than a stable ABI. Which also plays well with the MPL license (source file based) rather than something like the LGPL (~linking based).
Post reply on HN