How to customize the 2.6 kernel is easier-Linux general technology-Linux programming and kernel information. The following is a detailed description. As a leader in actively promoting software innovation, the Linux operating system has become an outstanding representative of the open system movement. As the core of various Linux distributions, the Linux kernel has continuously introduced new technologies for many years to improve its performance, such as scalability, availability, and technical support. Many improvements focus on increasing support for other architectures, processors, buses, ports, and peripherals. Since the Linux 2.2 kernel, every new kernel has to undergo rigorous testing and testing, so its development cycle is around two years.
In addition to the new features, each new version of the stable Linux kernel will improve a large number of original functions, and the internal interfaces will be customized to make them more standard to improve compatibility with other devices, it also simplifies the support process for new devices and subsystems. Some of these improvements are only related to kernel developers and hardware driver writers, while others affect system startup, system management, and application software settings.
If you are porting existing applications to a 2.6 kernel-based Linux suite, such as the TimeSys Linux system, it may not take much effort, the reason is that the performance of TimeSys Linux has been greatly improved. In addition, it also adds support for industry standards, such as POSIX. However, if you are porting hardware drivers, customized system-level applications, or customized Linux root file systems, you can refer to the basic kernel changes in internal components, subsystems, system startup, and system management. This will save you a lot of development time and greatly reduce the problems you may encounter during the migration process.
This section describes how to port existing hardware drivers, application software, and embedded Linux components to a 2.6 kernel-based Linux Suite (we use TimeSys Linux as an example ). Combined with some software tools to provide users with the required information, help users speed up the development process, control software conversion and improve costs, it can even speed up the entry of Linux-based devices, systems, and applications into the market. The software listed here is tool software such as the TimeStorm Linux tool suite. They can help users in development, porting, debugging, and verification cycles.
2.6 kernel-based settings
The kernel is the core of the Linux operating system. It manages the distribution of all system threads, processes, resources and resources. Unlike other operating systems, Linux allows users to reset the kernel. You can "slim down" the kernel to add or remove support for certain devices or subsystems. When developing embedded systems, developers often reduce the system's support for useless devices and allocate the saved memory to various applications.
Linux Kernel support for various hardware and ports depends on a variety of hardware drivers. These drivers can be directly written to the kernel, or automatically loaded as needed for specific hardware. Generally, the kernel encoding that can be automatically loaded into the kernel is called automatic loading of the kernel module.
Linux Kernel settings are completed through the kernel settings editor. The kernel setting editor can describe each kernel setting variable to help you decide which variables need to be cleared, which need to be written to the kernel, or compile a kernel module that can be loaded as needed.
The first step to creating a new kernel is to set the kernel. When you set the kernel, you must first write and install the kernel and other kernel modules that can be loaded. If you want to build and set the kernel of the original system, this step is very simple. However, if you want to apply the original system kernel compilation to other target systems, this step will become more difficult. For example, when you modify the Linux kernel of an embedded system, you may first set the kernel on a desktop system, and then use a compilation tool to transplant it to an embedded system. This type of compilation tool is called a cross-Compilation Program.
A cross-compiled program will produce a series of binary codes while a class of systems are running. These codes are specially designed for another type of system. The two systems have completely different processors or architectures. During the compilation of the kernel or module, you must use a variety of environment variables or Makefile settings to determine the specific cross-Compilation Program. You can also directly use an integrated development environment such as TimeSys to achieve this goal. TimeStorm helps you easily select cross-compiling programs. Similarly, if you use cross-Compiling of Linux kernels and modules to apply them to embedded systems without software such as TimeStorm, you must manually modify them through additional settings and Makefile, to determine the installation process and location of the kernel and module.
Linux 2.6 kernel-based settings are much easier than ever. In Linux 2.6, the kernel uses the new graphic setting editor to make it easier to compile the kernel and set the subordination of variables. In the past, the 2.x-Based Kernel provided users with four basic kernel settings Editors:
◆ Config serves a lengthy command line interface set by the kernel;
◆ Oldconfig is a text interface that contains an existing setting file to sort the setting variables in the kernel resources discovered by the user;
◆ Menuconfig is a terminal-oriented editor based on the cursor control library. It provides a graphic user interface in text mode;
◆ Xconfig: an image kernel setting editor. The X-Window system must be installed.
The first three Editors can still be used when setting the 2.6 kernel. After "make xconfig" is run, the original interface is replaced by two new graphic setting editors. This requires the support of the Specific graphics library and the X-Window system. In addition, you can use the "make defconfig" command to automatically create a kernel setting file using the default values of all kernel setting variables.
Use the new graphic editor to set the kernel
After you run the "make xconfig" command, a more robust new graphic editor is generated. The new kernel settings editor uses Trolltech's Qt tool suite. Many Linux systems do not integrate the Qt toolkit, but users can download it for free from the http://www.trolltech.com website. Which of the following is the new example?
As shown in 1, the kernel settings editor is a graphical interface consisting of three panels. The tree structure that can be expanded on the left side shows valid kernel settings options, the upper right panel displays the specific settings of the selected items on the left panel, and the lower right panel displays help information about the selected settings.
(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // tech.ccidnet.com/pub/attachment/2004/12/367791.jpg'); ">
2.6 kernel settings page
(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // tech.ccidnet.com/pub/attachment/2004/12/367793.jpg'); ">
Gconfig kernel Editor interface
When you execute the command "make gconfig", the screen displays the second graphic settings editor. The setting editor initially displays a graphical interface consisting of two panels, as shown in figure 2. You can click the "Split" button on the toolbar to change gconfig to a graphical interface similar to the xconfig interface. The kernel setting editor must support the GTK2 (GIMP Toolkit, Version 2) tool. Most Desktop Linux systems use the GTK2 tool.
Generally, the editor interface called up by the "make gconfig" command is not as detailed and easy to use as that called up by the "make xconifg" command. Unless you have some setup tools such as TimeSys and TimeStorm Linux development kits, we recommend that you use the "make xconfig" command to set the kernel.
Kernel setting skills
There are many kernel setting options. Here, we will only list a few general tips and suggestions. Setting the Linux 2.6 kernel is much simpler than the previous version, but it has more options. This means that it is easier for a kernel that cannot be started and run on the hardware or that cannot support existing application software.
As a common technique, the xconfig or gconfig Editor provides several very useful kernel setting Options.
◆ Show all options Option. The System Displays all available kernel setting options, even if an option cannot be selected for various reasons (usually because the related options are not selected ). This option helps you understand whether the required options exist in kernel resources.
◆ Show debug info option. The system displays the kernel setting variables related to the selected options in the Help window. This option helps you understand the prerequisites required to activate other kernel settings.
◆ Show Name option. The system displays the name of the kernel setting variable related to each kernel setting option, which helps determine the subordination between kernel setting variables.
If you have set the kernel as needed and the "make" command used to compile and install the kernel is different from the Linux 2.6 kernel, you can use the "make help" command to display all valid options for setting the 2.6 kernel.
Other "make" commands also include "make dep ". This command provides variable subordination information. In addition, the "make" command can also compile the kernel and other drivers selected for installation. "Make install" and "make modules_install" are two basic and common "make" commands.
Create a new kernel setting file
One of the effective methods for setting Linux kernel is to use the "make oldconfig" command. This command can create a new kernel setting file based on the existing kernel settings file. If you do not have a kernel setting file, you can run this command or start any graph kernel setting editor to create one.
The "make oldconfig" command is very useful during kernel upgrade settings. The "make oldconfig" command allows the kernel setup process to read the user's existing settings, prompting the user to enter the value of a certain kernel setting variable. This variable cannot be found in the existing kernel settings file.
Now we will perform a test to port the existing kernel settings from the 2.4 kernel-based Linux kit to the 2.6 kernel-based Linux kit. First, copy the file named. config to the directory where the Linux 2.6 kernel source code is located. For example, to migrate a custom configuration file from TimeSys Linux 2.4 Based on the 4.1 kernel to TimeSys Linux based on the 2.6 kernel, the main steps are as follows:
# Cd/opt/timesys/linux/4.1/iq80315/src/2.4.21-timesys-4.1/kernel
# Cp. config/opt/timesys/linux/5.0/iq80315/src/2.6-timesys-5.0/kernel
# Cd/opt/timesys/linux/5.0/iq80315/src/2.6-timesys-5.0/kernel
# Make oldconfig
At this time, the system will prompt the user to enter the value of all currently undefined kernel setting variables. After the input is complete, the "make oldconfig" command will automatically generate an upgrade kernel setting file. Then you can start to create a new kernel. Of course, you can continue to use the more powerful kernel settings editor to set the kernel, such as xconfig.
Summary
For Linux releases based on the 2.6 kernel, it is more important to simplify system settings. The new graphic settings editor greatly simplifies your 2.6 kernel settings. Currently, the TimeSys tool is widely used in the 2.6 kernel settings. However, with the emergence of new technologies, each new architecture, port, subsystem, and other devices will increase the number of kernel setting variables that users need to know.
Other software tools provide integration support for Kernel settings, such as Target Configurator. As a component of the TimeStorm Linux development kit, the Target Configurator is powered by the Open Source Eclipse architecture. To further simplify kernel settings, TimeSys Linux includes customized kernel settings files that provide excellent performance, regular development methods, and strong Error Correction capabilities. No matter which tool or kit you use, the Linux 2.6 kernel settings are improved a lot.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service