Why is Linux called a monolithic kernel?

前端 未结 6 576
一整个雨季
一整个雨季 2020-12-04 04:22

I read that Linux is a monolithic kernel. Does monolithic kernel mean compiling and linking the complete kernel code into an executable?

If Linux is able to support

6条回答
  •  孤街浪徒
    2020-12-04 04:56

    ;tl-dr - No, Linux is always monolithic.

    Linux modules may mean modular in some sense. As others have noted monolithic is usually representing a microkernel versus monolithic kernel. A traditional microkernel only has these features,

    1. Scheduling
    2. Memory management
    3. Inter-process communications

    There are no hardware drivers, protocol stacks, filesystems, suspend/resume, clock management, etc in the main kernel. These things are identical to any user task (although they may have different privileges via the MMU/scheduler).


    Tanenbaum's predictions

    1. Microkernels are the future
    2. x86 will die out and RISC architectures will dominate the market
    3. (5 years from then) everyone will be running a free GNU OS

    PC and server programmers may laugh, but two and three are certainly true for the majority of cell phones in existence. Tanenbaum would be right on all accounts if BlackBerry QNX was a success.

    Also, many L1-hypervisors have a micro-kernel underneath. This is because a hyper-visor usually doesn't do much beside context switch.

    Apparently three predicts the success of Linux. ;-)


    An argument for microkernels is that all of the monolithic sub-systems need to synchronize multiple values at one time. In order to do this, they must use locks and will suffer from Amdahl's law when extended to parallel architectures. The counter is that microkernels result in lots of IPC messages.

    A major development is the use of lock-free programming to avoid contention in a monolithic kernel. This avoids the locking in a monolithic kernel while also reducing IPC overhead. Recently all CPUs have been extending their ISA to include better primitives for lock-free algorithms. So Linux will probably remain a monolithic kernel for some time.

提交回复
热议问题