Skip to contentSkip to conversation

Load Address and EntryPoint for Kernel

Buildroot Carsten Schoenert 2 participants 5 messages Oct 28, 2012 – Nov 16, 2012

lore
Share & tools
lore
#0 lore raw

Hello,

I have successful created up my own config of buildroot to build a basic filesystem for an ARM Target. Buildroot does everything without any errors. To start with a low barrier I just selected support for U-Boot, the kernel and a simple standard filesystem.

Now I have tried to start the builded kernel via U-Boot that's already on the target. The tftpload works correct an I started the kernel.

Quoted 18 lines

HDx> tftpboot 192.168.136.4:ubi/uImage
TFTP from server 192.168.136.4; our IP address is 192.168.136.10 Filename 'ubi/uImage'.
Load address: 0xe000000
Loading: #################################################################

         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #####################

done
T Bytes transferred = 2101868 (20126c hex) HDx> bootm 0xe000000
## Booting kernel from Legacy Image at 0e000000 ...

   Image Name:   Linux-2.6.34.13-nevis
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2101804 Bytes =  2 MB
Quoted 8 lines

Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK

Starting kernel ...

But more is not to see. The original kernel from the manufacture looks like this.

Quoted 7 lines

## Booting kernel from Legacy Image at f0080000 ...

   Image Name:   Coolstream HDx Kernel
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2116856 Bytes =  2 MB

Load Address: 00048000
Entry Point: 00048000
Verifying Checksum ... OK

As I can see the Load Address and the Entry Point is a little bit, but significant :) different.

I have search the point there I can change this while mkimage is called to generate the uImage but haven't found the correct point for this.

Can someone give me a hint?
Thx

Carsten

#1 lore raw

Dear Carsten Schoenert,

Quoted 4 lines · Carsten Schoenert

I have search the point there I can change this while mkimage is called to generate the uImage but haven't found the correct point for this.

Can someone give me a hint?

Most likely your kernel configuration is wrong.

Please post your Buildroot .config and kernel .config file and more details about what your hardware platform is.

Thanks,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#2 lore raw

Hello Thomas,

Am 28.10.2012 17:43, schrieb Thomas Petazzoni:

Quoted 1 line

Most likely your kernel configuration is wrong.

Hopefully I have taken the complete one from the original ... :/ This complete git repo can be found here.
http://git.coolstreamtech.de/?p=cst-public-linux-kernel.git;a=shortlog;h=refs/heads/2.6.34.13-cnxt

The related kernel patches I placed under board/coolstream/hdx/kernel-2.6.34-patches
The config right in board/coolstream/hdx/kernel2.6.34.13.config

Quoted 2 lines

Please post your Buildroot .config and kernel .config file and more details about what your hardware platform is.

The platform is a ARMv6 based Settopbox with a SoC from Nexperia (cx2450). There are closed kernel modules that have to be used, so most parts of the kernel config depended on this, but some options are configurable without to recompile this closed source parts.

I configured BR to build a GCC 4.7.1 with crosstool-ng, after some fine tuning this works.

My BR config looks like this.

Quoted 14 lines

carsten at wheezy:~/gitprojects/buildroot [arm] $ cat configs/cst_hdx_2.6.34.13_defconfig BR2_arm=y
BR2_CCACHE=y
BR2_TOOLCHAIN_CTNG=y
BR2_TOOLCHAIN_CTNG_eglibc=y BR2_TOOLCHAIN_CTNG_CONFIG="board/coolstream/hdx/ct_ng_config" BR2_TOOLCHAIN_CTNG_CXX=y BR2_PACKAGE_BUSYBOX_CONFIG="board/coolstream/hdx/busybox-1.20.2.config" BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
BR2_PACKAGE_AUTOMAKE=y
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BOARDNAME="coolstream_hdx"
BR2_TARGET_UBOOT_CUSTOM_TARBALL=y BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="http://ftp.denx.de/pub/u-boot/u-boot-2009.03.tar.bz2"

Quoted 8 lines

BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="board/coolstream/hdx/u-boot"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="http://www.kernel.org/pub/linux/kernel/v2.6/longterm/v2.6.34/linux-2.6.34.13.tar.bz2" BR2_LINUX_KERNEL_PATCH="board/coolstream/hdx/linux-2.6.34-patches"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/coolstream/hdx/kernel-2.6.34.13.config" BR2_LINUX_KERNEL_INSTALL_TARGET=y

The kernel config is appended.

If something is missing then just let me know.

Thanks in advice!

Carsten
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kernel-2.6.34.13.config.gz
Type: application/x-gzip
Size: 10764 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20121028/cbca394a/attachment-0001.bin>

#3 lore raw

Dear Carsten Schoenert,

Quoted 7 lines · Carsten Schoenert

Hopefully I have taken the complete one from the original ... :/ This complete git repo can be found here.
http://git.coolstreamtech.de/?p=cst-public-linux-kernel.git;a=shortlog;h=refs/heads/2.6.34.13-cnxt

The related kernel patches I placed under board/coolstream/hdx/kernel-2.6.34-patches
The config right in board/coolstream/hdx/kernel2.6.34.13.config

The kernel sources clearly indicate that the entry point should be 0x48000. So it seems like your patches haven't been applied, or your kernel has been badly configured, or something like that.

Quoted 35 lines
Quoted 2 lines

Please post your Buildroot .config and kernel .config file and more details about what your hardware platform is.

The platform is a ARMv6 based Settopbox with a SoC from Nexperia (cx2450). There are closed kernel modules that have to be used, so most parts of the kernel config depended on this, but some options are configurable without to recompile this closed source parts.

I configured BR to build a GCC 4.7.1 with crosstool-ng, after some fine tuning this works.

My BR config looks like this.

Quoted 14 lines

carsten at wheezy:~/gitprojects/buildroot [arm] $ cat configs/cst_hdx_2.6.34.13_defconfig BR2_arm=y
BR2_CCACHE=y
BR2_TOOLCHAIN_CTNG=y
BR2_TOOLCHAIN_CTNG_eglibc=y BR2_TOOLCHAIN_CTNG_CONFIG="board/coolstream/hdx/ct_ng_config" BR2_TOOLCHAIN_CTNG_CXX=y BR2_PACKAGE_BUSYBOX_CONFIG="board/coolstream/hdx/busybox-1.20.2.config" BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
BR2_PACKAGE_AUTOMAKE=y
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BOARDNAME="coolstream_hdx"
BR2_TARGET_UBOOT_CUSTOM_TARBALL=y BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="http://ftp.denx.de/pub/u-boot/u-boot-2009.03.tar.bz2"

Quoted 8 lines

BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR="board/coolstream/hdx/u-boot"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="http://www.kernel.org/pub/linux/kernel/v2.6/longterm/v2.6.34/linux-2.6.34.13.tar.bz2" BR2_LINUX_KERNEL_PATCH="board/coolstream/hdx/linux-2.6.34-patches"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/coolstream/hdx/kernel-2.6.34.13.config" BR2_LINUX_KERNEL_INSTALL_TARGET=y

Quoted 3 lines

The kernel config is appended.

If something is missing then just let me know.

Either pastebin the entire build log (from scratch), or post all the patches and configuration files needed to produce the problem.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#4 lore raw

Hello Thomas,

Am 28.10.2012 21:21, schrieb Thomas Petazzoni:

Quoted 3 lines

The kernel sources clearly indicate that the entry point should be 0x48000. So it seems like your patches haven't been applied, or your kernel has been badly configured, or something like that.

after some time I have found the issue. You are right, at a deeper look I was able to see that I have made a misspelled naming of my patches. The patches all missing the 'linux-' prefix. :)
After I have corrected this the correct address was shown while the kernel build.

Quoted 10 lines

OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
UIMAGE arch/arm/boot/uImage

Image Name:   Linux-2.6.34.13-nevis
Created:      Fri Nov 16 21:26:38 2012
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    2131444 Bytes = 2081.49 kB = 2.03 MB
Load Address: 00048000
Entry Point:  00048000

Image arch/arm/boot/uImage is ready

And after all the kernel is excellent booting on the STB.

Quoted 39 lines

Hit any key to stop autoboot: 0
HDx> tftpboot ubi/uImage
TFTP from server 192.168.136.4; our IP address is 192.168.136.10 Filename 'ubi/uImage'.
Load address: 0xe000000
Loading: #################################################################

         #################################################################                                                                                                                                                       
         ################                                                                                                                                                                                                        

done
T Bytes transferred = 2131508 (208634 hex) HDx> bootm 0xe000000
## Booting kernel from Legacy Image at 0e000000 ...

   Image Name:   Linux-2.6.34.13-nevis                                                                                                                                                                                           
   Image Type:   ARM Linux Kernel Image (uncompressed)                                                                                                                                                                           
   Data Size:    2131444 Bytes =  2 MB                                                                                                                                                                                           

Load Address: 00048000
Entry Point: 00048000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

[    0.000000] Linux version 2.6.34.13-nevis (carsten at wheezy) (gcc version 4.7.1 (crosstool-NG 1.16.0 - buildroot 2012.08-00015-g0256ea5) ) #1 Fri Nov 16 21:26:33 CET 2012                                                      
[    0.000000] CPU: ARMv6-compatible processor [410fb764] revision 4 (ARMv7), cr=00c5387f                                                                                                                                        
[    0.000000] CPU: VIPT aliasing data cache, VIPT aliasing instruction cache                                                                                                                                                    
[    0.000000] Machine: CoolStream HDx IRD                                                                                                                                                                                       
[    0.000000] Memory policy: ECC disabled, Data cache writeback                                                                                                                                                                 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 97536                                                                                                                                        
[    0.000000] Kernel command line: console=ttyRI0 mtdparts=cx2450xflash:384k(U-Boot),128k(Splash),4096k(kernel),28160k(systemFS) root=mtd3 rootfstype=jffs2 rw mem=384M                                                         
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)                                                                                                                                                               
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)                                                                                                                                                   
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)                                                                                                                                                    
[    0.000000] Memory: 384MB = 384MB total                                                                                                                                                                                       
[    0.000000] Memory: 385404k/385404k available, 7812k reserved, 0K highmem                                                                                                                                                     
[    0.000000] Virtual kernel memory layout:                                                                                                                                                                                     
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)                                                                                                                                                                 
[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)                                                                                                                                                                 
Quoted 8 lines
[    0.000000]     DMA     : 0xffc00000 - 0xffe00000   (   2 MB)                                                                                                                                                                 
[    0.000000]     vmalloc : 0x98800000 - 0xe0000000   (1144 MB)                                                                                                                                                                 
[    0.000000]     lowmem  : 0x80000000 - 0x98000000   ( 384 MB)                                                                                                                                                                 
[    0.000000]     modules : 0x7e800000 - 0x80000000   (  24 MB)                                                                                                                                                                 
[    0.000000]       .init : 0x80048000 - 0x80062000   ( 104 kB)                                                                                                                                                                 
[    0.000000]       .text : 0x80062000 - 0x80424000   (3848 kB)                                                                                                                                                                 
[    0.000000]       .data : 0x80424000 - 0x80441900   ( 119 kB)                                                                                                                                                                 
[    0.000000] NR_IRQS:352

Thanks for your help!

Regards
Carsten