I recently found out that Android’s kernel is VERY different from any Apple implementation. Never really crossed my mind that there are different types of kernels.

This made me wonder - if the microkernel is so much better, at the cost of being complicated to develop an OS for, would Android be better on microkernel?

Please enlighten me. I’m only trying to learn more.

Also, do interact, Lemmy needs good conversation.

  • Ramenator@lemmy.world
    link
    fedilink
    English
    arrow-up
    16
    ·
    10 months ago

    Microkernels aren’t better per se than monolithic kernels. Their main advantage is increased security. Only a small portion of the Kernel actually runs in Ring 0, the most privileged level where the code has full access to the computer. Drivers and the like then technically run as separate, less privileged programs that interact with the kernels via messages. This greatly reduces the attack surface on the kernel and prevents crashes or memory access from a faulty driver.
    This comes at a cost though. While microkernels are generally more secure, they are also less performant. Each message means overhead and a context switch you don’t have in a monolithic kernel.
    The discussion between the two kernel types has been going on for the last thirty years and was famously the source for a long argument between Linus Torvalds, founder of the Linux Kernel and Andrew S Tannenbaum, creator of the Minix kernel.
    In the end the XNU kernel isn’t even a full microkernel, but a hybrid kernel, trying to take the best of both world by originally taking the Mach microkernel and then implementing the 4.3BSD monolithic kernel on top of it. There are even project to do the same with Linux, like L4Linux

    Overall the choice of kernel doesn’t hold Android back in comparison, Linux is an extremely capable piece of software that runs on anything from small microcontrollers to all of the world’s largest supercomputers. Though Google’s newest OS project, Fuchsia, actually uses a microkernel for increased security. And it doesn’t use Linux because of licensing, but that’s a whole other can of worms