S3C2440 transplants the linux3.4.2 kernel and kernel tailoring

Publisher:TranquilMindLatest update time:2022-11-17 Source: zhhuKeywords:S3C2440 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Why prune the kernel?

Because the kernel partition of mtd is only 2M, and the actual kernel is 2.37MB, it needs to be cut to less than 2M (or the mtd partition value is modified)


First cut the irrelevant CPU/board files in the kernel

Through vi .config, and then search for 2440, as shown below:

Then refer to the picture above, make menuconfig

Enter System Type ---> SAMSUNG S3C24XX SoCs Support:


As shown in the picture above, only 2440 is selected under CPU, and only SMDK2440 and MINI2440 related are selected under single board file.

Crop irrelevant file systems ext2, ext3, ext4

Remake menuconfig, enter File systems, and remove:


< > Second extended fs support //ext2

< > Ext3 journalling file system support 

< > The Extended 4 (ext4) filesystem

Crop Disc File System CD-ROM

Enter File systems---> CD-ROM/DVD Filesystems and remove:


< > ISO 9660 CDROM file system support    

Prune infrequently used miscellaneous file systems

Enter File systems---> Miscellaneous filesystems and remove:


< > Compressed ROM file system support (cramfs) // cramfs compressed file system

[ ] Include support for ZLIB compressed file systems //zlib compressed file systems

< > ROM file system support // Romfs

Clipping by kernel boot information

As shown in the figure below, when the kernel starts, the PS2 mouse driver is initialized.


Since our 2440 board only has a USB interface, we need to cut out the PS2 mouse driver:

Remake menuconfig, enter Device Drivers->Input device support, and remove:


[ ] Provide legacy /dev/psaux device //The mouse device file pointed by the PS2 mouse

[ ] Mice ---> //Other mouse drivers, including PS2 mouse, I2C mouse, touchpad, etc.

                    [ ] PS/2mouse

Crop by the contents of the .config file

Through vi.config, find the picture below. Since CONFIG_TOUCHSCREEN_USB (USB touchpad) is rarely seen, remove it.

USB-based Watchdog Cards (USB-based watchdog cards)

As shown in the figure below, this watchdog card is rarely used, so CONFIG_SSB_POSSIBLE is removed.

USB-based Watchdog Cards (USB-based watchdog cards) Sonics Silicon Backplane (Silicon backplane under Sonics) As shown in the figure below, this company's products are not used, so CONFIG_BCMA_POSSIBLE is removed

Find the picture shown below. Since CONFIG_SND_USB (USB sound card) is not used, remove it.

Remove CONFIG_USB_LIBUSUAL, not used

Finally, make menuconfig through the cropped content found in the previous section.

Remove CONFIG_TOUCHSCREEN_USB


-> Device Drivers                                                                    


  ->Input device support


    -> Generic input layer


    ->Touchscreens


<*> Samsung S3C2410/generic touchscreen input driver //Add its own touch screen driver


< > USB Touchscreen Driver //Remove the USB touchscreen driver 

Remove CONFIG_SSB_POSSIBLE and search as shown in the figure below. This macro is set by other options, so it cannot be removed:

Remove CONFIG_BCMA_POSSIBLE. The macro was not found, so it cannot be removed. CONFIG_SND_USB


-> Device Drivers


-> Sound card support


  -> Advanced Linux Sound Architecture


[ ] USB sound devices //Remove USB sound card driver


5) Remove CONFIG_USB_LIBUSUAL


-> Device Drivers 


-> USB support


[ ] The shared table of common (or usual) storage devices       

The size after cropping is as follows

Make a patch for the kernel

Before making a patch, you first need to make distclean to clear all configuration files, including the menuconfig menu. The menuconfig menu is generated by reading the .config file. So we need to save the .config file as follows:


cp .config config_ok //Save to config_ok file

make distclean                  

cd ../


mv linux-3.4.2 linux-3.4.2_new //Change file name

tar -xjf linux-3.4.2.tar.bz2 //Decompress the source files that need to be compared


diff -urN linux-3.4.2 linux-3.4.2_new > linux-3.4.2_new.patch //Generate patch file linux-3.4.2_new.patch


Keywords:S3C2440 Reference address:S3C2440 transplants the linux3.4.2 kernel and kernel tailoring

Previous article:Detailed explanation of the LCD display project of S3c2440
Next article:DATASHEET register packaging trap--S3C2440 as an example

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号