Linux system startup process and kernel compilation (2)
1. Kernel design: A single core and micro-core points
Linux is a single core modular design
System Kernel Core path:/boot/vmlinuz-version number
Kernel module Path:/lib/modules/version number/
Linux is divided into kernel space and user space
While user space accesses and monitors the kernel: paths in/proc/and/sys/two pseudo-file systems
2. pseudo file system/proc/sys and/sys/files in some directories are readable or writable
To set kernel parameter values:
2.1. Can take effect immediately, but reboot system setting is invalid
2.1.1.echo Values >/proc/sys/to/somefile
2.1.2.sysctl-w kernel.hostname=willow.com.tw
3. Can be permanently active by modifying the/etc/sysctl.conf configuration file
However, the following command will take effect immediately:
Sysctl-p let the kernel reload the/etc/sysctl.conf configuration file
SYSCTL-A: Show all kernel parameters and their values
4. Kernel Module Management:
Lsmod: View
Modprobe Module Name: Loading a module
MODPROBE-R Module Name: Uninstalling a module
Modinfo Module Name: View specific information about the module
Insmod module path name. KO: Loading module
RMMOD Module Name: Uninstalling a module
DEPMOD Module Catalog: Analyzing the dependencies of loading modules
5. Manually compile the kernel:
Install "Development Tools" and "Development Libraries" and "Server Platform development" in advance
5.1: Select or cancel the specified module
Make Gconfig:gnome desktop environment, need to install the Graphics Development Library Group: GNOME Software Development
Main package Confirm Installation: GTK + gtk-devel Libglade2-devel
Make KCONFIG:KDE desktop environment, need to install the Graphics Development Library Group; KDE Software Development
Make Xconfig:gnome Desktop environment use
Main package Confirm installation: QT Qt-devel
Make Menuconfig: Use in a text environment
Main package Confirm installation: Ncusres Ncurse-devel
5.2: Compiling
Make
make modules (optional)
5.3: Copy the compiled module to the specified directory and file or modify the file
Make Modules_install copy module to/lib/modules/directory
Make install copy boot system kernel and image files, etc. (including edit grub.conf file)
5.4. If the compilation error or want to compile two times
To clean up but before cleaning, back up the configuration file if necessary. config:
Make clean deletes most compiled files, but does not delete the. config file
Make mrproper Delete all compiled files, including the. config file
5.5: Make initrd-xxx-xxx.img system image file
MKINITRD initrd file path kernel version number
mkinitrd/boot/initrd-' uname-r '. img ' uname-r '
dracut/boot/initrd-' uname-r '. img ' uname-r ' (redhat6 new tool)
6.screen command:
Screen: Open a new display directly
CTRL + A, D: removing the screen
Screen-ls: Displays the established screen and ID number
Screen-r ID Number: Restores the specified screen
Exit: Exit
This article is from the "Xavier Willow" blog, please be sure to keep this source http://willow.blog.51cto.com/6574604/1768872
Linux system startup process and kernel compilation (2)