读书笔记 - Linux Kernel Development

本文探讨了宏内核与微内核的设计理念及其优缺点。宏内核将所有核心功能集成到单一进程中,而微内核则将这些功能拆分为独立的服务进程。文章详细介绍了两种内核类型的工作原理,并通过实例比较了它们在性能和稳定性方面的差异。

Deadline: 2013.09.30

Chapter One: Introduction to Linux Kernel

Monolithic Kernel vs. Microkernel

Monolithic Kernels: implemented entirely as a signle process running in a single address space. The kernel can invoke functions directly, as a user-space application. Most Unix systems are monolithic in design.

Microkernel: functionality of the kernel is broken down into separate processes, usually called servers. Ideally, only servers requring such capability run in privileged execution mode. The rest of servers run in user-space. Direct function invocation is not possible. Instead, microkernels communicate with messages passing. Various servers communicate with and invoke "services" from each other by sending messages over IPC (Inter-Process Communication) mechanism. The separation prevents a failure in one server from bringing down another.

IPC involves a quite a bit more overhead than a trivial function call, however, and because a context switch from kernel-space to user-space or vice versa is often involved, message passing includes a latency and throughput hit not seen on monolithic kernels with simple function invocation. Consequently, most of microkernel based systems now place most or all the servers in kernel space, to remove the overhead of context switch. Windows/Mac are microkernel examples.

Linux is a monolithic kernel system. Linux boasts a modular design, the capability to preempt itself (Kernel Preemption), support for kernel threads, and capatility to dynamically load separate binaries (Kernel Modules) into kernel image. Linux has none of the performance sapping features that curse microkernel design: everything runs in kernel mode, with direct function invocation - not message passing. Linux is modular, threaded, and the kernel itself is schedulable.

 2013.09.04

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值