The kernel consists of core and kernel modules
Core:/boot/vmlinuz-version
Kernel module (KO):/lib/modules/version/
View Kernel version
Uname-r
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/71/48/wKioL1XKvcHx0v5yAAAno3j4n-Q252.jpg "title=" uname " alt= "Wkiol1xkvchx0v5yaaano3j4n-q252.jpg"/>
The major version number. minor version number (even for stable version, odd for test version). Revision number (number of revisions)
User space access, monitoring the kernel is through access to modify the files in the/proc,/sys directory (that is, set the kernel parameter values) implemented
/proc/sys: Many of the files in this directory are readable and writable
/sys: Some files can be written
To set kernel parameter values:
1.echo VALUE >/proc/sys/file
echo 1 >/proc/sys/vm/drop_cache empty in-memory buffers and cached
2.sysctl-w kernel.hostname= "Chenqiyi"
Systcl-w vm.drop_cache=1
Sysctl-w net.ipv4.ip_forward=1 One host multi-NIC can be forwarded
The previous two methods can be effective immediately, but not permanently.
3. Modify/etc/sysctl.conf, modify and perform sysctl-p reread configuration file can take effect immediately, and permanently effective
SYSCTL-A: Show all kernel parameters and their values
Kernel Module Management:
Lsmod: Lists the kernel modules used in the current system
Modprobe mod_name: Loading module
Modprobe-r mod_name: Unload module
Modifo mod_name: View specific information about the module
Insmod/path/to/modile_file: Load Module
Rmmod mod_name: Unload module
Depmod/path/to/module_directory: Generating a dependency on a module
Features in the kernel, in addition to the core functions, at compile time, most of the functions have three choices
1. This feature is not available
2. Programming kernel module (requires loading module)
3. Compiling into the kernel
Compiling the kernel manually
1.yum Groupinstall "Development Tools" "Development Libraries"
2.tar XF kernel file. tar.gz-c/usr/src
3. Configure the kernel, the module is deleted, in the kernel directory
cp/boot/config-' uname-r '/usr/src/kernel directory/.config The original kernel configuration of the system CP has been modified in the past
①make gconfig:gnome desktop environment, need to install the Graphics Development Library Group: GNOME Software Development
②make KCONFIG:KDE desktop environment, need to install graphics development Library
③make Menuconfig
4. After the configuration is complete, execute the make command in the kernel directory to compile the kernel
5.make Modules_install Mounting Module
6.make Install kernel
Screen command:
Screen-ls: Displays the already established screen
Screen: Open a new display directly
CTRL + A release later press D: Remove screen
Screen-r ID: Restore a screen
Exit: Exit
Linux Learning Notes < 18 >--Kernel compilation