this post was submitted on 06 Jan 2024
735 points (98.9% liked)

Programmer Humor

19557 readers
519 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] HiddenLayer5@lemmy.ml 29 points 10 months ago* (last edited 10 months ago) (9 children)

For people who don't know, there is already a fully Rust OS: https://www.redox-os.org/

Microkernel too which is pretty cool.

[–] spez@sh.itjust.works 4 points 10 months ago (7 children)

I have heard about Redox. What's the difference between a microkernel and a kernel? Does redox use the linux kernel? Or has the guy written that in rust too?

[–] dukk@programming.dev 7 points 10 months ago* (last edited 10 months ago) (5 children)

Well, think microkernels as the bare minimum. They give you just enough to write your own OS on top of that: only the bare essentials run in kernel space, whilst everything else runs in user space and has to communicate with the kernel. Compare this to a monolithic kernel, like the Linux kernel: here, the whole operating system is run in kernel space, which means that data doesn’t need to be moved between user and kernel space: this makes the OS faster, but at the cost of modularity. Redox doesn’t use the Linux kernel, it uses its own microkernel written in Rust.

Edit: A good example would be driver. In a microkernel, these run separately from the kernel and interact with it when needed. In a monolithic kernel, these drivers would be included in the kernel itself. They both have their pros and cons: if you’re interested, feel free to look it up.

[–] jcg@halubilo.social 3 points 10 months ago (1 children)

Does that mean on a microkernel you'd essentially have double the amount of code execution for a driver (i.e. driver makes a call to the kernel, kernel verifies and then executes rather than the driver just executing the call) meaning double the latency? Seems like it would cause a lot of problems.

[–] aBundleOfFerrets@sh.itjust.works 3 points 10 months ago

Nowhere near double, the kernel can be extremely sparse on it’s side, but there is a small latency hit

load more comments (3 replies)
load more comments (4 replies)
load more comments (5 replies)