加入收藏 | 设为首页 | 会员中心 | 我要投稿 海南站长网 (https://www.0898zz.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

Anatomy of the Linux kernel--转

发布时间:2021-01-25 11:52:02 所属栏目:Linux 来源:网络整理
导读:副标题#e# ref:http://www.ibm.com/developerworks/linux/library/l-linux-kernel/?S_TACT=105AGX52S_CMP=cn-a-l Given that the goal of this article is to introduce you to the Linux kernel and explore its architecture and major components,let's

Supporting multiple users of memory,there are times when the available memory can be exhausted. For this reason,pages can be moved out of memory and onto the disk. This process is called?swapping?because the pages are swapped from memory onto the hard disk. You can find the memory management sources in ./linux/mm.

The virtual file system (VFS) is an interesting aspect of the Linux kernel because it provides a common interface abstraction for file systems. The VFS provides a switching layer between the SCI and the file systems supported by the kernel (see Figure 4).

The VFS provides a switching fabric between users and file systems

At the top of the VFS is a common API abstraction of functions such as open,close,read,and write. At the bottom of the VFS are the file system abstractions that define how the upper-layer functions are implemented. These are plug-ins for the given file system (of which over 50 exist). You can find the file system sources in ./linux/fs.

Below the file system layer is the buffer cache,which provides a common set of functions to the file system layer (independent of any particular file system). This caching layer optimizes access to the physical devices by keeping data around for a short time (or speculatively read ahead so that the data is available when needed). Below the buffer cache are the device drivers,which implement the interface for the particular physical device.

The network stack,by design,follows a layered architecture modeled after the protocols themselves. Recall that the Internet Protocol (IP) is the core network layer protocol that sits below the transport protocol (most commonly the Transmission Control Protocol,or TCP). Above TCP is the sockets layer,which is invoked through the SCI.

The sockets layer is the standard API to the networking subsystem and provides a user interface to a variety of networking protocols. From raw frame access to IP protocol data units (PDUs) and up to TCP and the User Datagram Protocol (UDP),the sockets layer provides a standardized way to manage connections and move data between endpoints. You can find the networking sources in the kernel at ./linux/net.

The vast majority of the source code in the Linux kernel exists in device drivers that make a particular hardware device usable. The Linux source tree provides a drivers subdirectory that is further divided by the various devices that are supported,such as Bluetooth,I2C,serial,and so on. You can find the device driver sources in ./linux/drivers.

While much of Linux is independent of the architecture on which it runs,there are elements that must consider the architecture for normal operation and for efficiency. The ./linux/arch subdirectory defines the architecture-dependent portion of the kernel source contained in a number of subdirectories that are specific to the architecture (collectively forming the BSP). For a typical desktop,the i386 directory is used. Each architecture subdirectory contains a number of other subdirectories that focus on a particular aspect of the kernel,such as boot,kernel,memory management,and others. You can find the architecture-dependent code in ./linux/arch.

If the portability and efficiency of the Linux kernel weren't enough,it provides some other features that could not be classified in the previous decomposition.

Linux,being a production operating system and open source,is a great test bed for new protocols and advancements of those protocols. Linux supports a large number of networking protocols,including the typical TCP/IP,and also extension for high-speed networking (greater than 1 Gigabit Ethernet [GbE] and 10 GbE). Linux also supports protocols such as the Stream Control Transmission Protocol (SCTP),which provides many advanced features above TCP (as a replacement transport level protocol).

Linux is also a dynamic kernel,supporting the addition and removal of software components on the fly. These are called dynamically loadable kernel modules,and they can be inserted at boot when they're needed (when a particular device is found requiring the module) or at any time by the user.

(编辑:海南站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读