Live data from Hacker News

Kerla: Monolithic kernel in Rust, aiming for Linux ABI compatibility

github.com

11–20 of 196 posts

Re: Kerla: Monolithic kernel in Rust, aiming for Linux ABI compatibility

#11

For each piece of software, there just be a version in Rust, and that version must advertise it's rustiness

The type of software makes the difference - does it process untrusted input, maybe even over the network? This here is a kernel including a memory-safe TCP/IP stack (https://github.com/smoltcp-rs/smoltcp/), and not having it crash or be full of security vulnerabilities due to preventable memory corruption is a quality beyond personal language preferences.

Re: Kerla: Monolithic kernel in Rust, aiming for Linux ABI compatibility

#12
post #4

A star has been born. A Linux alternative needs to be compatible with Linux binaries and also support modern architectures. If you want Linux to survive, it needs to be re-written from scratch, optimised in Rust and compatible with the existing Linux binaries or drivers. This project might have a chance. From: [0] > TL;DR: I'm writing a Linux clone in Rust just for fun. It does NOT aim to replace the Linux kernel. A…

sigh... Linux is going to survive. And no it does not need to be re-written from scratch in Rust. Someone lied to you at the church of rust.

But its a fun thing to do, and that's a good enough reason to do it. After all is that not exactly how Linux came into being anyway.

Re: Kerla: Monolithic kernel in Rust, aiming for Linux ABI compatibility

#13
post #10
post #4

A star has been born. A Linux alternative needs to be compatible with Linux binaries and also support modern architectures. If you want Linux to survive, it needs to be re-written from scratch, optimised in Rust and compatible with the existing Linux binaries or drivers. This project might have a chance. From: [0] > TL;DR: I'm writing a Linux clone in Rust just for fun. It does NOT aim to replace the Linux kernel. A…

Absolute codswallop. Linux will be here for many, many years to come yet.

Absolutely! But in Rust.

Why do you think the Linux developers are bolting on Rust in the Linux kernel themselves? [0]

It has already been admitted.

[0] https://lore.kernel.org/lkml/20210704202756.29107-1-ojeda@ke...

Re: Kerla: Monolithic kernel in Rust, aiming for Linux ABI compatibility

#14

A minimal interactive demo running busybox is here: ssh root@kerla-demo.seiya.me

is there not an opportunity to implement the posix filesystems interface on top of something other than a block device system. That would be fun.

Re: Kerla: Monolithic kernel in Rust, aiming for Linux ABI compatibility

#15
Very cool!

I think a killer feature would be to emulate the Linux kernel device driver model such that existing C driver modules could be used with Kerla. Further, borrow (no pun intended!) the Linux device driver Rust wrappers from the Rust for Linux kernel project to then enable writing Linux device drivers in Rust.

The question is whether emulating the Linux device driver model (by which I kind of mean mimicking the set of core kernel services needed to support drivers - kernel threads, sync primitives, allocators etc) ends up being a massive task akin to writing the core kernel itself.

I think there might be reasonable trade offs that make the problem more tractable.

Having the ability to have a significantly simpler kernel with Rust’s memory and thread safety guarantees plus the ability to use even a small set of Linux’s massive set of drivers would be very compelling.

Re: Kerla: Monolithic kernel in Rust, aiming for Linux ABI compatibility

#16
Post it when it's production ready.

A big problem in the Rust ecosystem is the lack of continued work and support on libraries (understandably, since many are new and aren't commercially supported).

For example, pyroute2 is still better for Linux admin that the equivalent Rust crates. Whilst the latter often fully support async, none of them cover all of the features of pyroute2 nor the easy-to-use API.

Hopefully things will improve over time, it's always a shame to see great projects be abandoned.

Re: Kerla: Monolithic kernel in Rust, aiming for Linux ABI compatibility

#17

For each piece of software, there just be a version in Rust, and that version must advertise it's rustiness

The type of software makes the difference - does it process untrusted input, maybe even over the network? This here is a kernel including a memory-safe TCP/IP stack ( https://github.com/smoltcp-rs/smoltcp/ ), and not having it crash or be full of security vulnerabilities due to preventable memory corruption is a quality beyond personal language preferences.

It is possible to overstate a valid case until it becomes meaningless... are modern OS IP stacks written in C really 'crash'ing or 'full of security vulnerabilities'? No.

Re: Kerla: Monolithic kernel in Rust, aiming for Linux ABI compatibility

#18

For each piece of software, there just be a version in Rust, and that version must advertise it's rustiness

Now ask yourself why.

Mozilla decided to create Rust after years of using C/C++. Why?

Because they spent a fortune fixing the same problems over and over again, and they realized that no matter how clever their developers were, those problems were always going to arise as long as they kept using C/C++.

Not because C/C++ is inherently bad, but because is more flexible than strictly needed in some ways.

Rust was designed to prevent many classes of problems.

Re: Kerla: Monolithic kernel in Rust, aiming for Linux ABI compatibility

#19

Earlier quoted context omitted.

sigh... Linux is going to survive. And no it does not need to be re-written from scratch in Rust. Someone lied to you at the church of rust.

But its a fun thing to do, and that's a good enough reason to do it. After all is that not exactly how Linux came into being anyway.

Maybe I will write a TODO app in Rust, should it be on top of HN because is some unoriginal,incomplete,bug filled,toy stuff just because the reason is written in Rust? 1

My assumption is that all titles with Rust get blind upvotes, sure a new kernel is cool but would be more cool if is more then someone toy project, this should probably be posted and upvoted in Rust forums so it gets support from the fans and hopefully the Rust guys will decide what kernel should they focus on and stop promoting every student weekend project here.

Re: Kerla: Monolithic kernel in Rust, aiming for Linux ABI compatibility

#20

Very cool! I think a killer feature would be to emulate the Linux kernel device driver model such that existing C driver modules could be used with Kerla. Further, borrow (no pun intended!) the Linux device driver Rust wrappers from the Rust for Linux kernel project to then enable writing Linux device drivers in Rust. The question is whether emulating the Linux device driver model (by which I kind of mean mimicking t…

Maybe starting with the rumpkernel interface is easier and one could already use some of the NetBSD drivers: https://en.wikipedia.org/wiki/Rump_kernel
Post reply on HN