Live data from Hacker News

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

github.com

141–150 of 196 posts

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

#141

Earlier quoted context omitted.

> BeOS wasn't half bad. The failure was probably mostly commercial. Fair point. You could probably say this of other attempted microkernels too, to be even fairer. But that doesn't really change the fundamental point that just cooking up "a better OS design" doesn't lead to it being successful. There's a lot more in play that "mere quality".

well if that sort of "successful" is your key metric, this is true for a lot of things and has been known since biblical times: "a person may labor with wisdom, knowledge and skill, and then they must leave all they own to another who has not toiled for it" you did say "by almost any metric".

the metric i was mostly thinking was inspired by the parent to my post, which seemed to me to imagine that Rust+microkernel => widescale deployment.

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

#142

Earlier quoted context omitted.

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.

Linux came into being as a fun hobby project. It was successful because it gained traction with the wider community and got huge commercial backing because it was vastly superior to most of the alternatives from a user perspective ("oh hey, I can run my web servers on this 100% free kernel plus the GNU userland and have a mostly good server for zero software cost on commodity hardware"). But today, Linux itself exist…

It gained commercial tracking because it represented a way for IBM, Oracle and Compaq to reduce development costs on their own systems, and thus started sponsoring Linux development efforts around 2000.

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

#143
What are some ways I can increase my knowledge in this domain that the OP is very skilled at, meaning low level OS development?

I've taken an intro to OS class and am currently going through Linux From Scratch [1], which is interesting and is teaching me a lot, but it's more about how to setup a Linux distro using existing packages and not really about reading/writing the code involved.

Any recommendations?

[1] https://www.linuxfromscratch.org/

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

#144
post #41

Author here. I'm surprised to see my hobby project on Hacker News. I know this kind of stuff spark the ``it's meaningless to rewrite everything (especially Linux) in Rust'' debate. I agree 100% that rewriting Linux in Rust (or your favorite language) is just a waste of time and such a project won't live long. That said, what I'd say here is that it's fun. Really fun. Implementing ABI compatibility requires you to und…

This is really cool. Ignore the haters: * Some people bake bread even though there's a good bakery nearby. * Some people grow gardens even though there's a farmers' market down the street. * Some people restore old cars even though there's a good restoration professional in town. * Some people make k8s clusters on rpi even though they could rent that for cheap. You're making an OS that's linux compatible even though…

Yes, and some people write an OS that is similar to Minix and won't ever be ported to anything beyond 386 and AT harddisks ;)

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

#145
post #47
post #21

This may be a naive question, but I cannot help but wonder: As C and Rust aim to be link-compatible, wouldn't it be easier to gradually replace parts of the Linux kernel with Rust code? The only technical problem I can think of is that Rust may not be available for all CPU architectures Linux supports, but this is just speculation on my part having done no research on the matter.

A practical problem is that in order to gain the benefit of linking Rust and C code, one has to give up Rust's wonderful guarantees at the interface. So until islands of Rust meet up, these interact through a C ABI, and have to expose C-like behavior.

The world really needs _two_ projects, a practical one that is interoperable with the here and now, to get incremental improvements in security from bits reimplemented in Rust.

And then, in the longer term, someone ought to write a book about operating system implementation in Rust that ignores Linux interoperability and focuses on readability, maintainability by showing use of Rust's idiomatic style.

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

#147

What are some ways I can increase my knowledge in this domain that the OP is very skilled at, meaning low level OS development? I've taken an intro to OS class and am currently going through Linux From Scratch [1], which is interesting and is teaching me a lot, but it's more about how to setup a Linux distro using existing packages and not really about reading/writing the code involved. Any recommendations? [1] https…

One of the easiest ways to get into writing your own kernel is to start with the OS Dev wiki [0]. Both the wiki and their forums are a great place for getting your feet wet.

For more general information, there are also a handful of articles and/or blog posts that I've come across when I was getting started that gave a very good introduction to many of the low-level components of how computers work and what the OS needs to do to run them. One of my favorites was Many But Finite [1]. Check out a bunch of his posts about the memory map, the computer boot process [2], cpu rings, etc... Not exhaustive by any means, but good, well-presented info. Many other such sources exist; maybe others will share their favorites.

And if you'd just like to get a more gentle introduction into actual OS code than the monster that is Linux, maybe try looking at some of the BSD's. NetBSD [3] and OpenBSD [4] are remarkably easy to navigate and follow from a code flow perspective, and if you just want to see how things work in a real OS, it's both a good reference and a good place to start.

[0] https://wiki.osdev.org/Main_Page

[1] https://manybutfinite.com/archives

[2] https://manybutfinite.com/post/how-computers-boot-up

[3] http://netbsd.org/

[4] https://www.openbsd.org/

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

#148

This is awesome. Imagine the potential if it was just complete enough to run Kubernetes’ kubelet on a cloud instance. Lots of security minded folks would love it.

I wonder, if you run every container in it's own MicroVM a-la Firecracker like Fargate does (or Kerla's demo host), does the security of the kernel still matter as much?

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

#149
post #147

What are some ways I can increase my knowledge in this domain that the OP is very skilled at, meaning low level OS development? I've taken an intro to OS class and am currently going through Linux From Scratch [1], which is interesting and is teaching me a lot, but it's more about how to setup a Linux distro using existing packages and not really about reading/writing the code involved. Any recommendations? [1] https…

One of the easiest ways to get into writing your own kernel is to start with the OS Dev wiki [0]. Both the wiki and their forums are a great place for getting your feet wet. For more general information, there are also a handful of articles and/or blog posts that I've come across when I was getting started that gave a very good introduction to many of the low-level components of how computers work and what the OS nee…

Thank you!

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

#150
post #113

Earlier quoted context omitted.

I have a A* search algorithm and a toy compiler that I use exactly for the same purpose. I just rewrite them all the time as means to get a feeling about programming languages. I dumped a couple of other stuff on GitHub so that HR people are happy to get a link that they never read anyway. Then I get back to Java and .NET at the office. :)

I've actually been considering adding a toy compiler to my collection of getting-up-to-speed projects, do you mind sharing what you think are good features?

Not OP, but there's also "crafting interpreters". In the second half of the book you emit bytecode for whatever language you designed in the first half, and also implement a VM for said bytecode.
Post reply on HN