Editing Documentation/Maemo 5 Developer Guide/Kernel and Debugging Guide/Maemo Kernel Guide

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
 +
= Kernel Guide =
 +
This chapter describes how to configure, compile and flash the Linux kernel for the Internet Tablet device. The chapter is targeted at developers wishing to compile their own custom kernels for the device.
This chapter describes how to configure, compile and flash the Linux kernel for the Internet Tablet device. The chapter is targeted at developers wishing to compile their own custom kernels for the device.
-
== Prerequisites ==
+
= Prerequisites =
-
Before starting, set up the Maemo environment. The required GCC toolchain that is used to compile the kernel is included in Scratchbox by default.
+
Before starting, the maemo environment should be set up. The required GCC toolchain that is used to compile the kernel is included in the Scratchbox by default.
-
Setting up a separate target for kernel compilation is not mandatory, but this example does it in case the default armel target has been modified in some way.
+
It is not mandatory to set up a separate target for kernel compilation, but this example does it in case the default armel target has been modified in some special way.
-
<ul>
+
* Start Scratchbox. <br /><br />
-
<li>Start Scratchbox.</li>
+
 +
$ scratchbox
-
<li><pre>
+
* Create a new target called MaemoKernel with qemu-arm CPU transparency. The second command installs the armel rootstraps to the target. The last command installs the C-library, /etc, devkits and fakeroot. <br /><br />
-
$ scratchbox
+
-
</pre></li>
+
[sbox-FREMANTLE_ARMEL: ~] &gt; sb-conf setup MaemoKernel \
-
 
+
-c cs2007q3-glibc2.5-arm7 \
-
<li>
+
-d qemu:perl:svn:apt-https -t /scratchbox/devkits/qemu/bin/qemu-arm-sb
-
Create a new target called MaemoKernel with qemu-arm CPU transparency. The second command installs the armel rootstraps to the target. The last command installs the C-library, /etc, devkits and fakeroot.
+
[sbox-FREMANTLE_ARMEL: ~] &gt; sb-conf select MaemoKernel
-
</li>
+
[sbox-MaemoKernel: ~] &gt; sb-conf rs MaemoKernel \
-
 
+
/home/&lt;username&gt;/maemo-sdk-rootstrap_5.0beta_armel.tgz
-
<li><pre>
+
[sbox-MaemoKernel: ~] &gt; sb-conf in MaemoKernel -edFL
-
[sbox-FREMANTLE_ARMEL: ~] > sb-conf setup MaemoKernel \
+
<br /><br /><div style="border: 2px solid rgb(255, 215, 0); background-color: rgb(252, 233, 79); margin-left: 25px; margin-right: 25px; padding: 2px"> N.B. <br /><br /> The &lt;username&gt; above refers to your login name in the environment. If you have used the maemo installer, the rootstraps are under your home directory. If you have performed a manual installation, the rootstrap is under /scratchbox/packages directory. This should be paid attention to, when running the sb-conf command above. </div>
-
-c cs2007q3-glibc2.5-arm7 \
+
* Verify that the sources.list file inside the scratchbox environment is correct. If the below lines are not in the /etc/apt/sources.list file, add them there. <br /><br />
-
-d qemu:perl:svn:apt-https -t /scratchbox/devkits/qemu/bin/qemu-arm-sb
+
-
[sbox-FREMANTLE_ARMEL: ~] > sb-conf select MaemoKernel
+
deb http://repository.maemo.org/ fremantle/sdk free non-free
-
[sbox-MaemoKernel: ~] > sb-conf rs MaemoKernel \
+
deb-src http://repository.maemo.org/ fremantle/sdk free
-
/home/&lt;username&gt;/maemo-sdk-rootstrap_5.0_armel.tgz
+
-
[sbox-MaemoKernel: ~] > sb-conf in MaemoKernel -edFL
+
deb http://repository.maemo.org/ fremantle/tools free non-free
-
</pre></li>
+
deb-src http://repository.maemo.org/ fremantle/tools free
-
</ul>
+
-
 
+
-
{{ambox|text=The <username> above refers to your login name in the environment. If you have used the Maemo installer, the rootstraps are under your home directory. If you have performed a manual installation, the rootstrap is under the /scratchbox/packages directory. Keep this in mind when running the sb-conf command above.}}
+
-
 
+
-
<ul>
+
-
<li>
+
-
Verify that the sources.list file inside the Scratchbox environment is correct. If the below lines are not in the /etc/apt/sources.list file, add them there.
+
-
</li>
+
-
 
+
-
<li><pre>
+
-
deb http://repository.maemo.org/ fremantle/sdk free non-free
+
-
deb-src http://repository.maemo.org/ fremantle/sdk free
+
-
 
+
-
deb http://repository.maemo.org/ fremantle/tools free non-free
+
-
deb-src http://repository.maemo.org/ fremantle/tools free
+
-
</pre></li>
+
-
<li>Create a working directory (inside Scratchbox) for the kernel sources.</li>
+
* Create a working directory (inside Scratchbox) for the kernel sources. <br /><br />
   
   
-
<li><pre>[sbox-MaemoKernel: ~] &gt; mkdir ~/maemo_kernel</pre></li>
+
[sbox-MaemoKernel: ~] &gt; mkdir ~/maemo_kernel
-
</ul>
+
The Scratchbox environment is now ready for compiling the kernel.
The Scratchbox environment is now ready for compiling the kernel.
-
== Getting Kernel Sources ==
+
= Getting Kernel Sources =
-
Kernel sources are not included in the rootstrap. Therefore, you need to download them from the repository.
+
Kernel sources are not included in the rootstrap, and therefore need to be downloaded from the repository.
-
<ul>
+
* Select the kernel compilation target, if not selected already. <br /><br />
-
<li>Select the kernel compilation target, if not selected already.</li>
+
   
   
-
<li><pre>
+
[sbox-FREMANTLE_ARMEL: ~] &gt; sb-conf select MaemoKernel
-
[sbox-FREMANTLE_ARMEL: ~] > sb-conf select MaemoKernel
+
-
</pre></li>
+
-
<li>Update the package database. This requires the earlier modifications in the sources.list file.</li>
+
* Update the package database. This requires the earlier modifications in the sources.list file. <br /><br />
   
   
-
<li><pre>
+
[sbox-MaemoKernel: ~] &gt; fakeroot apt-get update
-
[sbox-MaemoKernel: ~] > fakeroot apt-get update
+
-
</pre></li>
+
-
<li>Go to the working directory and fetch the sources.</li>
+
* Go to the working directory and fetch the sources. <br /><br />
   
   
-
<li><pre>
+
[sbox-MaemoKernel: ~] &gt; cd ~/maemo_kernel
-
[sbox-MaemoKernel: ~] > cd ~/maemo_kernel
+
[sbox-MaemoKernel: ~/maemo_kernel ] &gt; apt-get source kernel
-
[sbox-MaemoKernel: ~/maemo_kernel ] > apt-get source kernel
+
 
-
</pre></li>
+
-
</ul>
+
Kernel sources should now be fetched and ready to be compiled.
Kernel sources should now be fetched and ready to be compiled.
-
== Configuring Source Tree and Compiling Kernel ==
+
= Configuring Source Tree and Compiling Kernel =
-
<ul>
+
* There is a source subdirectory. Enter the directory and create the default configuration. <br /><br />
-
<li>A source subdirectory is listed. Enter the directory and create the default configuration.</li>
+
<nowiki>
-
 
+
[sbox-MaemoKernel: ~/maemo_kernel ] &gt; cd kernel-2.6.28
-
<li><pre>
+
[sbox-MaemoKernel: ~/maemo_kernel/kernel-2.6.28] &gt; make EXTRAVERSION=-maemo2 rx51_defconfig
-
[sbox-MaemoKernel: ~/maemo_kernel ] > cd kernel-2.6.28
+
-
[sbox-MaemoKernel: ~/maemo_kernel/kernel-2.6.28] > make EXTRAVERSION=-omap1 rx51_defconfig
+
  # lots of output from make program...
  # lots of output from make program...
-
</pre></li>
+
</nowiki>
-
<li>Compile the kernel image and check the image file timestamp to ensure that it is properly created.</li>
+
* Compile the kernel image, and check the image file timestamp to ensure that it is properly created. <br /><br />
-
 
+
<nowiki>
-
<li><pre>
+
[sbox-MaemoKernel: ~/maemo_kernel/kernel-2.6.28] &gt; make EXTRAVERSION=-maemo2 bzImage
-
[sbox-MaemoKernel: ~/maemo_kernel/kernel-2.6.28] &gt; make EXTRAVERSION=-omap1 bzImage
+
# compilation output...
-
# compilation output...
+
[sbox-MaemoKernel: ~/maemo_kernel/kernel-2.6.28] &gt; ls -l arch/arm/boot/zImage
-
[sbox-MaemoKernel: ~/maemo_kernel/kernel-2.6.28] &gt; ls -l arch/arm/boot/zImage
+
-rwxrwxr-x  1 maemo maemo 1717620 Jul 29 18:10 arch/arm/boot/zImage
-
-rwxrwxr-x  1 maemo maemo 1717620 Jul 29 18:10 arch/arm/boot/zImage
+
</nowiki>
-
</pre></li>
+
-
</ul>
+
-
{{ambox|text=The kernel is very strict on versions. <code>EXTRAVERSION=-omap1</code> sets the version to match the default installation. Instead of always supplying it to the <code>make</code> command, as done in this chapter, it is possible to modify the kernel <code>Makefile</code>. Another alternative is to avoid using <code>make</code> directly and use <code>dpkg-buildpackage -rfakeroot -b</code> to compile the kernel.}}
 
 +
<br /><br /><div style="border: 2px solid rgb(255, 215, 0); background-color: rgb(252, 233, 79); margin-left: 25px; margin-right: 25px; padding: 2px"> N.B. <br /><br /> The kernel is very strict on versions. <code>EXTRAVERSION=-maemo2</code> sets the version to match the default installation. Instead of always supplying it to the <code>make</code> command, as done in this chapter, it would be possible to modify the kernel <code>Makefile</code>. Another alternative would be to avoid using <code>make</code> directly and use <code>dpkg-buildpackage -rfakeroot -b</code> to compile the kernel. </div>
-
Now the device can be flashed with the new kernel image using the Flasher tool. This must be performed outside Scratchbox. For short instructions on flashing, see the [[Documentation/Maemo 5 Developer Guide/Development Environment/Maemo Flasher-3.5|Flashing Kernel]] section.
+
Now the device can be flashed with the new kernel image using the Flasher tool. This should be performed outside Scratchbox. See section [[#Flashing Kernel]] for short flashing instructions.
-
== Changing Default Kernel Configuration ==
+
= Changing Default Kernel Configuration =
The following steps describe how to change the default kernel configuration.
The following steps describe how to change the default kernel configuration.
-
<ul>
+
* Restore the original default configuration, just in case it has been changed. <br /><br />
-
<li>Restore the original default configuration, just in case it has been changed.</li>
+
   
   
-
<li><pre>
+
[sbox-MaemoKernel: ~/maemo_kernel/kernel-2.6.28] &gt; make EXTRAVERSION=-maemo2 \
-
[sbox-MaemoKernel: ~/maemo_kernel/kernel-2.6.28] > make EXTRAVERSION=-omap1 \
+
rx51_defconfig
-
rx51_defconfig
+
-
</pre></li>
+
-
<li>Edit the configuration file with your chosen editor. Editing the file is OK even though the system warns against it.</li>
+
* Edit the configuration file with your editor of choice. It is all right to edit the file, even though there is a warning against changing it included. <br /><br />
   
   
-
<li><pre>
+
[sbox-MaemoKernel: ~/maemo_kernel/kernel-2.6.28] &gt; vi .config
-
[sbox-MaemoKernel: ~/maemo_kernel/kernel-2.6.28] > vi .config
+
-
</pre></li>
+
-
<li>Include your changes for compilation.</li>
+
* Include your changes for compilation. <br /><br />
 +
 +
[sbox-MaemoKernel: ~/maemo_kernel/kernel-2.6.28] &gt; make EXTRAVERSION=-maemo2 oldconfig
-
<li><pre>
 
-
[sbox-MaemoKernel: ~/maemo_kernel/kernel-2.6.28] > make EXTRAVERSION=-omap1 oldconfig
 
-
</pre></li>
 
-
</ul>
 
 +
Now a kernel image with modified configuration can be recompiled, as described in the previous section.
-
Now a kernel image with modified configuration can be recompiled.
+
= Compiling External Kernel Modules =
-
If you have a local repository, by default extra information will be appended to the kernel version. This will stop the kernel version from matching the default install. To keep it from doing so, change scripts/setlocalversion to add "exit" to the beginning:
+
In this section, a simple external, or out-of-tree, kernel module is built against the kernel-headers. This is the recommended way of building new modules. The example is originally based on code [http://koltsoff.com/pub/hello-n800 here]. A real external kernel module could be a driver for an uncommon or new device or somespecial service for a system, but this example code only prints some helloworlds to kernel ring buffer.
-
<source lang="bash">
+
-
#!/bin/sh
+
-
# Print additional version information for non-release trees.
+
-
exit
+
-
</source>
+
-
== Compiling External Kernel Modules ==
+
# As before, start in the work directory. <pre>[sbox-MaemoKernel: ~/maemo_kernel] &gt;</pre>
-
 
+
# Install the kernel-headers package. <pre>[sbox-MaemoKernel: ~/maemo_kernel] &gt; fakeroot apt-get install kernel-headers</pre>
-
In this section, a simple external, or out-of-tree, kernel module is built against the kernel-headers. This is the recommended way of building new modules. A real external kernel module can be a driver for an uncommon or new device or some special service for a system, but this example code only prints some helloworlds to the kernel ring buffer.
+
# Create a folder for the example. <pre>[sbox-MaemoKernel: ~/maemo_kernel] &gt; mkdir hello-module&#13;[sbox-MaemoKernel: ~/maemo_kernel] &gt; cd hello-module</pre>
-
 
+
-
# As before, start in the work directory. <pre>[sbox-MaemoKernel: ~/maemo_kernel] ></pre>
+
-
# Install the kernel-headers package. <pre>[sbox-MaemoKernel: ~/maemo_kernel] > fakeroot apt-get install kernel-headers</pre>
+
-
 
+
-
<ol start=3>
+
-
<li> Download the example files from the Maemo svn.
+
-
<pre>
+
-
[sbox-MaemoKernel: ~/maemo_kernel] > svn export https://vcs.maemo.org/svn/\
+
-
maemoexamples/tags/maemo_5.0/hello-module/
+
-
 
+
-
[sbox-MaemoKernel: ~/maemo_kernel] > cd hello-module
+
-
[sbox-MaemoKernel: ~/maemo_kernel/hello-module] > ls -l
+
-
total 32
+
-
-rw-rw-r--  1 maemo maemo 17989 Aug 28 13:59 COPYING
+
-
-rw-rw-r--  1 maemo maemo  380 Aug 28 13:59 Makefile
+
-
-rw-rw-r--  1 maemo maemo  480 Aug 28 14:23 README
+
-
-rw-rw-r--  1 maemo maemo  640 Aug 28 13:59 hello.c
+
-
</pre>
+
-
The source code for the module is very simple:
+
<ol start=4>
 +
<li>Save the following code example as <code>hello.c</code> in the new folder:
<pre>
<pre>
-
[sbox-MaemoKernel: ~/maemo_kernel/hello-module] > cat hello.c
 
/* hello-module.c, an example kernel module */
/* hello-module.c, an example kernel module */
Line 188: Line 134:
module_exit(hello_exit);
module_exit(hello_exit);
</pre>
</pre>
-
 
+
</li>
-
Compiling kernel modules differs from compiling normal programs. That is reflected in the <code>Makefile</code>:
+
<li> Save the following code example as <code>Makefile</code><nowiki>: </nowiki>
-
 
+
<pre>
<pre>
-
[sbox-MaemoKernel: ~/maemo_kernel/hello-module] > cat Makefile
 
# Makefile for building the hello kernel module outside the kernel tree
# Makefile for building the hello kernel module outside the kernel tree
Line 201: Line 145:
# default build target (uses kernel build (kbuild) system)
# default build target (uses kernel build (kbuild) system)
all:
all:
-
$(MAKE) -C $(KERNELDIR) M=`pwd` EXTRAVERSION=-omap1 modules
+
$(MAKE) -C $(KERNELDIR) M=`pwd` EXTRAVERSION=-maemo2 modules
# target for cleaning up
# target for cleaning up
Line 207: Line 151:
$(RM) *.o .depend .*.cmd *.ko *.mod.c Module.symvers modules.order
$(RM) *.o .depend .*.cmd *.ko *.mod.c Module.symvers modules.order
$(RM) -R .tmp_versions
$(RM) -R .tmp_versions
-
</pre>
+
</pre></li>
-
The <code>all:</code> target compiles the module, not using this <code>Makefile</code>,
+
<li> Compile the module.
-
but a <code>Makefile</code> in the kernel headers folder set in variable
+
<pre>  
-
<code>KERNELDIR</code>. The <code>clean:</code> target is a regular target handled in this <code>Makefile</code>.
+
-
</li>
+
-
 
+
-
<li>Compile the module.
+
-
<pre>
+
[sbox-MaemoKernel: ~/maemo_kernel/hello-module] &gt; make
[sbox-MaemoKernel: ~/maemo_kernel/hello-module] &gt; make
make -C /usr/src/kernel-headers M=`pwd` modules
make -C /usr/src/kernel-headers M=`pwd` modules
Line 228: Line 167:
</pre></li>
</pre></li>
<li> Check the results.  
<li> Check the results.  
-
<pre>
+
<pre>  
[sbox-MaemoKernel: ~/maemo_kernel/hello-module] &gt; ls -l
[sbox-MaemoKernel: ~/maemo_kernel/hello-module] &gt; ls -l
total 148
total 148
Line 241: Line 180:
</pre></li>
</pre></li>
</ol>
</ol>
-
 
+
<br /><br /> File <code>hello.ko</code> is the new module. It can be installed by copying it to the device and running <br />
-
File <code>hello.ko</code> is the new module. Install it by copying it to the device and running it (as root)
+
  Nokia-NXX-31-10:/home/user# insmod hello.ko
  Nokia-NXX-31-10:/home/user# insmod hello.ko
-
and remove it by calling  
+
and removed by calling  
  Nokia-NXX-31-10:/home/user# rmmod hello.ko
  Nokia-NXX-31-10:/home/user# rmmod hello.ko
-
Check that the module worked properly by examining the kernel ring buffer:
+
<br />You can check that the module worked properly by examining the kernel ring buffer:
   
   
  Nokia-NXX-31-10:/home/user# dmesg | tail
  Nokia-NXX-31-10:/home/user# dmesg | tail
Line 254: Line 192:
  [11928.357696] Goodbye, world
  [11928.357696] Goodbye, world
-
If there is a slight version mismatch between SDK's kernel headers and the running kernel on device, <code>insmod</code> refuses to install the module with the error message <code>insmod: error inserting '<module>': -1 Invalid module format</code>. In this case, install the module by stripping version info from it before installation:
+
<br />If there is a slight version mismatch betweeen SDK's kernel headers and the running kernel on device, <code>insmod</code> refuses to install the module. In this case, you can install the module by stripping version info from it before installation:
   
   
-
  [sbox-FREMANTLE_ARMEL: ~/maemo_kernel/hello-module] &gt; objcopy --strip-debug \  
+
  [sbox-FREMANTLE_ARMEL: ~/maemo_kernel/hello-module] &gt; objcopy --strip-debug \
  -R .modinfo -R __versions hello.ko
  -R .modinfo -R __versions hello.ko
-
For more information on kernel modules, see the following:
+
<br /><br /> For additional reading on kernel modules, see, e.g.:
* [http://www.tldp.org/LDP/lkmpg/2.6/html/index.html The Linux Kernel Module Programming Guide]
* [http://www.tldp.org/LDP/lkmpg/2.6/html/index.html The Linux Kernel Module Programming Guide]
* <nowiki>/scratchbox/users/&lt;username&gt;/home/&lt;username&gt;/maemo_kernel/kernel-2.6.28/Documentation/kbuild/modules.txt</nowiki>
* <nowiki>/scratchbox/users/&lt;username&gt;/home/&lt;username&gt;/maemo_kernel/kernel-2.6.28/Documentation/kbuild/modules.txt</nowiki>
-
== Compiling Internal Kernel Modules ==
 
-
This section explains how to configure and compile additional kernel modules included in the kernel source tree for the Internet Tablet in the Maemo environment. The NFSD module is used as an example. In this section, the modules are compiled against the full kernel source tree, not the kernel headers package. This example compiles all configured modules at once.
 
-
<ul>
+
= Compiling Internal Kernel Modules =
-
<li>Go to your working directory with kernel sources.</li>
+
-
+
-
<li><pre>
+
-
[sbox-MaemoKernel:] > cd  ~/maemo_kernel/kernel-2.6.28
+
-
</pre></li>
+
-
<li> Edit the configuration file and define that the NFSD is a kernel module.</li>
+
This section explains how to configure and compile additional kernel modules included in the kernel source tree for the Internet Tablet in the maemo environment. NFSD module is used as an example. In this section, the modules are compiled against the full kernel source tree, not the kernel headers package. This example compiles all configured modules at once.
-
<li><pre>
+
* Go to your working directory with kernel sources. <br /><br />
-
[sbox-MaemoKernel: ~/maemo_kernel/kernel-2.6.28] > vi .config
+
-
</pre></li>
+
[sbox-MaemoKernel:]&gt; cd  ~/maemo_kernel/kernel-2.6.28
-
 
+
-
<li>Find the location of the NFSD configuration.</li>
+
-
 
+
-
<li><pre>
+
-
# CONFIG_NFSD is not set
+
-
</pre></li>
+
-
<li>Enable NFSD support as a module (m for module, Y for built-in).
+
* Edit the configuration file and define that the NFSD will be a kernel module. <br /><br />
   
   
-
<li><pre>
+
[sbox-MaemoKernel: ~/maemo_kernel/kernel-2.6.28] &gt; vi .config
-
CONFIG_NFSD=m
+
<br /><br /> Find the location of the NFSD configuration. <br /><br />
-
</pre></li>
+
<nowiki>
 +
# CONFIG_NFSD is not set
 +
</nowiki>
 +
<br /><br /> Enable NFSD support as a module (m for module, Y for built-in). <br /><br />
 +
 +
CONFIG_NFSD=m
-
<li>As described in the previous sections, refresh the configuration and build new modules.</li>
+
* As described in previous sections, refresh the configuration and build new modules. <br /><br />
 +
<nowiki>
 +
[sbox-MaemoKernel: ~/maemo_kernel/kernel-2.6.28] &gt; make EXTRAVERSION=-maemo2 oldconfig
 +
# lots of output here. Answer Y to NFSD_V3, default to others.
 +
[sbox-MaemoKernel: ~/maemo_kernel/kernel-2.6.28] &gt; make EXTRAVERSION=-maemo2 modules
 +
</nowiki>
-
<li><pre>
+
* Check with the find command to see what kernel object files (extension .ko) there now are. <br /><br />
-
[sbox-MaemoKernel: ~/maemo_kernel/kernel-2.6.28] > make EXTRAVERSION=-omap1 oldconfig
+
-
# lots of output here. Answer Y to NFSD_V3, default to others.
+
-
[sbox-MaemoKernel: ~/maemo_kernel/kernel-2.6.28] > make EXTRAVERSION=-omap1 modules
+
-
</pre></li>
+
-
 
+
-
<li>Check with the find command to see which kernel object files (extension .ko) now exist.</li>
+
   
   
-
<li><pre>
+
[sbox-MaemoKernel: ~/maemo_kernel/kernel-2.6.28] &gt; find . -name "*.ko" -ls
-
[sbox-MaemoKernel: ~/maemo_kernel/kernel-2.6.28] &gt; find . -name "*.ko" -ls
+
  655362  804 -rw-rw-r--  1 maemo maemo  817889 Aug  4 16:57 ./fs/ext2/ext2.ko
-
655362  804 -rw-rw-r--  1 maemo maemo  817889 Aug  4 16:57 ./fs/ext2/ext2.ko
+
  630786  108 -rw-rw-r--  1 maemo maemo  106187 Aug  4 16:57 ./fs/exportfs/exp
-
630786  108 -rw-rw-r--  1 maemo maemo  106187 Aug  4 16:57 ./fs/exportfs/exp
+
ortfs.ko
-
ortfs.ko
+
1335340  144 -rw-rw-r--  1 maemo maemo  141168 Aug  4 16:57 ./fs/fat/vfat.ko
-
1335340  144 -rw-rw-r--  1 maemo maemo  141168 Aug  4 16:57 ./fs/fat/vfat.ko
+
...
-
...
+
4595743 1328 -rw-rw-r--  1 maemo maemo  1354124 Aug  4 16:57 ./fs/nfsd/nfsd.ko
-
4595743 1328 -rw-rw-r--  1 maemo maemo  1354124 Aug  4 16:57 ./fs/nfsd/nfsd.ko
+
...
-
...
+
4074612  104 -rw-rw-r--  1 maemo maemo    98930 Aug  4 16:57 ./arch/arm/mach-o
-
4074612  104 -rw-rw-r--  1 maemo maemo    98930 Aug  4 16:57 ./arch/arm/mach-o
+
map2/dspbridge.ko
-
map2/dspbridge.ko
+
<br /><br /> The list of .ko files is will be quite long, depending on whether some additional changes were made to the .config file. Module nfsd.ko is the one just added.
-
</pre></li>
+
-
</ul>
+
-
The list of .ko files is quite long, depending on whether or not some additional changes were made to the .config file. Module <code>nfsd.ko</code> is the one just added.
+
The kernel modules are kept under <code>/lib/modules/</code>. However, the <code>insmod</code> command can be used to load the modules into the running kernel from any directory where they have been saved in.
-
The kernel modules are kept under <code>/lib/modules/</code>. However, the <code>insmod</code> command can be used to load the modules into the running kernel from any directory they have been saved in.
+
= Flashing Kernel =
-
== Using make menuconfig ==
+
The custom kernel can be flashed from outside the Scratchbox with the flasher tool via USB. <br />
-
'make menuconfig' fails to autodetect the ncurses library available in Scratchbox and exits with an error.  If you want to use 'make menuconfig', first edit <code>scripts/kconfig/lxdialog/check-lxdialog.sh</code> and change
+
<br />
-
<pre>
+
<nowiki>
-
# What library to link
+
  # flasher -f -k /scratchbox/users/&lt;username&gt;/home/&lt;username&gt;/\
-
ldflags()
+
-
{
+
-
for ext in so a dylib ; do
+
-
</pre>
+
-
 
+
-
to
+
-
 
+
-
<pre>
+
-
# What library to link
+
-
ldflags()
+
-
{
+
-
# XXX autodetection fails in scratchbox
+
-
echo -lncurses
+
-
exit
+
-
for ext in so a dylib ; do
+
-
</pre>
+
-
 
+
-
== Flashing Kernel ==
+
-
 
+
-
You can flash the custom kernel from outside Scratchbox with the flasher tool using USB.
+
-
 
+
-
  # flasher-3.5 -f -k /scratchbox/users/&lt;username&gt;/home/&lt;username&gt;/\
+
  maemo_kernel/kernel-2.6.28/arch/arm/boot/zImage
  maemo_kernel/kernel-2.6.28/arch/arm/boot/zImage
-
 
+
</nowiki>
-
== Testing kernel ==
+
-
 
+
-
It is possible to try the custom kernel without flashing it by temporarily changing arch/arm/plat-omap/bootreason.c as follows:
+
-
 
+
-
<pre>
+
-
// len += sprintf(page + len, "%s\n", boot_reason);
+
-
len += sprintf(page + len, "pwr_key\n");
+
-
</pre>
+
-
 
+
-
For the flasher tool, use
+
-
 
+
-
# flasher-3.5 -l -b -k /scratchbox/users/&lt;username&gt;/home/&lt;username&gt;/\
+
-
maemo_kernel/kernel-2.6.28/arch/arm/boot/zImage
+
-
 
+
-
[[Category:Development]]
+
-
[[Category:Documentation]]
+
-
[[Category:Fremantle]]
+

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)

Templates used on this page: