⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 compiling_linux_kernel.html

📁 9200的开发资料:包括uboot
💻 HTML
字号:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <meta name="Authors" content="Olivier DEBICKI, Mohammed Amine SAYA">
   <title>Compiling AT91RM9200DK Linux Kernel</title>
</head>
<body bgcolor="#FFFFFF">
<center>
  <h1> 
    <hr WIDTH="100%">
    <a NAME="Building AT91RM9200DK"></a>Building AT91RM9200DK linux kernel</h1>
</center>
<hr WIDTH="100%">
<p><br>
  Building your own kernel for your machine can be a daunting task. For a quick 
  getting started you can use the pre-built kernel uImage<b> </b>provided with 
  the linux distribution: it's under the main directory linux-2.4.19-rmk7.</p>
<p>This guide will give you step by step instructions about compiling a kernel 
  for AT91RM9200DK machines on the target platform: </p>
<blockquote> 
  <blockquote> 
    <li> <a href="#Decide where to build your kernel">Prepare your environment</a></li>
    <li> <a href="#Source files for AT91RM9200DK linux">AT91RM9200DK sources</a></li>
    <li> <a href="#Unpacking the ARM kernel">Unpack kernel sources</a></li>
    <li> <a href="#Configuration of the kernel source">Configuration of the kernel 
      source tree</a></li>
    <li> <a href="#def_kernel"> Default Kernel configuration</a></li>
    <li><a href="#nfs_kernel">Kernel configuration when using NFS ramdisk</a></li>
    <li> <a href="#Compiling the kernel source">Compilation of the kernel source 
      tree</a></li>
  </blockquote>
</blockquote>
<b><i>Notes:</i></b> <br>
&nbsp; 
<ul>
  <li> "bash$" and "bash#" are shell prompts, not commands to be typed.</li>
  <li> "host" means the machine you are building the ARM kernel on.</li>
  <li> "target" means the machine you are building the ARM kernel for.</li>
</ul>
<h2><a NAME="Decide where to build your kernel"></a>Decide where to build your 
  kernel</h2>
First of all, you need to decide where you are going to build your ARM Linux kernel. 
A good place is to build the kernel in /usr/src/arm. If you wish to build it in 
a different place, replace /usr/src/arm with your preferred location. Please note 
that in general, building a kernel in /usr/src/linux is not recommended. <br>
You will need to create the /usr/src/arm directory before you download the source 
and patches, if it doesn't exist already. This directory should be owned by your 
non-root user ID To do this, become root: 
<dl> 
  <dd> &nbsp;bash$ su</dd>
  <dd> &nbsp;Password:</dd>
  <dd> &nbsp;bash# cd /usr/src</dd>
  <dd> &nbsp;bash# mkdir arm</dd>
  <dd> &nbsp;bash# chown myuser.mygroup arm</dd>
  <dd> &nbsp;bash# exit</dd>
  <dd> &nbsp;bash$</dd>
</dl>
<h2><a NAME="Source files for AT91RM9200DK linux"></a>Source files for AT91RM9200DK 
  linux</h2>
AT91RM9200DK linux code source delivered in the CDROM is a patched, ready-to-build 
distribution. All the patches that we used to include in earlier CDROM releases 
don't exist anymore. We believe that providing a patched AT91RM9200DK linux distribution 
with a thorough configuration, which convers almost all the chip's peripherals, 
is much more easier to build and is the fastest way to run a linux demo. Going 
further in kernel configuration and Makfile customizing can be very tricky and 
overwhelming.<br>
However, if you want to apply your patches and build up a patched distribution 
from scratch you can find official patches on arm-linux site here <a href="http://www.arm.linux.org.uk/developer/patches/section.php?section=20" target="_blank"> 
http://www.arm.linux.org.uk/developer/patches/section.php?section=20</a> and a 
kernel distribution here <a href="http://www/kernel.org" target="_blank">www.kernel.org</a>. 
<br>
<br>
<br>
<h2><a NAME="Configuration of the kernel source"></a>Configuration of the kernel 
  source tree</h2>
First of all, as you are not compiling the kernel natively, you need to modify 
the top level kernel makefile. You will need to change the definition of "ARCH" 
and "CROSS_COMPILE". Replace the line starting with ARCH := with ARCH := arm. 
<br>
Set the starting with CROSS_COMPILE = to be the path and prefix to your compiler 
tools (eg, CROSS_COMPILE = /usr/local/arm/2.95.3/bin/arm-linux-). <br>
You may need to read linux/Documentation/README and linux/Documentation/arm/README 
before proceeding. 
<p>There are many 'make' targets that offer a set of defaults to be selected for 
  the particular machine you are compiling the source for. For your information 
  a default config file is shipped in our patched source distribution provided 
  in the CDROM. This config file is very thorough and contains all the options 
  that match the drivers we have added to the kernel so far. All you have to do 
  to configure your kernel is type the following commands : 
<dd>bash$ make at91rm9200dk_config</dd>
<dd>bash$ make oldconfig</dd>
<br>
&nbsp; 
<p>If you want to further customize your kernel configuration your use either 
  "make menuconfig" which will display a text configuration browser inside your 
  shell or "make xconfig" which will pop up a TCL/TK interface. We choose here 
  to use "make xconfig" because it's very simple and intuitive. 
<dd>bash$ make xconfig</dd>
<br>
<br>
<center>
  <img src="xconfig.jpg" border=0 align=center>
</center>
<br>
<br>
<p>At this time a TCL/TK graphical interface will pop up, this window contains 
  all the configuration options that will allow you to tune your kernel configuration 
  according to your hardware set. 
<h3><a NAME="def_kernel"></a>Default Kernel configuration:</h3>
<blockquote> 
  <p>Block Devices:<br>
    -&gt; Network block device support : n<br>
    -&gt; Ramdisk support: y <br>
    -&gt; Default Ramdisk size: 15360<br>
	-&gt; Initial Ramdisk (initrd) support: y<br></p>
  <p>File System -&gt; Network File systems:<br>
    -&gt; NFS file system support : n<br>
    -&gt; NFS server support: n</p>
  <p>Console drivers -&gt; Frame Buffer Support:<br>
    -&gt; support for frame buffer devices (exp): y<br>
    -&gt; epson LCD/CR/TV controller support: y<br>
    -&gt; epson S1 D1 3806 support for AT91RM9200DK: y<br>
    -&gt; virtual frame buffer support (only for testing!): n<br>
    -&gt; advanced low level driver option: y<br>
    -&gt; 16 bpp packed pixeld support: y (others n)</p>
<p> USB Support:<br>
  -&gt; support for USB: y<br>
  -&gt; AT91RM9200 OHCI- compatible host interface: y<br>
  -&gt; USB mass storage support : y<br>
  -&gt; USB Human Interface device (full HID) support: y<br>
  -&gt; HID input layer support : y</p>
</blockquote>

<h3><a name="nfs_kernel"></a>Kernel configuration when using NFS ramdisk:</h3>
<blockquote>
  <p>Below the details of the parameters when typing: make xconfig:<br>
    General setup:<br>
    -&gt; Default kernel string : Erase its contents</p>
    <p>Block Devices:<br>
    -&gt; Network block device support : y<br>
    -&gt; Ramdisk support: n </p>
    <p>File System:<br>
  <p> -&gt; Quota support: n<br>
    -&gt; Kernel automounter support: y<br>
    -&gt; DOS FAT fs support: y<br>
    -&gt; VFAT (Windows 95) fs support: y<br>
    -&gt; Journalling flash file system v2 (JFFS2) support: 0<br>
    -&gt; /proc file system support: y<br>
    -&gt; /dev file system support (EXP): y<br>
    -&gt; Automatically mount a boot: y<br>
    -&gt; Second extended fs support: y </p>

<p>File System -&gt; Network File systems:<br>
    -&gt; NFS file system support : y<br>
    -&gt; provide NFSv3 client support: y<br>
    -&gt; root file system on NFS: y<br>
    -&gt; NFS server support: n</p>
</blockquote>
<h2><a NAME="Compiling the kernel source"></a>Compiling the kernel source</h2>
If you are only installing the kernel source tree for other programs, then you 
have finished. If you want to compile up a new kernel, type the following commands: 
<dl> 
  <dd>&nbsp;bash$ make clean</dd>
  <dd>&nbsp;bash$ make dep</dd>
  <dd>&nbsp; Once done, you need to <a href="Loading_linux.html#build_uimage">build 
    an uImage from your kernel</a>. </dd>
</dl>
<h2>&nbsp; </h2>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -