Linux2.6.22 porting based on 3c2410 (2)

Publisher:皮球Latest update time:2016-04-29 Source: eefocusKeywords:3c2410  linux2.6.22  port Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
(5)      Start compiling. The compilation process mainly consists of 6 steps;
a.       Generation of kernel header files
b.       Generation of Binary utilties
c.       Generation of Glibc header files
d.       Generation of first-stage gcc
e.       Generation of glibc library files
f.  Generation       of complete compilation tools
 Note: The first-stage gcc generation is mainly used to generate glibc library files.
1. Generate kernel header files
$root@host:/home/arm/kernel# tar xvjf linux-2.6.22.tar.bz2
$root@host:/home/arm/kernel# cd linux-2.6.22
$root@host:/home/arm/kernel/linux-2.6.22#
make ARCH=arm CROSS_COMPILE=arm-linux- menuconfig
Among them, menuconfig specifies the configuration interface. Other available options include config (full character interface) and xconfig (graphical interface under xwindow). Ubuntu needs to install tk8.4 to support xconfig. In addition, you need to uninstall mawk and install gawk. (mawk has a bug)
The linux2.6 kernel provides support for s3c2410. Select the s3c2410 series in system. After configuration, exit and save.
$root@host:/home/arm/kernel/linux-2.6.22# cd include
$root@host:/home/arm/kernel/linux-2.6.22/include# cd linux
$root@host:/home/arm/kernel/linux-2.6.22/include/linux# ls version.h autoconf.h
version.h autoconf.h
These two files will be used in the following compilation. If not, exit to the internal directory and make version.h.
Create the following link:
$root@host:/home/arm/kernel/linux-2.6.22/include# ln –s asm-arm asm
$root@host:/home/arm/kernel/linux-2.6.22/include# ln -s asm/arch-s3c2410 asm/arch
Copy the kernel header file to the final installation directory:
$root@host:/home/arm/kernel/linux-2.6.22/include# mkdir –p ${TARGET_PREFIX}/include
$root@host:/home/arm/kernel/linux-2.6.22/include# cp –rd asm-arm ${TARGET_PREFIX}/include
$root@host:/home/arm/kernel/linux-2.6.22/include#
cp –r asm- ${TARGET_PREFIX}/include
$root@host:/home/arm/kernel/linux-2.6.22/include#
cp –r linux ${TARGET_PREFIX}/include $root@host:/home/arm/kernel/linux-2.6.22/include# cp –d asm ${TARGET_PREFIX}/includeThus
 
the kernel header files are created.
2. Create Binary utilities:
binutils is a collection of binary tools, among which as, ar and ld are commonly used.
$root@host:/home/arm/kernel/include# cd ${PRJROOT}/build-tools
$root@host:/home/arm/build-tools# tar xvjf binutils-2.18.tar.bz2
$root@host:/home/arm/build-tools# cd build-binutils
$root@host:/home/arm/build-tools/build-binutils#
patch –Np1 –i /
home/arm/build-tools /patch/binutils-2.18* $root@host:/home/arm/build-tools/build-binutils#
../binutils-2.18/configure --target=${TARGET} –prefix=${PREFIX}
$root@host:/home/arm/build-tools/build-binutils# make
$root@host:/home/arm/build-tools/build-binutils# make install 1. At the same
time, some files starting with arm-linux should be generated under ${PREFIX}/bin.
$root@host:/home/arm/build-tools/build-binutils# ls ${PREFIX}/bin .
3. Generate glibc header files:
$root@host:/home/arm/build-tools/build-binutils# cd ..
$root@host:/home/arm/build-tools/# tar xvjf glibc-2.6.1.tar.bz2
$root@host:/home/arm/build-tools/#
tar xvzf glibc-2.6.1.tar.gz --directory ./glibc-2.6.1/
$root@host:/home/arm/build-tools/# cd glibc-2.6.1
$root@host:/home/arm/build-tools/glibc-2.6.1# mv glibc-ports-2.6.1 ports –vApply
the patch:
$root@host:/home/arm/build-tools/glibc-2.6.1#
patch –Np1 –i /home/arm/build-tools/patch/glibc-2.6.1-*patch
$root@host:/home/arm/build-tools/glibc-2.6.1# cd ..
$root@host:/home/arm/build-tools/# cd build-glibc-headersHere
you need to add support for the NPTL thread library:
$root@host:/home/arm/build-tools/build-glibc-headers# 
echo “libc_cv_forced_unwind=yes”>>config.cache
echo “libc_cv_c_cleanup=yes”>>config.cache
echo “libc_cv_arm_tls=yes”>>config.cacheNote
: If “cannot compute long double size” appears during compilation, add:
echo "ac_cv_sizeof_long_double=12">>config.cache
$root@host:/home/arm/build-tools/build-glibc-headers#
../glibc-2.6.1/configure --host=${TARGET} --prefix=”/usr” --enable-add-ons
--with-headers=${TARGET_PREFIX}/include --cache-file=config.cache
$root@host:/ home/arm/build-tools/build-glibc-headers#
make cross-compiling=yes install_root=${TARGET_PREFIX} prefix=””
install-headers
$root@host:/home/arm/build-tools/build-glibc-headers#
mkdir –p ${TARGET_PREFIX}/include/gnu
$root@host:/home/arm/build-tools/build-glibc-headers#
touch ${TARGET_PREFIX}/include/gnu/stubs.h
Note: If an error occurs during compilation that the header file cannot be found, you can use the touch command to create an empty file in the corresponding directory according to the file name in the error prompt. Generally, the compilation can be successful.
Keywords:3c2410  linux2.6.22  port Reference address:Linux2.6.22 porting based on 3c2410 (2)

Previous article:Linux 2.6.22 port based on 3c2410 (1)
Next article:Linux 2.6.22 port based on 3c2410 (3)

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号