1
votes

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?

1
What driver are you referring to? Did you follow instructions accompanying said driver?t0mm13b
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
Perhaps try compiling it as built-in to the kernel instead?t0mm13b
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
By built in, make the module part of it, i.e, hit 'y' key instead of 'm' for module.t0mm13b

1 Answers

2
votes

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