1

I am trying to include a driver for use on my arch linux arm machine. I tried using these steps to include the driver module, but my cross-compiled kernel with the added driver doesn't load.

1) Include the driver I want to add by making it have < M > beside it's 
   name in make ARCH=arm menuconfig

2) run: make ARCH=arm CROSS_COMPILE=/home/z3/bin/arm-   (the path for my cross-compiling toolchain)

3) run: make ARCH=arm CROSS_COMPILE=/home/z3/bin/arm- modules

4) run: make ARCH=arm CROSS_COMPILE=/home/z3/bin/arm- install

5) run: make ARCH=arm CROSS_COMPILE=/home/z3/bin/arm- modules_install

6) copy my uImage from: arch/arm/boot 
   to my boot location: /tftpboot/

Then when my embedded linux arm tries to load the kernel uImage, it hangs with: EDIT: Changed the entry point address to 80008000, so now it hangs with:

Filename '/tftpboot/uImage'.                                                    
Load address: 0x81800000                                                        
Loading: #################################################################      
         #################################################################      
         #################################################################      
         #################################################################      
         #################################################################      
         #################################################################      
         #################################################################      
         #################################################################      
         #################################################################      
         ####################################                                   
done                                                                            

Bytes transferred = 3174848 (3071c0 hex)

Booting kernel from Legacy Image at 81800000 ...

Image Name: 2.6.35-ModifiedEntry
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3174784 Bytes = 3 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK

Starting kernel ...

Am I cross-compiling my kernel wrong? It cannot load the uImage. All I want to do is cross compile my kernel for the linux arm machine with a newly included driver (included in the config from make menuconfig). Am I missing any additional steps?

user3215598
  • 103
  • 1
  • 3
  • 9
  • 1
    What driver are you referring to? Did you follow instructions accompanying said driver? – t0mm13b Jan 21 '14 at 18:51
  • The driver is the FTDI Single Port Serial Driver. It's included with the linux kernel but wasn't enabled, so I had to enable it in make menuconfig. There aren't any instructions accompanying this driver, so I tried to include it when building the kernel by "modularizing" (M) it in menuconfig, then building modules via make modules and make modules_install. But I think there's something wrong with how the kernel built as my linux arm cannot load the uImage. – user3215598 Jan 21 '14 at 18:58
  • Perhaps try compiling it as built-in to the kernel instead? – t0mm13b Jan 21 '14 at 19:00
  • By built-in to the kernel, do you mean that I don't have to re-compile the entire kernel itself, but only make the modules? I'm new to compiling kernels/modules, how would I do this? – user3215598 Jan 21 '14 at 19:02
  • By built in, make the module part of it, i.e, hit 'y' key instead of 'm' for module. – t0mm13b Jan 21 '14 at 19:09
  • What board are you building this for? **What address does physical memory start at?** Is it really **0x0** (as configured for your current build that fails to "load")? – sawdust Jan 21 '14 at 19:42
  • @sawdust I'm not entirely sure what board it is. How can I check? And I changed the entry address to 80008000 (fixed that part to what it should actually be), but now it hangs at: "Starting Kernel..." – user3215598 Jan 21 '14 at 19:54
  • Usually the next step that the kernel will perform is to self-extract (uncompress) the Image file from the zImage file. Freescale SoCs can fail during this step if the machine ID is not properly setup; see [this question](http://stackoverflow.com/questions/18378563/how-do-i-find-arm-linux-entry-point-when-it-fails-to-uncompress/18392238). Otherwise uncompression failures are often load address problems. *"I'm not entirely sure what board it is."* -- Then how did you configure and build the kernel??? You should have specified a board config file in order to build the kernel. – sawdust Jan 21 '14 at 21:10
  • Sorry, I'm really new to building kernels. Where is the board config file? – user3215598 Jan 21 '14 at 21:20
  • *"Where is the board config file?"* -- Normal procedure for building a kernel is to first configure the kernel build environment using the command `make my_defconfig`, where *my_defconfig* is a machine config filename (and assuming ARCH and CROSS_COMPILE are in your environment). For ARM [the defconfig files are here](http://lxr.free-electrons.com/source/arch/arm/configs/?v=2.6.35;a=arm) Then you can do a `make menuconfig` and a `make`. Maybe you should do a `make distclean` and start over – sawdust Jan 22 '14 at 02:44

1 Answers1

2

You have done two mistake in kernel building procedure.

1)before make menuconfig

you need to have a .config file should exit in source-code.

How u can get it

1) make ARCH=arm board_defconfig

check your default config in /arch/arm/configs

e.g make ARCH=arm versatile_defconfig

this will write default configuration to .config

2)if you dont know your default configuration you can get it in target board Filesystem.

it will be in /proc/config.gz copy to your host untar it and copy as .config in top source-code. or it may present in /boot/config.x.x.x

if dont follow above step make ARCH=arm menuconfig this will copy host x86 config file from /boot/config-x.x.x which will be wrong config file

Once above step is done then next step make ARCH=arm menuconfig here enable your driver.

2nd mistake is make ARCH=arm CROSS_COMPILE=/home/z3/bin/arm- modules_install

This will install modules in /lib/modules of x86 host machine.

so follow below one

make ARCH=arm CROSS_COMPILE=(path to arm) uImage modules

create a directory to install your dynamic loadable modules

make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- modules_install INSTALL_MOD_PATH=<path to install modules>

Then you need to copy modules to your target.

For more details you can refer this Just black screen after running Qemu

Community
  • 1
  • 1
vinay hunachyal
  • 3,781
  • 2
  • 20
  • 31