日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關(guān)咨詢(xún)
選擇下列產(chǎn)品馬上在線(xiàn)溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷(xiāo)解決方案
深入探索linux4內(nèi)核中的arch(linux4內(nèi)核中的arch)

Deep Dive into the Arch of Linux 4 Kernel

成都創(chuàng)新互聯(lián)公司于2013年開(kāi)始,先為武進(jìn)等服務(wù)建站,武進(jìn)等地企業(yè),進(jìn)行企業(yè)商務(wù)咨詢(xún)服務(wù)。為武進(jìn)企業(yè)網(wǎng)站制作PC+手機(jī)+微官網(wǎng)三網(wǎng)同步一站式服務(wù)解決您的所有建站問(wèn)題。

Linux, the open-source operating system, has been around for several decades and is constantly evolving. One of the key elements that make Linux such a flexible and versatile platform is its kernel. The Linux kernel is the central component responsible for managing system resources and providing access to hardware devices. In this article, we will take a deep dive into the architecture of the Linux 4 kernel and explore how it works.

Overview of Linux 4 Kernel Architecture

The Linux 4 kernel is divided into several layers, each with its own responsibilities. The lowest layer is the hardware layer, which interacts with the physical hardware components such as the CPU, memory, and I/O controllers. Above the hardware layer is the kernel space, which contns the core components of the kernel, such as the process scheduler, memory manager, and device driver interface. These components work together to manage system resources and provide access to hardware devices.

Beyond the kernel space is the user space, which contns all the applications and user-level processes running on the system. The kernel space and user space are separated by a system call interface, which allows user-level processes to interact with kernel-level services.

The architecture of the Linux 4 kernel is based on a modular design, with each component designed to function independently. This allows for easy customization and modification of the kernel to suit specific hardware platforms or user requirements.

Process Management

The Linux 4 kernel’s process management component is responsible for managing the execution of running processes on the system. This involves managing process states, allocating and managing resources such as CPU time and memory, and scheng processes for execution.

The process scheduler in the Linux 4 kernel uses a priority-based algorithm to determine which process is scheduled for execution next. This ensures that high-priority processes receive preferential treatment, and lower-priority processes are only executed when sufficient resources are avlable.

Memory Management

The memory management component in the Linux 4 kernel is responsible for managing system memory usage. This involves allocating and deallocating memory to running processes, managing memory usage at the system level, and providing virtual memory support.

The memory management component in Linux 4 provides support for dynamic memory allocation, which allows a process to request memory at run-time. This component also includes support for virtual memory, which allows the system to use disk space as additional memory when the physical memory is exhausted.

Device Management

Linux 4 kernel provides support for a wide range of hardware devices. The device management component in the kernel is responsible for interfacing with hardware devices and providing access to these devices for user-level processes.

The device management component in Linux 4 uses a modular approach, with device drivers designed to function as individual modules. This approach allows for easy customization of the kernel to include support for new or legacy hardware devices.

Networking

Networking support in the Linux 4 kernel includes support for standard networking protocols such as TCP/IP and UDP, as well as support for advanced networking protocols such as IPv6 and IPsec.

The networking component in Linux 4 is designed to provide high-speed data transfer between network devices. This component includes support for packet filtering and firewalling, which allows the system to restrict network traffic based on user-defined rules.

Conclusion

The Linux 4 kernel is a robust and flexible platform that provides support for a wide range of computing applications. Its modular architecture allows users to customize and modify the kernel to suit their specific hardware or application requirements.

The process management, memory management, device management, and networking components of the Linux 4 kernel work together to provide a powerful and scalable operating system platform. As Linux continues to evolve, the architecture of the kernel will continue to adapt to new hardware devices and user requirements, ensuring the platform remns flexible and versatile.

相關(guān)問(wèn)題拓展閱讀:

  • 如何給linux安裝新內(nèi)核?

如何給linux安裝新內(nèi)核?

一、獲取內(nèi)核源碼

二、解壓內(nèi)核源碼

首先以root帳號(hào)登錄,然后進(jìn)入/usr/src子目錄。如果用戶(hù)在安裝Linux時(shí),安裝了內(nèi)核的源代碼,則會(huì)發(fā)現(xiàn)一個(gè)linux-x.y.z的子目錄。該目錄下存放著內(nèi)核x.y.z的源代碼。此外,還會(huì)發(fā)現(xiàn)一個(gè)指向該目錄的鏈接linux。刪除該連接,然后將新內(nèi)核的源文件拷貝到/usr/src目錄中,并解壓:

#tarzxvfLinux-2.3.14.tar.gz

文件釋放成功后,在/usr/src目錄下會(huì)生成一個(gè)linux子目錄。其中包含了內(nèi)核2.3.14的全部源代碼。將/usr/include/a、/usr/inlude/linux、/usr/include/scsi鏈接到/usr/src/linux/include目錄下的對(duì)應(yīng)目錄中。

#cd/usr/include

#rm-Rfalinux

#ln-s/usr/src/linux/include/a-i386a

#ln-s/usr/src/linux/include/linuxlinux

#ln-s/usr/src/linux/include/scsiscsi

刪除源代碼目錄中殘留的.o文件和其它從屬文件。

#cd/usr/src/linux

#makemrproper

三.增量補(bǔ)丁

有時(shí)不需要完全重新安裝,只需打增量補(bǔ)丁,類(lèi)似升級(jí),在內(nèi)核源碼樹(shù)根目錄運(yùn)行:

patch-p1

四.內(nèi)核源碼樹(shù)目錄:

arch:包含和硬件體系結(jié)構(gòu)相關(guān)的代碼,每種平臺(tái)占一個(gè)相應(yīng)基啟的目錄。和32位PC相關(guān)的代碼存放在i386目錄下,其中比較重要的包括kernel(內(nèi)核核心部分)、mm(內(nèi)存管理)、math-emu(浮點(diǎn)單元仿真)、lib(硬件相關(guān)工具函數(shù))、boot(引導(dǎo)程序)、pci(PCI總線(xiàn))和power(CPU相關(guān)狀態(tài))。

block:部分塊設(shè)備驅(qū)動(dòng)程序。

crypto:常用加密和散列算法(如AES、SHA等),還有一些壓縮和CRC校驗(yàn)算法。

Documentation:關(guān)于內(nèi)核各部分的通用解釋和注釋。

drivers:設(shè)備驅(qū)動(dòng)程序,每個(gè)不同的驅(qū)動(dòng)占亂明用一個(gè)子目錄。

fs:各種支持的文件系統(tǒng),如ext、fat、ntfs等。

include:頭文件。其中,和系統(tǒng)相關(guān)的頭文件被放置在linux子目錄下。

init:內(nèi)核初始化代碼(注意不是系統(tǒng)引導(dǎo)代碼)。

ipc:進(jìn)程間通信的代碼。

kernel:內(nèi)核的最核心部分,包括進(jìn)程調(diào)度、定時(shí)器等,和平臺(tái)相關(guān)的一部分代碼放在arch/*/kernel目錄下。

lib:庫(kù)文件代碼。

mm:內(nèi)存管理代碼,和平臺(tái)相關(guān)的一部分代碼放在arch/*/mm目錄下。

net:網(wǎng)絡(luò)相關(guān)代碼,實(shí)現(xiàn)了各種常見(jiàn)的網(wǎng)絡(luò)協(xié)議。

scripts:用于配置內(nèi)核文件的腳本文件。

security:主要是一個(gè)SELinux的模塊。

sound:常用音頻設(shè)備的驅(qū)動(dòng)程序等。

usr:實(shí)現(xiàn)了一個(gè)cpio。

在i386體系下,系統(tǒng)引導(dǎo)將從arch/i386/kernel/head.s開(kāi)始執(zhí)行,并進(jìn)而轉(zhuǎn)移到init/main.c中的main()函數(shù)初始化內(nèi)核。

五.配置內(nèi)核

#cd/usr/src/linux

內(nèi)核配置方法有三種:

(1)命令行:makeconfig

(2)菜單模式的配置界面:makemenuconfig

(3)Xwindow:makexconfig

Linux的內(nèi)核配置程序提供了一系列配置選項(xiàng)。對(duì)于每一個(gè)配置選項(xiàng),用戶(hù)可以回答\”y\”、\”m\”或\”n\”。其中\(zhòng)”y\”表示將相應(yīng)特性的支持或設(shè)備驅(qū)動(dòng)程序編譯進(jìn)內(nèi)核;\”m\”表示將相應(yīng)特性的支持或設(shè)備驅(qū)動(dòng)程序編譯成可加載模塊,在需要時(shí),可由系統(tǒng)或用戶(hù)自行加入到內(nèi)核中去;\”n\”表示內(nèi)核不提供相應(yīng)特性或驅(qū)動(dòng)程序的支持。由于內(nèi)核的配置選項(xiàng)非常多,本文只介紹一些比較重要的選項(xiàng)。

1、Codematurityleveloptions(代碼成熟度選項(xiàng))

Promptfordevelopmentand/orincompletecode/drivers(CONFIG_EXPERIMENTAL)如果用戶(hù)想要使用還處于測(cè)試階段的代碼或驅(qū)搏陪如動(dòng),可以選擇“y”。如果想編譯出一個(gè)穩(wěn)定的內(nèi)核,則要選擇“n”。

2、Processortypeandfeatures(處理器類(lèi)型和特色)

(1)、Processorfamily(386,486/Cx486,586/K5/5×86/6×86,Pentium/K6/TSC,PPro/6x86MX)選擇處理器類(lèi)型,缺省為Ppro/6x86MX。

(2)、MaximumPhysicalMemory(1GB,2GB)內(nèi)核支持的更大內(nèi)存數(shù),缺省為1G。

(3)、Mathemulation(CONFIG_MATH_EMULATION)協(xié)處理器仿真,缺省為不仿真。

(4)、MTRR(MemoryTypeRangeRegister)support(CONFIG_MTRR)

選擇該選項(xiàng),系統(tǒng)將生成/proc/mtrr文件對(duì)MTRR進(jìn)行管理,供Xserver使用。

(5)、Symmetricmulti-processingsupport(CONFIG_P)選擇“y”,內(nèi)核將支持對(duì)稱(chēng)多處理器。

3、Loadablemodulesupport(可加載模塊支持)

(1)、Enableloadablemodulesupport(CONFIG_MODULES)選擇“y”,內(nèi)核將支持加載模塊。

(2)、Kernelmoduleloader(CONFIG_KMOD)選擇“y”,內(nèi)核將自動(dòng)加載那些可加載模塊,否則需要用戶(hù)手工加載。

4、Generalsetup(一般設(shè)置)

(1)、Networkingsupport(CONFIG_NET)該選項(xiàng)設(shè)置是否在內(nèi)核中提供網(wǎng)絡(luò)支持。

(2)、PCIsupport(CONFIG_PCI)該選項(xiàng)設(shè)置是否在內(nèi)核中提供PCI支持。

(3)、PCIaccesode(BIOS,Direct,Any)該選項(xiàng)設(shè)置Linux探測(cè)PCI設(shè)備的方式。選擇“BIOS”,Linux將使用BIOS;選擇“Direct”,Linux將不通過(guò)BIOS;選擇“Any”,Linux將直接探測(cè)PCI設(shè)備,如果失敗,再使用BIOS。

(4)Parallelportsupport(CONFIG_PARPORT)選擇“y”,內(nèi)核將支持平行口。

5、PlugandPlayconfiguration(即插即用設(shè)備支持)

(1)、PlugandPlaysupport(CONFIG_PNP)選擇“y”,內(nèi)核將自動(dòng)配置即插即用設(shè)備。

(2)、ISAPlugandPlaysupport(CONFIG_ISAPNP)選擇“y”,內(nèi)核將自動(dòng)配置基于ISA總線(xiàn)的即插即用設(shè)備。

6、Blockdevices(塊設(shè)備)

(1)、NormalPCfloppydisksupport(CONFIG_BLK_DEV_FD)選擇“y”,內(nèi)核將提供對(duì)軟盤(pán)的支持。

(2)、EnhancedIDE/MFM/RLLdisk/cdrom/tape/floppysupport(CONFIG_BLK_DEV_IDE)選擇“y”,內(nèi)核將提供對(duì)增強(qiáng)IDE硬盤(pán)、CDROM和磁帶機(jī)的支持。

7、Networkingoptions(網(wǎng)絡(luò)選項(xiàng))

(1)、Packetsocket(CONFIG_PACKET)選擇“y”,一些應(yīng)用程序?qū)⑹褂肞acket協(xié)議直接同網(wǎng)絡(luò)設(shè)備通訊,而不通過(guò)內(nèi)核中的其它中介協(xié)議。

(2)、Networkfirewalls(CONFIG_FIREWALL)選擇“y”,內(nèi)核將支持防火墻。

(3)、TCP/IPnetworking(CONFIG_INET)選擇“y”,內(nèi)核將支持TCP/IP協(xié)議。

(4)TheIPXprotocol(CONFIG_IPX)選擇“y”,內(nèi)核將支持IPX協(xié)議。

(5)、AppletalkDDP(CONFIG_ATALK)選擇“y”,內(nèi)核將支持AppletalkDDP協(xié)議。

8、SCSIsupport(SCSI支持)

如果用戶(hù)要使用SCSI設(shè)備,可配置相應(yīng)選項(xiàng)。

9、Networkdevicesupport(網(wǎng)絡(luò)設(shè)備支持)

Networkdevicesupport(CONFIG_NETDEVICES)選擇“y”,內(nèi)核將提供對(duì)網(wǎng)絡(luò)驅(qū)動(dòng)程序的支持。

10、Ethernet(10or100Mbit)(10M或100M以太網(wǎng))

在該項(xiàng)設(shè)置中,系統(tǒng)提供了許多網(wǎng)卡驅(qū)動(dòng)程序,用戶(hù)只要選擇自己的網(wǎng)卡驅(qū)動(dòng)就可以了。此外,用戶(hù)還可以根據(jù)需要,在內(nèi)核中加入對(duì)FDDI、PPP、SLIP和無(wú)線(xiàn)LAN(WirelessLAN)的支持。

11、Characterdevices(字符設(shè)備)

(1)、Virtualterminal(CONFIG_VT)選擇“y”,內(nèi)核將支持虛擬終端。

(2)、Supportforconsoleonvirtualterminal(CONFIG_VT_CONSOLE)

選擇“y”,內(nèi)核可將一個(gè)虛擬終端用作系統(tǒng)控制臺(tái)。

(3)、Standard/generic(dumb)serialsupport(CONFIG_SERIAL)

選擇“y”,內(nèi)核將支持串行口。

(4)、Supportforconsoleonserialport(CONFIG_SERIAL_CONSOLE)

選擇“y”,內(nèi)核可將一個(gè)串行口用作系統(tǒng)控制臺(tái)。

12、Mice(鼠標(biāo))

PS/2mouse(aka\”auxiliarydevice\”)support(CONFIG_POUSE)如果用戶(hù)使用的是PS/2鼠標(biāo),則該選項(xiàng)應(yīng)該選擇“y”。

13、Filesystems(文件系統(tǒng))

(1)、Quotasupport(CONFIG_QUOTA)選擇“y”,內(nèi)核將支持磁盤(pán)限額。

(2)、Kernelautomountersupport(CONFIG_AUTOFS_FS)選擇“y”,內(nèi)核將提供對(duì)automounter的支持,使系統(tǒng)在啟動(dòng)時(shí)自動(dòng)mount遠(yuǎn)程文件系統(tǒng)。

(3)、DOSFATfssupport(CONFIG_FAT_FS)選擇“y”,內(nèi)核將支持DOSFAT文件系統(tǒng)。

(4)、ISO9660CDROMfilesystemsupport(CONFIG_ISO9660_FS)

選擇“y”,內(nèi)核將支持ISO9660CDROM文件系統(tǒng)。

(5)、NTFSfilesystemsupport(readonly)(CONFIG_NTFS_FS)

選擇“y”,用戶(hù)就可以以只讀方式訪問(wèn)NTFS文件系統(tǒng)。

(6)、/procfilesystemsupport(CONFIG_PROC_FS)/proc是存放Linux系統(tǒng)運(yùn)行狀態(tài)的虛擬文件系統(tǒng),該項(xiàng)必須選擇“y”。

(7)、Secondextendedfssupport(CONFIG_EXT2_FS)EXT2是Linux的標(biāo)準(zhǔn)文件系統(tǒng),該項(xiàng)也必須選擇“y”。

14、NetworkFileSystems(網(wǎng)絡(luò)文件系統(tǒng))

(1)、NFSfilesystemsupport(CONFIG_NFS_FS)選擇“y”,內(nèi)核將支持NFS文件系統(tǒng)。

(2)、Bfilesystemsupport(tomountWfWsharesetc.)(CONFIG_B_FS)

選擇“y”,內(nèi)核將支持B文件系統(tǒng)。

(3)、NCPfilesystemsupport(tomountNetWarevolumes)(CONFIG_NCP_FS)

選擇“y”,內(nèi)核將支持NCP文件系統(tǒng)。

15、PartitionTypes(分區(qū)類(lèi)型)

該選項(xiàng)支持一些不太常用的分區(qū)類(lèi)型,用戶(hù)如果需要,在相應(yīng)的選項(xiàng)上選擇“y”即可。

16、Consoledrivers(控制臺(tái)驅(qū)動(dòng))

VGAtextconsole(CONFIG_VGA_CONSOLE)選擇“y”,用戶(hù)就可以在標(biāo)準(zhǔn)的VGA顯示方式下使用Linux了。

17、Sound(聲音)

Soundcardsupport(CONFIG_SOUND)選擇“y”,內(nèi)核就可提供對(duì)聲卡的支持。

18、Kernelhacking(內(nèi)核監(jiān)視)

MagicSysRqkey(CONFIG_MAGIC_SYSRQ)選擇“y”,用戶(hù)就可以對(duì)系統(tǒng)進(jìn)行部分控制。一般情況下選擇“n”。

六、編譯內(nèi)核

(一)、建立編譯時(shí)所需的從屬文件

#cd/usr/src/linux

#makedep

(二)、清除內(nèi)核編譯的目標(biāo)文件

#makeclean

(三)、編譯內(nèi)核

#makezImage

內(nèi)核編譯成功后,會(huì)在/usr/src/linux/arch/i386/boot目錄中生成一個(gè)新內(nèi)核的映像文件zImage。如果編譯的內(nèi)核很大的話(huà),系統(tǒng)會(huì)提示你使用makebzImage命令來(lái)編譯。這時(shí),編譯程序就會(huì)生成一個(gè)名叫bzImage的內(nèi)核映像文件。

(四)、編譯可加載模塊

如果用戶(hù)在配置內(nèi)核時(shí)設(shè)置了可加載模塊,則需要對(duì)這些模塊進(jìn)行編譯,以便將來(lái)使用inod命令進(jìn)行加載。

#makemodules

#makemodelus_install

編譯成功后,系統(tǒng)會(huì)在/lib/modules目錄下生成一個(gè)2.3.14子目錄,里面存放著新內(nèi)核的所有可加載模塊。

七、啟動(dòng)新內(nèi)核

(一)、將新內(nèi)核和System.map文件拷貝到/boot目錄下

#cp/usr/src/linux/arch/i386/boot/bzImage/boot/vmlinuz-2.3.14

#cp/usr/src/linux/System.map/boot/System.map-2.3.14

#cd/boot

#rm-fSystem.map

#ln-sSystem.map-2.3.14System.map

(二)、配置/etc/lilo.conf文件。在該文件中加入下面幾行:

default=linux-2.3.14

image=/boot/vmlinuz-2.3.14

label=linux-2.3.14

root=/dev/hda1

read-only

(三)、使新配置生效

#/in/lilo

(四)、重新啟動(dòng)系統(tǒng)

#/in/reboot

關(guān)于linux4 內(nèi)核 中的arch的介紹到此就結(jié)束了,不知道你從中找到你需要的信息了嗎 ?如果你還想了解更多這方面的信息,記得收藏關(guān)注本站。

香港服務(wù)器選創(chuàng)新互聯(lián),2H2G首月10元開(kāi)通。
創(chuàng)新互聯(lián)(www.cdcxhl.com)互聯(lián)網(wǎng)服務(wù)提供商,擁有超過(guò)10年的服務(wù)器租用、服務(wù)器托管、云服務(wù)器、虛擬主機(jī)、網(wǎng)站系統(tǒng)開(kāi)發(fā)經(jīng)驗(yàn)。專(zhuān)業(yè)提供云主機(jī)、虛擬主機(jī)、域名注冊(cè)、VPS主機(jī)、云服務(wù)器、香港云服務(wù)器、免備案服務(wù)器等。


本文題目:深入探索linux4內(nèi)核中的arch(linux4內(nèi)核中的arch)
轉(zhuǎn)載源于:http://www.dlmjj.cn/article/coodepi.html