Arm Linux kernel build process

Publisher:神雕Latest update time:2016-07-25 Source: eefocusKeywords:Arm Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1. Generate vmlinux in the root directory of the Linux kernel source code according to arch/arm/kernel/vmlinux.lds. This vmlinux is the original kernel without compression, with debugging information and symbol table, and its size is about 23MB; 

arm-linux-gnu-ld -EL -p --no-undefined -X -o vmlinux -T arch/arm/kernel/vmlinux.lds

 

 

 


arch/arm/kernel/head.o 
arch/arm/kernel/init_task.o 
init/built-in.o 
--start-group 
usr/built-in.o 
arch/arm/kernel/built-in.o 
arch/ arm/mm/built-in.o 
arch/arm/common/built-in.o 
arch/arm/mach-s3c2410/built-in.o 
arch/arm/nwfpe/built-in.o 
kernel/built-in. o 
mm/built-in.o 
fs/built-in.o 
ipc/built-in.o 
security/built-in.o 
crypto/built-in.o 
lib/lib.a 
arch/arm/lib/lib.a 
lib/built-in.o 
arch/arm/lib/built-in.o 
drivers/built-in.o 
sound/built-in.o 
net/built-in.o 
--end-group .tmp_kallsyms2.o


2. Remove debugging information, comments, symbol table and other contents from the vmlinux above to generate arch/arm/boot/Image, which is the Linux kernel without redundant information. The size of the Image is about 3.2MB; 
command: arm-linux-gnu-objcopy -O binary -R .note -R .comment -S vmlinux arch/arm/boot/Image 

3. Compress arch/arm/boot/Image with gzip -9 to generate arch/arm/boot/compressed/piggy.gz with a size of about 1.5MB; 
command: gzip -f -9 < arch/arm/boot/compressed/../Image > arch/arm/boot/compressed/piggy.gz 

4. Compile arch/arm/boot/compressed/piggy.S to generate arch/arm/boot/compressed/piggy.o with a size of about 1.5MB. Here, piggy.gz is actually compiled into the piggy.o file through piggy.S. The piggy.S file has only 6 lines, which just includes the file piggy.gz; 
command: arm-linux-gnu-gcc -Wp,-MD,arch/arm/boot/compressed/.piggy.od -nostdinc -isystem /home/justin/crosstool/gcc-3.4.5-glibc-2.3.6/arm-linux-gnu/lib/gcc/arm-linux-gnu/3.4.5/include -D__KERNEL__ -Iinclude -mlittle-endian -D__ASSEMBLY__ -Wa,-L -gdwarf-2 -mapcs-32 -mno-thumb-interwork -D__LINUX_ARM_ARCH__=4 -march=armv4 -mtune=arm9tdmi -msoft-float -c -o arch/arm/boot/compressed/piggy.o arch/arm/boot/compressed/piggy.S 

5. According to arch/arm/boot/compressed/vmlinux.lds, link the files head.o, piggy.o and misc.o in the arch/arm/boot/compressed/directory to generate arch/arm/boot/compressed/vmlinux. This vmlinux is a compressed kernel with self-extracting code, with a size of about 1.5MB; 
command: arm-linux-gnu-ld -EL --defsym zreladdr=0x30008000 --defsym params_phys=0x30000100 -p --no-undefined -X /home/justin/crosstool/gcc-3.4.5-glibc-2.3.6/arm-linux-gnu/lib/gcc/arm-linux-gnu/3.4.5/libgcc.a -T arch/arm/boot/compressed/vmlinux.lds arch/arm/boot/compressed/head.o arch/arm/boot/compressed/piggy.o arch/arm/boot/compressed/misc.o -o arch/arm/boot/compressed/vmlinux 

6. Remove debugging information, comments, symbol tables, etc. from arch/arm/boot/compressed/vmlinux to generate arch/arm/boot/zImage with a size of about 1.5MB; this is already a usable Linux kernel image file; 
command: arm-linux-gnu-objcopy -O binary -R .note -R .comment -S arch/arm/boot/compressed/vmlinux arch/arm/boot/zImage 

7. Add 64Bytes of related information to arch/arm/boot/zImage and package it into arch/arm/boot/uImage with a size of about 1.5MB; 
command: /bin/sh /home/farsight/Resources/kernel/linux-2.6.14/scripts/mkuboot.sh -A arm -O linux -T kernel -C none -a 0x30008000 -e 0x30008000 -n 'Linux-2.6.14' -d arch/arm/boot/zImage arch/arm/boot/uImageArm Linux kernel build process

Keywords:Arm Reference address:Arm Linux kernel build process

Previous article:ARM MACHINE_TYPE_XXXX issue
Next article:ARM MPCore -- (2)

Recommended ReadingLatest update time:2024-11-16 19:30

Introduction to ARM processor and key points of RISC design
Introduction to the first ARM processor and RISC characteristics Introduction to ARM Processor ARM (Advanced RISC Machines) is a 32-bit RISC (reduced instruction set) processor architecture, and the ARM processor is a microprocessor under the ARM architecture. ARM processors are widely used in many embedded systems.
[Microcontroller]
Introduction to ARM processor and key points of RISC design
Design and Analysis of Boot Code for ARM RISC Microprocessor
    ARM Architecture     At present, the ARM series of general-purpose 32-bit RISC microprocessors include ARM7, ARM9, ARM9E, ARM10 and other products. These processors can work in 7 modes. All modes except User mode are called privileged modes, and the other 5 modes except User and System are called exception modes.
[Microcontroller]
Design and Analysis of Boot Code for ARM RISC Microprocessor
Design of large LED dot matrix display system based on ARM
Large-scale LED display system is an electronic advertising media formed with the rapid development of computer and related microelectronics and optoelectronics technology. It uses dot matrix modules or pixel units composed of light-emitting diodes to form a large-area display screen, which is mainly used to display
[Microcontroller]
Design of large LED dot matrix display system based on ARM
ARM7 Getting Started 11, IIC Communication
If D1 is lit, it is correct; if D1 is blinking, it is wrong. Main program: /******************************************************************************* *File: Main.C *Function: Use hardware I2C to operate EEPROM, and use interrupt mode to operate ***********************************************************
[Microcontroller]
ARM7 Getting Started 11, IIC Communication
ARM registers explained
There are 37 registers in total 1. 31 general purpose registers 2. 6 status registers R13 as stack pointer R14 Link Register 1. Save the function return address 2. Exception return address R15 Program counter (PC pointer) Program Status Register Program status register only available during excepti
[Microcontroller]
ARM registers explained
The role of R0-R15 registers in arm
According to the "ARM-thumb Procedure Call Standard": r0-r3 are used as parameters passed into functions and as return values ​​from functions. Between subroutine calls, r0-r3 can be used for any purpose.             The called function does not have to restore r0-r3 before returning. The calling function must pres
[Microcontroller]
Linux serial terminal driver - s3c6410 platform (Part 2)
1. Terminal equipment In Linux system, terminal is a character device, which has many types. Usually tty is used to refer to various types of terminal devices. TTY is the abbreviation of Teletype, which is the earliest terminal device, much like a teletypewriter, produced by Teletype. Linux includes the following ty
[Microcontroller]
Linux serial terminal driver - s3c6410 platform (Part 2)
Research on Home Video Server Based on ARM
Introduction With the continuous progress and development of science and technology, people have put forward higher requirements for the quality of life. As a new body, home network is getting closer and closer to people's lives. It joins the family unit as a node into the big family of the network. Among them,
[Microcontroller]
Research on Home Video Server Based on ARM
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号