Most active commenters
  • m463(4)

←back to thread

364 points Klasiaster | 35 comments | | HN request time: 2.09s | source | bottom
1. weinzierl ◴[] No.41853874[source]
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.)

replies(5): >>41853994 #>>41854663 #>>41856026 #>>41857123 #>>41859532 #
2. loeg ◴[] No.41853994[source]
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/

replies(2): >>41854434 #>>41855771 #
3. ackfoobar ◴[] No.41854434[source]
> Hohndel clarified that by "clueless", Torvalds was referring to his younger self

As the saying goes "We do this not because it is easy, but because we thought it would be easy."

Occasionally these are starts of great things.

replies(1): >>41855060 #
4. linsomniac ◴[] No.41854663[source]
I feel like there's a potentially large audience for a kernel that targets running in a VM. For a lot of workloads, a simple VM kernel could be a win.
replies(5): >>41855296 #>>41856571 #>>41857226 #>>41857837 #>>41859876 #
5. nickpsecurity ◴[] No.41855060{3}[source]
Sometimes, we do such things because it’s hard. We enjoy the challenge. Those that succeed are glad to make it, too.
replies(1): >>41856792 #
6. yjftsjthsd-h ◴[] No.41855296[source]
How is that different from Linux with all virtio drivers? (You can just not compile real hardware drivers)
replies(3): >>41855781 #>>41857826 #>>41858114 #
7. m463 ◴[] No.41855771[source]
"You are enthusiastic and write kernel device drivers in rust. Write a device driver for an Intel i350 4 Port gigabit ethernet controller"
replies(4): >>41856263 #>>41857107 #>>41857768 #>>41857911 #
8. m463 ◴[] No.41855781{3}[source]
I would imagine that virtualized device drivers would have a well-defined api and vastly simplified logic.
replies(2): >>41855928 #>>41857243 #
9. yjftsjthsd-h ◴[] No.41855928{4}[source]
I imagine they do. But given that Linux has those simple drivers, why not use them?
10. mdhb ◴[] No.41856026[source]
Also this mysterious new Fuchsia OS from Google is also shooting for full Linux compatibility and is about to show up in Android, I think this is a much more realistic path of the next generation of operating systems that have a real chance to replace Linux but who knows what their actual plans are here at the moment but I don’t believe for a moment that that project is dead in any way.
replies(2): >>41856213 #>>41856686 #
11. lifty ◴[] No.41856213[source]
Can you give more details about it being used in Android? I thought they started using it in some small devices like nest but haven’t heard anything about Android
replies(1): >>41856824 #
12. NetOpWibby ◴[] No.41856263{3}[source]
Some future VC-funded company will unironically have this same requirement
replies(1): >>41856298 #
13. m463 ◴[] No.41856298{4}[source]
It wasn't a requirement, it was a prompt :)
replies(1): >>41856453 #
14. NetOpWibby ◴[] No.41856453{5}[source]
Haha damn, it’s so obvious now. I should be asleep.
15. pjmlp ◴[] No.41856571[source]
This is already the reality today with native cloud computing, managed runtimes.

It doesn't matter how the language gets deployed, if the runtime is on a container, a distroless container, or directly running on an hypervisor.

The runtime provides enough OS like services for the programming language purposes.

16. vbezhenar ◴[] No.41856686[source]
I wonder if decision for stable syscalls was genius? Like imagine that Linux syscalls will become what C ABI is now. And there will be multiple compatible kernels, so you can choose any and run the same userspace.
replies(1): >>41859217 #
17. dathinab ◴[] No.41856792{4}[source]
but most times, even in such cases, people underestimate or not estimate at all the "hard task they do as a challenge" it's kinda part of the whole thing
replies(1): >>41857203 #
18. mdhb ◴[] No.41856824{3}[source]
It’s about to turn up inside Android running in a VM [1] but it was less clear exactly for what purpose.

My theory is that this is essentially a long term project to bring the core of Chrome OS and Android to rely on Fuschia for its core which gives them syscall level compatibility with what they both use at the moment and that they would both essentially sit as products on top of that.

This is essentially the exact strategy they used if I remember correctly with the Nest devices where they swapped out the core and left the product on top entirely unchanged. Beyond that in a longer term scenario we might also just see a Fuchsia OS as a combined mobile / desktop workstation setup and I think part of that is also why we are seeing ChromeOS starting to take a dependency on Android’s networking stack as well right now.

[1] https://www.androidauthority.com/microfuchsia-on-android-345...

19. sshine ◴[] No.41857107{3}[source]
LLMs are notoriously bad at improvising device drivers in no-std Rust.
20. GoblinSlayer ◴[] No.41857123[source]
Just ask an AI to riir linux drivers. Anybody tried it?
21. BodyCulture ◴[] No.41857203{5}[source]
Sometimes we just don’t know if a person that started something did know how hard it would be or not. Sometimes it is not possible to know how hard things can be or not.

Generally this is a very interesting question hat could be discussed in a very long thread, but still the reader will not get any value from it.

22. prmoustache ◴[] No.41857226[source]
this x1000

Provided you have virtio support you are ticking a lot of boxes already.

23. prmoustache ◴[] No.41857243{4}[source]
Shouldn't we start building hardware that have a builtin translation layer that makes them driveable by virtio drivers themselves? At least for the most capabilities?
replies(1): >>41867465 #
24. Y_Y ◴[] No.41857768{3}[source]
Claude Sonnet 3.5 seemed happy enough to do it, and the start looked promising

     Absolutely! Let's dive into writing a device driver for the Intel i350 4 Port Gigabit Ethernet Controller using Rust. This is an exciting project that combines low-level hardware interaction with the safety and performance benefits of Rust. I'll create a basic structure for our driver, focusing on the key components needed to interact with the device.

    #![no_std]
    #![feature(abi_x86_interrupt)]    
    ...

but I'm not qualified to judge the quality from eyeballing and I'm certainly not going to go to the trouble of trying to test it.
replies(1): >>41862094 #
25. lmm ◴[] No.41857826{3}[source]
The point is it would be better than Linux in whatever way that was the reason you were writing it, but you don't have to write hundreds of different device drivers to make your cool new kernel usable.
26. lmm ◴[] No.41857837[source]
Those workloads would probably be better off as unikernels that can run directly on the VM, avoiding the question of which kernel to use entirely.
replies(1): >>41858091 #
27. senko ◴[] No.41857911{3}[source]
You jest, but I believe @tptacek is using an LLM (ChatGPT?) to understand the details of various Linux kernel subsystem and has said it works quite well for the task.

It's not a great jump from that to "port Linux device driver for XYZ to this new OS in Rust". Won't be perfect but a lot less hassle than doing it from scratch.

28. rcxdude ◴[] No.41858091{3}[source]
There's a difference between "want to run an application with as little extra move parts on a VM" and "want to take an existing system and swap out for a kernel with some better properties, even if it means needing to run it in a VM"
29. rcxdude ◴[] No.41858114{3}[source]
If it's written in rust, you might expect less security vulnerabilities (especially if the codebase is also smaller: NB this is potentially counterbalanced by the many eyes on linux). Maybe there would be some extra features you find useful.
30. surajrmal ◴[] No.41859217{3}[source]
Why would you want to support multiple? New versions should always be backwards compatible with older ones, so you'll always have the largest amount of compatibility by targeting the latest upstream. The real challenge comes with supporting applications that want features only available in forked kernels, which I guess could prompt wanting multiple kernels targeting the distinct ABIs.
replies(1): >>41859542 #
31. ◴[] No.41859532[source]
32. vbezhenar ◴[] No.41859542{4}[source]
You can ask the same question about libc, yet there are several competing implementations. Yes, compatibility is not perfect and there are applications which won't work on musl, but still plenty of applications do.
33. eyberg ◴[] No.41859876[source]
This is a very large rationale for what we are building with https://nanos.org .
34. m463 ◴[] No.41862094{4}[source]
"You are a pessimistic and pedantic tester of device drivers. test the following device driver for conformance to the rust language, to the kernel api, to hardening standards, judging the quality following iso 29119."
35. SirGiggles ◴[] No.41867465{5}[source]
I might be misremembering but I recall that Nvidia's BlueField DPUs use virtio when communicating with the host machine. From what I gather searching around it's virtio-net in specific