Linux kernel configuration and compilation introduction

zhaozj2021-02-08  204

1. Why do you want to compile Linux kernels, Linux is an open source operating system. Open source software brings us the biggest benefit of this computer level relatively backward population, that is, you can quickly learn world high-level procedures (architecture and programming methods, etc. Wait, so that it quickly improves its own level. However, this itself, also makes most open source software in coding ease of use, targeted products that are less than Microsoft and other professional software companies. Using open source software, there are few less uncomfortable feelings. This point is that you will have to have the same feelings with your earlier versions of Linux. Sometimes it is not only uncomfortable. Due to software developers or versions, we cannot guarantee that all software can be simply transplanted with different machines, especially for certain large software (such as: Oracle 8.0.5). In many cases, the system status, especially the kernel state, has a vital impact and restrictive role of the installation and performance of the program. From another perspective, we can also do the kernels for their own computer, so there will be no big trash bods like Windows 98. 2. Understand Linux to compile Linux kernels, first have a probably impression on it. Linux is a UNIX imitation product that supports multitasking, virtual memory, multi-terminal, virtual file systems. It can run on a 386/486 personal computer, other architectures, such as: Sun SPARC, M68000, DEC Alpha, PowerPC, also have an applicable Linux. 3. Preparation of compiled kernel 1) Understand the version number of the existing kernel. This is mainly to determine the basic information of some machines, not necessarily. You can use the following command line: $ uname -alinux lark 2.2.15 # 2 Tue Dec 26 10:55:20 CST 2000 i6862) Download the latest version of the Linux kernel. Currently, the content of the FTP site of domestic education network (including compression The kernel, patch, compiler, etc.) are relatively abundant, and the update is also fast, such as: http://ftp.xjtu.edu.cn/ftp/pub/linux/kernel/ftp: //166.111.136.3/pub /Linux/kernel, 2.2.x version is relatively stable, recommended. 3) Put the packaged kernel decompression core, patch, and unlocked source code account for about 70m hard disk space; log in with root, unlocked source code should be in /usr/src/linux2.2.15 below: # TAR ZXVF Linux-2.2.15.tar.gz or #gzip T Linux-2.2.15.tar.gz # tar x linux-2.2.15.tar If you are too troublesome, you can also in a Windows machine. Using the software such as WinZip, let Linux can access it with FTP or Mount, etc.. 4) Installing GCC-2.7.2 or Updated in the system 5) If there is no grasp, the original kernel (under / boot) is re-backed up in another place. Don't forget the simultaneous backup module (/LIB/modules/2.xx )4. Nuclear Editing In order to make the kernel conform to the actual needs of their own systems and applications, some editing work is generally to modify certain heads. Several parameters in the file. For example, when installing Oracle 8.0.5, in order to enable Oracle to match the actual physical memory capacity to improve performance, modify the / usr / src / linux / include / ASM ShMParam.h file Some memory parameters.

5. Nuclear configuration kernel configuration methods, make config, make xconfig, make menuconfig, make oldconfig, etc., their functions are the same, the difference should be seen from the name, only make oldconfig is the current system Setting (./.config) as the default. It is made here that Make MenuConfig. Need to keep in mind: The more you don't have to drive, the larger the kernel, not only slower speed, more memory, but in a few cases, other problems will also be triggered. The specific steps are as follows: First, determine the shell is BASH. Then $ make metronfig has some default symbols The meaning is as follows: Y: Load N: Do not load M: As a module loading can be configured: / drivers [n / y /?] If you are interested in testing some modules that have not been finalized in the kernel, choose Y, otherwise choose N, want to know more detailed information selection? Will see online help (the following meaning of the following), N uppercase represents the default. 2) Processor Type and Features processor type and characteristics Processor Family (386, 486 / CX486, 586 / K5 / 5X86 / 6X86, Pentium / K6 / TSC, PPRO / 6X86MX) [PPRO / 6X86MX] [] is default Value, we can choose the result of the uname commands described earlier. This item is higher than 386, then the generated kernel will not be activated on the 386 machine. Math Emulation (config_math_emulation) [N / Y /?] Do you need a coprocessor simulation? The general machine is back to n. If the machine already has a hardware coordinator, the kernel will still use hardware, and ignore the software Math-emulation, which will make the kernel becomes larger. MTRR (Memory Type Range Register Support (config_mtrr) [n / y /? ] In the system of Pentium, the PRO / PENTIUM II class can improve image write speed. SYMMETRIC MULTI-Processing Support (config_smp) [Y / N /? ] If your machine has multiple processors, you choose Y. At this time, you want to select the following Enhanced Real Time Clock Support3) Loadable Model Support Loading Module Support Enable Loadable Module Support (config_modules) [y / n /? ] It is best to choose Y, otherwise many modules for dynamically loaded cannot be used.

SET VERSION INFORMATION ON All SYMBOLS for MODULES (config_modversions) [N / Y /? ] NKERNEL MODULE LOADER (config_kmod) [N / Y /?] 4) General setup generally sets networking support (config_net) [Y / N /?] Choose Y, now have several computers do not have to access the Internet? PCI support (config_pci) [Y / N /?] The PCI bus and device should always be. PCI Access Mode (BIOS, Direct, Any) [Any] The default value is more insurance, but if you are very confident about your motherboard, choose BIOS. PCI quirks (config_pci_quirks) [Y / N /?] Is used to patched BUG that has an impact on PCI in the BIOS. Similarly, if you have confidence in the motherboard, choose n. BACKWARD-Compatible / Proc / PCI> (config_pci_old_proc) [Y / N /?] Previous kernel use / proc / pci, new core use / proc / bus / pci, to keep compatibility, select Y. MCA Support (config_mca) [N / Y /?] View Help. SGI Visual WorkStation Support (config_visws) [n / y /?] Is your machine SGI? Yes Y. SYSTEM V IPC (config_sysvipc) [Y / N /?] Process between communication functions and system calls. One of the five major components of the Linux kernel must be selected. BSD Process Accounting (config_bsd_process_acct) [N / Y /?] Is used to initiate user-level system calls written by the kernel. Just look at you don't want to use it. Sysctl support (config_sysctl) [Y / N /?] Modify the kernel when the kernel is running. Use 8KB to exchange some convenience. Don't choose, unless you really want to try it. KERNEL Support for a.out binaries (config_binfmt_aout) [Y / M / N /?] In order to use the previously compiled program, select Y. KERNEL Support for Elf Binaries (config_binfmt_elf) [Y / m / N /?] In order to use the currently compiled programs, select Y. KERNEL Support for Misc Binaries (config_binfmt_misc) [Y / m / n /?] Is typically selected to support automatic execution of code such as Java. Parallel Port Support (config_parport) [N / Y / M /?] Parallel equipment, such as a printer. 5) PLUG AND Play Support Plug and Play Device Support PLUG AND Play Support (config_pnp) [N / Y /?] Select Y. 6) BLOCK DEVICES block device NORMAL PC FLOPPY DISK Support (config_blk_dev_fd) [Y / M / N /?] A general floppy drive. Option Y.

ENHANCED IDE / MFM / RLL Disk / CDROM / TAPE / FLOPPY Support (config_blk_dev_ide) [Y / m / N /?] Hard drive, optical drive, tape, floppy drive of these interfaces. Option Y. INCLUDE IDE / ATAPI CDROM Support [Y / M / N /?] CDROM. Option Y. 7) Networking Options Network Option Packet Socket (config_pachet) [Y / M / N /?] According to the current situation of the current network, the choice Y is better. Of course, you can choose other. Kernel / user netlink socke (config_netlink) [n / y /?] Kernel communicates two-way communication with the user process. Option Y. Network firewalls (config_firewall) [n / y /?] If you really need a firewall, you choose Y. Unix Domain sockets (confgi_unix) [Y / m / N /?] Socket is too much. Option Y. TCP / IP Networking (config_inet) [Y / N /?] NE, the reason is as follows. The ipx protocol (config_ipx) [n / y / m /?] It is actually not so many people really need to use or learn IPX, so it is generally selected. AppleTalk DDP (Config_ATALK) [N / Y / M /?] Select N, the reason is the same. 8) SCSI Support SCSI Support, SCSI Low-Level DRIVES SCSI low-level driver is selected according to the actual situation of SCSI devices in the system. 9) Networking Device Support Network Device Support If you use the LAN to access the Internet, you choose the NIC; if you use the Modem to internet access, you must see ISP to provide that kind of service, usually PPP. 10) AMATEUR RADIO Support Amateur Radio Support This is not very clear, so choose N. 11) Isdn Subsystem IsDN subsystem seems to have a MODEM that supports ISDN, so it is best to look at this MODEM is not this, then do the choice. 12) Old CD-ROM DFIVERS (Not SCSI, Not IDE) Vintage CD-ROM drives generally selected n, because this device is rare. 13) Character Devices Character Device Virtual Terminal (config_vt) [Y / N /?] Linux can generally use Alt F1 / F2 / F3 / F4 to switch different task terminals, even in a computer, Linux can also be used. Multi-tasking capabilities, some software that needs to be installed with command line If there is a virtual terminal support, it will be more convenient, so select Y. Support for console on virtual terminal (config_vt_console) [Y / N /?] The NET will support a virtual terminal as a console. Generally ALT F1. Support for console on serial port (config_serial) [Y / m / n /?] Is selected unless you really need a serial console, otherwise N.

EXTENDED DUMB SERIAL DRIVER OPTIONS (Config_Serial_extended [N / Y /?] If you want to use "DUMB" non-standard characteristics (such as Hub6 support), choose Y, generally N. Non-Standard Serial Port Support (config_serial_nonstandard) [N / Y /?] Non-standard serial port. Generally selected N. UNIX98 PTY Support (config_unix98_ptys) [Y / N /?] PTY refers to the pseudo terminal, and the general user is selected n. However, if you want to use Telnet or Xterms as a terminal to access the host, GLIBC2.1 has been installed, you can choose Y. Maximum Number Of UNIX98 PTYS IN USE (0-2048) (config_unix98_pty_count) [256] The default is OK. MOUSE Support (CONFIG_MOUSE) (CONFIG_MOUSE) [Y / N /?] PS / 2 and other non-serial mouse select Y, otherwise N. 14) The MICE mouse is selected according to its own mouse type. 15) Video for Linux Linux Video Select the sound / video capture device in the system. 16) JOYSTICK SUPPORT Joystick Select 17 in the system 17) FTAPE, The FLOOPY TAPE DEVICE DRIVER FTAPE device drivers FTAPE (QiTAPE) [N / Y / M /?] If There is a tape drive, choose Y. 18) The selection of the FileSystems file system file system is carefully, because some of them provide support for some system functions. Moreover, in addition to the file systems such as Proc, EXT2, other file systems (including the network file system below) can be selected to be m-way, thereby reducing the volume of the kernel startup. Quota Support (config_quota) [N / Y /?] Is used to divide the user to divide the quantitative disk space. If you don't have this feature, choose N. DOS FAT FS Support (config_fat_fs) [n / y / m /?] Provides FAT support for the kernel, most users may access Windows hard disk space from Linux to the same system, so it is best to choose Y. ISO 9660 CDROM FILESYSTEM Support (config_iso9660_fs) [Y / m / n /?] There is a standard optical drive system should choose Y. MINIX FS Support (config_minix_fs) [n / y / m /?] Is used to create a file system of the boot disk, most of which should be Y or M. / proc filesystem support (config_proc_fs) [Y / N /?] Virtual file system, you must choose Y. SECOND EXTENDED FS Support (config_ext2_fs) [Y / M / N /?] Linux standard file system should choose Y. 19) Network File Systems Network File System CODA FileSystem Support (Config_coda_fs) [N / Y / M /?] First look at the help again.

NFS FileSystem Support (config_nfs_fs) [Y / M / N /?] Select Y or N to access the remote NFS file system. SMB FILESYSTEM Support (config_smb_fs) [n / y / m /?] To access the shared resource choice Y in the Windows system. NCP FILESYSTEM Support (CONFIG_NCP_FS) [N / Y / M /?] If you really need to access the NetWare file system, choose Y or M. 20) Parthen Types partition type is generally not used; please refer to help. 21) Console Drivers Console Drivers VGA Text Console (config_vga_console) [Y / N /?] Operate Linux with text in VGA mode, generally Y. Video Mode Selection Support (config_video_select) [N / Y /?] Most systems do not need this feature. 22) Sound Sound Sound Card Support (config_sound) [N / Y / M /?] If the sound card is installed in the system, select Y (or M), then view the help. 23) Keernel Hacking kernel monitoring kernel Hacking tends to generate very large or very slow (even big and slow) kernels, even causing the kernel work unstable. If you must choose, it is best not to select "Development", "Experimental", "Debugging" item. 6. Compile the new kernel in / usr / src / linux directory to execute 1) $ makefile2) $ make dep to set all dependencies. 3) $ make Clean Clear all existing target files, if you forget to do this, the built kernel will be very large. 4) $ Make Zimage / Make Zdisk / make Bzimage / Make Zlilo Generates a compressed kernel. If you want to make a startup disk, use Make ZDisk, don't forget to insert a floppy disk in A:. Make Zlilo Adds the generated kernel to LILO, but do not use this in the first few compiled kernels to avoid failure of the system due to the generated cores. Make Bzimage is used to generate more than 1M kernel. However, if your kernel exceeds this limit, it is best to see if there is anything that should not be. 5) If your kernel uses a detachable module, you need to run Make Modules and Make Modules_Install in turn.

7. Install the newly generated kernel and set LILO1) Copy the new kernel generated (under / usr / src / linux / arch / i386 / boot / zimage) to / boot. 2) Edit LILO boot file /etc/lilo.f, format reference is as follows: image = / boot / zimagelabel = mylinuxroot = / dev / hda1read-onlyimage = / boot / vmlinuxLabel = Linuxroot = / dev / hda1read-only3) Runlo4) Restart your computer

转载请注明原文地址:https://www.9cbs.com/read-2259.html

New Post(0)