Cross compiling xillunux

Questions and discussions about the Xillybus IP core and drivers

Cross compiling xillunux

Postby Guest »

I wanted to include a driver in the kernel for which I have to recompile the kernel. As per the documentation, the source file is to be downloaded from github digilent page. Can I directly make changes to that kernel or should I apply some xillunux patches to it for it to work ?
Guest
 

Re: Cross compiling xillunux

Postby support »

Hello,

In order to compile a kernel module, I suggest relying on the kernel source headers that are already on Xillinux' file system. In fact, you can compile the module natively on the ARM processor running Xillinux. If you want to cross-compile the module on a PC, you can copy the entire directory, and compile your module against it.

However if you insist on compiling the kernel yourself, please refer to the README file in /usr/src/xillinux/, which outlines how to obtain the exact kernel used with Xillinux. It's very recommended to reconstruct the exact kernel, even though I wouldn't rule out the possibility that a kernel module that was compiled on a similar kernel would work anyhow.

Regards,
Eli
support
 
Posts: 802
Joined:

Re: Cross compiling xillunux

Postby rockstar92 »

eli wrote:Hello,

In order to compile a kernel module, I suggest relying on the kernel source headers that are already on Xillinux' file system. In fact, you can compile the module natively on the ARM processor running Xillinux. If you want to cross-compile the module on a PC, you can copy the entire directory, and compile your module against it.

However if you insist on compiling the kernel yourself, please refer to the README file in /usr/src/xillinux/, which outlines how to obtain the exact kernel used with Xillinux. It's very recommended to reconstruct the exact kernel, even though I wouldn't rule out the possibility that a kernel module that was compiled on a similar kernel would work anyhow.

Regards,
Eli

I think your idea of compiling on the board itself makes more sense. I am trying to install drivers based on instructions in this link, http://processors.wiki.ti.com/index.php ... ld_Scripts

I have to edit the setup-env file accordingly for xillinux.

So, it would be great if you could tell me what I should set the parameters, export TOOLCHAIN_PATH, export KERNEL_PATH and export KERNEL_VARIANT to in the setup-env file ?

Also, since I am not cross-compiling, I would set the following as:
export CROSS_COMPILE ?=
export ARCH=arm
[ "$TOOLCHAIN_PATH" != "DEFAULT" ] && export PATH=$TOOLCHAIN_PATH:$PATH
rockstar92
 
Posts: 4
Joined:

Re: Cross compiling xillunux

Postby support »

Hmmm... It seems like they are using non-standard compilation scripts. I can only make wild guesses on what these values should be. For example, there is probably no problem leaving ARCH as arm, but CROSS_COMPILE should probably be gcc or just empty.

For something better than wild guesses, I suggest looking closer at those scripts / makefiles.

It's a bit of trial and error. Given that the suite is intended for cross compilation, maybe copy the kernel headers from Xillinux' file system and cross-compile on the PC. Whatever is less of a headache.

Regards,
Eli
support
 
Posts: 802
Joined:

Re: Cross compiling xillunux

Postby rockstar92 »

eli wrote:Hmmm... It seems like they are using non-standard compilation scripts. I can only make wild guesses on what these values should be. For example, there is probably no problem leaving ARCH as arm, but CROSS_COMPILE should probably be gcc or just empty.

For something better than wild guesses, I suggest looking closer at those scripts / makefiles.

It's a bit of trial and error. Given that the suite is intended for cross compilation, maybe copy the kernel headers from Xillinux' file system and cross-compile on the PC. Whatever is less of a headache.

Regards,
Eli


Before doing this, i found out that I have enable wlcore_sdio in the kernel config file. So when I did cd /usr/src and typed in make menuconfig, i got an error. So, I downloaded the source git clone https://github.com/Digilent/linux-Digilent-Dev.git
And then went into this folder, and typed make menuconfig. I was able to change wlcore_sdio to a a module. After that i saved the file as .config. I typed in make, and its been 4 hours and its still compiling on the microzed.

So, i thought its better to cross compile on ubuntu system. So, I just download the sources from git clone https://github.com/Digilent/linux-Digilent-Dev.git and then enter into the folder and cross compile, right ? Am I missing anything here ?
Also, do i need to install any special tools for cross compilation ?
rockstar92
 
Posts: 4
Joined:

Re: Cross compiling xillunux

Postby rockstar92 »

rockstar92 wrote:
eli wrote:Hmmm... It seems like they are using non-standard compilation scripts. I can only make wild guesses on what these values should be. For example, there is probably no problem leaving ARCH as arm, but CROSS_COMPILE should probably be gcc or just empty.

For something better than wild guesses, I suggest looking closer at those scripts / makefiles.

It's a bit of trial and error. Given that the suite is intended for cross compilation, maybe copy the kernel headers from Xillinux' file system and cross-compile on the PC. Whatever is less of a headache.

Regards,
Eli


Before doing this, i found out that I have enable wlcore_sdio in the kernel config file. So when I did cd /usr/src and typed in make menuconfig, i got an error. So, I downloaded the source git clone https://github.com/Digilent/linux-Digilent-Dev.git
And then went into this folder, and typed make menuconfig. I was able to change wlcore_sdio to a a module. After that i saved the file as .config. I typed in make, and its been 4 hours and its still compiling on the microzed.

So, i thought its better to cross compile on ubuntu system. So, I just download the sources from git clone https://github.com/Digilent/linux-Digilent-Dev.git and then enter into the folder and cross compile, right ? Am I missing anything here ?
Also, do i need to install any special tools for cross compilation ?


SO, I managed to compile the kernel on the microzed in 8 hrs. But then I typed in make modules_install and make install
and rebooted. But still I'm not able to find the wlcodre_sdio which I enabled as a module in the kernel before compiling. When I type modprobe wlcore_sdio , it gives an error saying not found.

When go into the boot directory, i can find a new config file created called, config-3.12.0 in which I see WLCORE_SDIO=m. But there is this original configuration file (config-3.12.0-xillinux-1.3) in which the wlcore_sdio is not set. Also, there are initrd.img-3.12.0 and vmlinuz-3.12.0 files created in the boot directory.

Am I doing something wrong here ? Do i need to copy the vmlinuz-3.12.0 to the SD card or something ?
rockstar92
 
Posts: 4
Joined:

Re: Cross compiling xillunux

Postby rockstar92 »

rockstar92 wrote:
rockstar92 wrote:
eli wrote:Hmmm... It seems like they are using non-standard compilation scripts. I can only make wild guesses on what these values should be. For example, there is probably no problem leaving ARCH as arm, but CROSS_COMPILE should probably be gcc or just empty.

For something better than wild guesses, I suggest looking closer at those scripts / makefiles.

It's a bit of trial and error. Given that the suite is intended for cross compilation, maybe copy the kernel headers from Xillinux' file system and cross-compile on the PC. Whatever is less of a headache.

Regards,
Eli


Before doing this, i found out that I have enable wlcore_sdio in the kernel config file. So when I did cd /usr/src and typed in make menuconfig, i got an error. So, I downloaded the source git clone https://github.com/Digilent/linux-Digilent-Dev.git
And then went into this folder, and typed make menuconfig. I was able to change wlcore_sdio to a a module. After that i saved the file as .config. I typed in make, and its been 4 hours and its still compiling on the microzed.

So, i thought its better to cross compile on ubuntu system. So, I just download the sources from git clone https://github.com/Digilent/linux-Digilent-Dev.git and then enter into the folder and cross compile, right ? Am I missing anything here ?
Also, do i need to install any special tools for cross compilation ?


SO, I managed to compile the kernel on the microzed in 8 hrs. But then I typed in make modules_install and make install
and rebooted. But still I'm not able to find the wlcodre_sdio which I enabled as a module in the kernel before compiling. When I type modprobe wlcore_sdio , it gives an error saying not found.

When go into the boot directory, i can find a new config file created called, config-3.12.0 in which I see WLCORE_SDIO=m. But there is this original configuration file (config-3.12.0-xillinux-1.3) in which the wlcore_sdio is not set. Also, there are initrd.img-3.12.0 and vmlinuz-3.12.0 files created in the boot directory.

Am I doing something wrong here ? Do i need to copy the vmlinuz-3.12.0 to the SD card or something ?


Eli, here is how I did it.
Maybe its a hack. Dont know if its right or wrong.
I had downloaded the diiglent source files from github for xillinux and done the compilation using these source files on the microzed itslef. Then did makemodules_install and make install. It created a zImage in the /arc/arm/boot folder. I went into that folder, typed make UIMAGE_LOADADDR=0x8000 uImage and I generated the uImage. Copied it to the sd card primary partition and booted. I was able to do modprobe wlcore_sdio.
What do you think of this method ?

Now, when I type uname -a, the output is
Linux 127.0.0.1 localhost.localdomain localhost 3.12.0 #1 SMP PREEMPT Sun Nov 22 17:05:34 EST 2015 armv7l armv7l armv7l GNU/Linux
rockstar92
 
Posts: 4
Joined:

Re: Cross compiling xillunux

Postby support »

Hi,

Well, in general, if the kernel is up and running, you probably got it right. Even though cross compilation would have been significantly faster.

I should mention, that Linux on an ARM processor is a very common combination, so you can find lots of information about cross compilation and deployment from other sources on the web. This forum is not the optimal place to get help in this field.

Regards,
Eli
support
 
Posts: 802
Joined:


Return to Xillybus