this post was submitted on 07 Jul 2024
837 points (92.9% liked)
linuxmemes
20464 readers
290 users here now
I use Arch btw
Sister communities:
- LemmyMemes: Memes
- LemmyShitpost: Anything and everything goes.
- RISA: Star Trek memes and shitposts
Community rules
- Follow the site-wide rules and code of conduct
- Be civil
- Post Linux-related content
- No recent reposts
Please report posts and comments that break these rules!
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Quite opposite. Most firmware microcontrollers run is giant kernel. Some microcontrollers don't even have context switching at all. And I'm not even starting to talk about MMU.
I was not meaning to say that all microcontrollers (or microcontroller firmwares) run a microkernel but, rather, that microcontrollers are an environment where they can work well because the limited scope of what the device is expected to do and its necessarily supported peripherals can be much smaller, making the potential impact of context changes smaller.
For some good examples of microkernels for such purposes, take a look at FreeRTOS, ChibiOS, or Zephyr pre-1.6 (at which point architecture changed to a monolith because it is creeping towards general computing functionality).
As long as there's some processing RAM and sufficient ROM, I'm sure that it can be crammed in there via firmware (in a sub-optimal way that makes people who have to maintain the code, including your future self, hate you and wish a more appropriate part were used).
Some madlads forked Linux to get it to work without an MMU, even getting it merged into the mainline kernel: https://en.m.wikipedia.org/wiki/%CE%9CClinux
So, doable. Adviseable? Probably not in most cases but that's subjective.
AFAIK FreeRTOS always ran drivers in kernel.
You can't even emulate MPU without MPU. The only way is running bytecode, which is still not context switching.
You are correct here. Should have said MPU instead.
At least in the docs, I see it described as a microkernel but, with a kernel that small, the differences are probably academic (and I'll leave that to people with more formal background in CS than myself).
Oh yes! That makes a lot more sense. I've been on-and-off looking at implementing multithreading and multiprocessing in CircuitPython. Memory protection is a big problem with making it work reliably.