Embedded Research - Several Typical Linux Core Configuration Solutions

xiaoxiao2021-03-06  80

P's general kernel configuration

For general users, the efficiency and size of the Linux kernel is not high. It is therefore generally not reconfigurable because the Linux installer will default to most of the installation and actual hardware at the installation. Such a core will be more than the actual needs, there are many modules that are not used after loading, but because the current PC's memory is generally hundreds of MB, and a Linux kernel is a few hundred k, so for general In terms of the user, there is no need to recompile the kernel.

Install Red-Hat 7.2 in a P3-566 DELL machine, the kernel version is 2.4.

Here are some of the configurations:

Loadable Module Support: Y

Networking support: y

PCI Support: Y

System V IPC: Y because you can do some SYSTEM V-based programs

KERNEL Support for a.out binaries: y

KERNEL Support for Elf Binaries: Y

Block Devices: The corresponding configuration is performed according to the hardware of the machine, removes the support module of some hardware devices that do not have. Loopback Device Support

Networking options:

Packet Socket: Y

TCP / IP Networking: y

Network firewalls: y

The ipx protocol: y

Network Device Support:

Network Device Support: Y

Ethernet (10 or 100MB / s): Y

Character Device

Virtual Terminal: y

Support for console on Virtual Terminal: y

FileSystems

Second Extended FS Support: Y

Vfat Fs Support: M The author sometimes uses the VFAT partition on the machine

/ Proc FileSystem Support Y

ISO9660 CDROM FILESYSTEM Support: M

NetWork file systems

NFS FileSystem Support: Y

SMB FileSystem Support: M

Console Drivers

VGA Text Console: Y

Video Mode Selection Support: y

VESA VGA Graphics Console: Y

Kernel Hacking

Magic sysrq key: y

There are still some default settings that the author did not change. This has been compiled with 700K. After the author debugging does not have any problems.

PDA kernel settings

PDA (Personal Digital Assist) such as: mobile phone, express translation, Wencheng, etc. Such systems require system stability, low core and high efficiency, often require some special hardware support. For process schedules, file systems require a single, some are single process systems. Support for networks is determined by the need. RedHat's kernel cannot be used directly to design some special requirements of PDA, which is generally added to the hardware's specific module.

Can be set as follows:

Networking support: Y: General PDA supports Internet update features

KERNEL Support for Elf Binaries: Y

Compile as elf -if your gcc is elf-gcc: y These two settings make the system's execution files are ELF

Advanced Power Manager BIOS Support: Y

Block Devices: The special support module for hardware should be added

Networking options

Packet Socket

FileSystem

Second Extended FS Support: Y

In addition, some features are n, of course, some functions must be used to support the above modules. After compiling 100KB - 400KB small embedded system

A small embedded Linux system requires only three basic elements below:

Guide tool,

2.Linux microenvironment, composed of memory management, process management and transaction processing

3. Initialization process

If you want to dry something and continue to be small, you have to add:

Hardware driver

2. Provide one or more applications for the desired function.

Add functions, perhaps these: a file system (perhaps in the ROM or RAM) TCP / IP network stack

For the system, made different settings:

Don't fLOPPY; don't be SMP, mtrr; don't get Networking, SCSI; remove all block devices, leaving only IDE Device; remove all Character Device; remove all FileSystem, leaving only Minix; do not support . This has been removed by all options. After doing so, I got a 188K core.

Use -O3, -O2 in the following two files to replace it with -OS.

./Makefile

./rch/i386/kernel/

Makefile

In this way, the entire core becomes 9K and becomes 179K.

However, this core is probably hard to play Linux's function, so add the network back. Plug the NetWork Support in General Setup, recompile, the core turns 189 K. 10K plus a TCP / IP Stack. There is STACK without Driver is also awkward, plus the RTL8139 of the Embedded Board back, 195K.

If you need a DOS archive system, that size is 213K. If MinIX is replaced with EXT2, the size is grown to 222K.

The memory required for Linux is approximately between 600K ~ 800K. 1MB memory may be booted, but it is not useful because it is difficult to connect to the C library. 2MB memory should do something, but to 4MB or more can execute a relatively complete system.

Because Linux's FileSystem is quite large, approximately 230K, accounting for 1/3 volume. Memory management accounts for 80K, and the sum of the core other parts is similar. TCP / IP Stack accounted for 65K, and the driver accounted for 120K. Sysv IPC accounts for 21K, if necessary, can take it, the core file should be around 10K.

If you want to crop the core size, should you move? The answer is obvious, of course, the file system. Linux's VFS simplifies archive system design, Buffer Cache, Directory Cache adds the efficiency of the system. However, these Embedded systems are not only available at all. If you can take them, the core can be left right away from 20K. If you skip the entire VFS, write the file system directly into a DRIVER model, you should reduce 230K to about 50K. The whole core is reduced to around 100K.

Industrial computer kernel

For the core of the industrial control machine, the size of the kernel is not strict, the key is the correctness, robustness and real-time (some machine requirements are relatively high). Single to file system, but ensure correctness. Network on-demand. Set.

Can be configured as follows:

Symmetric Multi-Processing Support: Y

Loadable Module Support: n The industrial computer generally puts all the modules that may be used in all memory.

Networking support: y

System V IPC: Y

KERNEL Supply for Elf Binaries: YBlock Devices:

Configuration according to specific hardware

Networking options

Packet Socket: Y

According to the specific needs, the general industrial computer is through the LAN connection, and the IPX protocol is isolated from the outside world, and the other TCP / IP is generally also required.

QoS and / or fair queueing: y

QoS (QUALITY OF Service) and Fair QUEUELING is a network thread table that schedules a package first, can be sorted for multiple network packets and sequenctions according to priority processing order, called packet schedulers. This feature is especially For real-time systems, it is important to be used when multiple packets are sent to the network device, and KERNEL can determine which package must be prioritized. So Kernel provides several Packet Scheduling Algorithm.

FileSystems

Second Extended FS Support: Y

The remaining configurations and small embedded systems are not different.

The kernel size compiled on the same machine is more than 800 KB

Server's kernel:

The server's kernel is critical to network settings and process schedules. Do as follows:

Symmetric Multi-Processing Support: Y

Loadable Module Support: Y

Networking support: y

NetWorking Option

Packet Socket: Y.

TCP / IP NetWorkeing: Y

Network firewalls: Do you use a network firewall. If the computer wants to be FireWalls Server or the network structure of the TCP / IP Communication Protocol, this item is selected [Y]

Network aliasing [y / m / n /?]: Computer on a network can have multiple sets of IP addresses. If the computer wants to have multiple IP addresses, select [Y].

IP: Forwarding / Gatewaying [Y / M / N /?]: If the user wants to be the router, select [Y], but the prerequisites are "two" network cards, one for external networks, one for internal networks, And the ISP used is also required to set ROUTING, allowing the user to do this router.

IP: MULTICASTING: You can complete the operation of sending a packet to a few computers at once.

IP: SYN_COOKIES: A protection measures to encrypt various TCP / IP communication protocols to prevent Attacker attack users, and can record the IP address of the computer's computer.

IP: FireWalling: Is the computer a firewall server?

IP: FireWall Packet Logging: Does Packet received by Klogd Firewall servers to receive.

IP: Masquerading: The package can be sent out of the package of the internal network, passed directly to the remote computer through the firewall server, while the remote computer see is the package that the received firewall server is sent, not from the interior The computer is delivered. This, if there is only one computer to go online, the remaining machines can connect to the firewall server of this machine. Select this option must first determine the previous NetWork FireWalls IP: Forwarding / Gatewaying IP: FireWalling These three options Select [Y]. And the next option IP: ALWAYS DEFRAMENT, you have to choose [Y].

IP: ICMP MASQUERADING: General MasqueReding only provides processing TCP, UDP Packets, to let Masqureading can handle ICMP Packets, this option is selected [Y].

IP: ALWAYS DEFRAGMENT: The received packet fragments can be re-combined back to the original package.

IP: Accounting: Statistics IP Packet traffic, that is, the circulation of the network.

IP: Optimize As Router NOT HOST: You can close your Copy & Checksum technology to prevent the IP Packets of the server from large. IP: tunneling: You can use Linux in different domains, and you can go directly to you without any IP. Suitable for notebook computer users.

IP: Reverse ARP: Mainly to provide BootP's feature, allow your computer to start from Boot Ram from the NIC.

IP: Disable path MTU Discovery: Whether to cancel the path MTU discovery.mtu helps handle the crowded network.

The IPX Protocol: IPX is the communication protocol used by the NetWare network.

The rest is set as needed. Compiled kernel 800K

Reprinted:

LinuxAid

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

New Post(0)