Recommended connection:
- Linux "No.7": System startup process
Essential Knowledge points
Components of the Linux system
Dynamic View: Kernel + root file system functional Structure view: hardware, kernel (Manage entire hardware function), library (library call: Libcall), Program (Special Interface Program Shell) Kernel: process management, memory management, network protocol stack, file system, driver, security function Ipc:inter Process Communication processes communication
The system environment in operation can be divided into two tiers
- User space: Application (process or thread)
- Kernel Space: Kernel code (System call)
Kernel design Genre
- Single Core design: Integrate all functions into the same program; Linux
- Microkernel Design: Each function is implemented using a separate subsystem; Windows,solaris
Linux kernel Features
- Support modularity: Kernel files:. KO (Kernel object)
- Supports dynamic loading or unloading of modules during runtime;
stand in a compiled perspective, its components: core files:/boot/vmlinuz-version-release module files:/lib/modules/vsersion- Release If there are multiple versions of the kernel, there are multiple directories under it
RAMDisk
Memory-based disk device RAMDisk to implement system initialization
RAMDisk: Memory-based disk device used to implement system initialization RAMDisk Why: When the operating system starts, it needs to load the RAMDisk into memory, and then uses it as a disk to identify the root filesystem, its Lib/ Modules directory has the current real root device driver, with the help of RAMDisk so that the real root mount, mounted on the RAMDisk to give all the right to the real root; 5 :/boot/initrd-version-6,7 :/boot/initramfs-version-release.img # RAM-based file system memory data should be in memory, the device on disk, although there is buffer and cache, but too slow, so the disk to temporarily load a lot of data into memory for access , but the original memory-based disk device RAMDisk is memory, There is no need to cache again, in order to avoid double-buffered double-buffer: so that it reaches the purpose of speed-up;
RAMDisk
Demo: [[email protected]~]#uname-R3.10.0-229. el7.x86_64 [[email protected]~]#ls/boot/#内核文件config-3.10.0-229. El7.x86_64grubgrub2initramfs-0-rescue-0e6e23af771842c8bf3aeb3ae70b2a33.imginitramfs-3.10.0-229. el7.x86_64.img #ramdisk临时根initramfs-3.10.0-229. EL7.X86_64KDUMP.IMGINITRD-plymouth.imgsymvers-3.10.0-229. El7.x86_64.gzSystem.map-3.10.0-229. El7.x86_64vmlinuz-0-rescue-0e6e23af771842c8bf3aeb3ae70b2a33vmlinuz-3.10.0-229. el7.x86_64 #核心文件 [[email protected]~]#ls/lib/modules #模块文件在/lib/modules under3.10.0-229. El7.x86_64[[email protected]~]#ls/lib/modules/3.10.0-229. el7.x86_64/kernel/Arch Crypto Drivers fs kernel lib mm net Soundarch platform-specific code crypto cryptographic decryption Component drivers drive FS file System kernel kernel tracking component LIBMM memory management function NET network function sound and audio-related drivers, decoders, etc. [[email protected]~]#ls/lib/modules/3.10.0-229. el7.x86_64/kernel/kernel/Kernel trace Components trace[[email protected]~]#ls/lib/modules/3.10.0-229. el7.x86_64/kernel/fs/file system Binfmt_misc.ko ceph DLM fat gfs2 lockd nfs_common overlayfs udfbtrfs cifs exof s Fscache isofs Mbcache.ko nfsd pstore xfscachefiles cramfs ext4 Fuse jbd2 NFS NLS SQUASHFS
Demo: Kernel files, module files
System startup process
First:
The following is only suitable for PC MBR architecture design
(1), post (Power on Self Test) power-on auto -Test
After power on, automatically check that the hardware device is not
Implement the post code on the motherboard rom; if there is no external auxiliary means framed, the code on the ROM can not be modified;
Rom:cmos
Bios:basic input and output system basic input and output systems in CMOS
Can be loaded by the CPU: Rom+ram
(2), boot Sequence: Boot process
Reprint Please specify source: http://www.cnblogs.com/jasperhsu/p/5095141.html
Linux "No.7": System startup process