Difference between revisions of "Talk:Step-by-step Native Compiling a Kernel"

From odroid US
Jump to: navigation, search
 
(4 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
[http://odroid.foros-phpbb.com/t2216-video-capture#16851 http://odroid.foros-phpbb.com/t2216-video-capture#16851]
 
[http://odroid.foros-phpbb.com/t2216-video-capture#16851 http://odroid.foros-phpbb.com/t2216-video-capture#16851]
  
 
+
This is mdrjr post for quick reference:
 
<pre>
 
<pre>
  
Line 30: Line 30:
 
enjoy  
 
enjoy  
 
</pre>
 
</pre>
 +
 +
Here is the magic for hardfloat kernel build:
 +
<pre>
 +
Update: When doing a local build you should specify that you want a hardfloat kernel. This will allow Linux access to the floating point hardware
 +
which it will use for additional registers when calling library routines. That will give a nice boost to performance
 +
To make it easy to recall the options I stick the environment variables in a shell script in /usr/local/bin. You could also place it in /etc/bash.bashrc if you do not mind it
 +
always being set.
 +
 +
# cat /usr/local/bin/kernel_build_opts.sh
 +
export CFLAGS="-O2 -pipe -mfpu=neon -mcpu=armv7l -mfloat-abi=hard"
 +
export CXXFLAGS="${CFLAGS}"
 +
 +
To execute it: . /usr/local/bin/kernel_build_opts.sh
 +
(note: there is a DOT in front of the shell script invocation followed by a space, that will export the flags to the parent shell)
 +
</pre>
 +
 +
Here is a link to mlinuxguy post on forum: [http://odroid.foros-phpbb.com/t1504-building-your-own-custom-linux-kernel-for-odroid-x-howto http://odroid.foros-phpbb.com/t1504-building-your-own-custom-linux-kernel-for-odroid-x-howto]
 +
 +
 +
Here is what I see: (readelf -A)
 +
File: ./arch/arm/vfp/vfp.o
 +
Attribute Section: aeabi
 +
File Attributes
 +
  Tag_CPU_name: "7-A"
 +
  Tag_CPU_arch: v7
 +
  Tag_CPU_arch_profile: Application
 +
  Tag_ARM_ISA_use: Yes
 +
  Tag_THUMB_ISA_use: Thumb-2
 +
  Tag_FP_arch: VFPv3
 +
  Tag_Advanced_SIMD_arch: NEONv1
 +
  Tag_ABI_PCS_wchar_t: 4
 +
  Tag_ABI_FP_number_model: Finite
 +
  Tag_ABI_align_needed: 8-byte
 +
  Tag_ABI_enum_size: int
 +
  Tag_ABI_optimization_goals: Aggressive Speed
 +
  Tag_CPU_unaligned_access: v6
 +
  Tag_DIV_use: Not allowed
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
Link to raspi kernel build info:
 +
http://elinux.org/RPi_Kernel_Compilation

Latest revision as of 21:18, 18 February 2013


  1. note a 'large' initrd is created. Probably a feature-bloated busybox


Here is a forum link to kernel building: http://odroid.foros-phpbb.com/t2216-video-capture#16851

This is mdrjr post for quick reference:


git clone --depth 1 git://github.com/hardkernel/linux.git -b odroid-3.0.y kernel-source
cd kernel-source

make odroidu2_ubuntu_mali_defconfig <- if you want to have 3D enabled
or
make odroidu2_ubuntu_defconfig <- if you don't care about 3D

make menuconfig

go around on the menus, searching for l2tp or things that are used on the IPSeC to add it. When you done..


make -j5 zImage modules
make modules_install
cp arch/arch/boot/zImage /media/boot

sync && reboot

enjoy 

Here is the magic for hardfloat kernel build:

Update: When doing a local build you should specify that you want a hardfloat kernel. This will allow Linux access to the floating point hardware
which it will use for additional registers when calling library routines. That will give a nice boost to performance
To make it easy to recall the options I stick the environment variables in a shell script in /usr/local/bin. You could also place it in /etc/bash.bashrc if you do not mind it
always being set.

# cat /usr/local/bin/kernel_build_opts.sh
export CFLAGS="-O2 -pipe -mfpu=neon -mcpu=armv7l -mfloat-abi=hard"
export CXXFLAGS="${CFLAGS}"

To execute it: . /usr/local/bin/kernel_build_opts.sh
(note: there is a DOT in front of the shell script invocation followed by a space, that will export the flags to the parent shell)

Here is a link to mlinuxguy post on forum: http://odroid.foros-phpbb.com/t1504-building-your-own-custom-linux-kernel-for-odroid-x-howto


Here is what I see: (readelf -A) File: ./arch/arm/vfp/vfp.o Attribute Section: aeabi File Attributes

 Tag_CPU_name: "7-A"
 Tag_CPU_arch: v7
 Tag_CPU_arch_profile: Application
 Tag_ARM_ISA_use: Yes
 Tag_THUMB_ISA_use: Thumb-2
 Tag_FP_arch: VFPv3
 Tag_Advanced_SIMD_arch: NEONv1
 Tag_ABI_PCS_wchar_t: 4
 Tag_ABI_FP_number_model: Finite
 Tag_ABI_align_needed: 8-byte
 Tag_ABI_enum_size: int
 Tag_ABI_optimization_goals: Aggressive Speed
 Tag_CPU_unaligned_access: v6
 Tag_DIV_use: Not allowed






Link to raspi kernel build info: http://elinux.org/RPi_Kernel_Compilation