Develop Your Kernel

Customize your kernel to your specific project using Xilinx's linux-xlnx

Before you start

Developing your own kernel takes about 1GB of disk space. Please make sure you have enough storage before continuing.

We recommend you make a directory on your computer for keeping all of the files together. Maintaining an isolated kernel development environment if you are pursing kernel customization is highly encourage. For example, start by making this separate directory:

mkdir ocpoc_kernel_dev
cd ocpoc_kernel_dev
sudo apt-get update
sudo apt-get install git u-boot-tools lib32ncurses5-dev

Download Linux-Xlnx:

We generate our kernel using linux-xlnx kernel provided by Xilinx to support Zynq Based boards. You can download this environment by cloning their git repository.

git clone https://github.com/Xilinx/linux-xlnx.git

Download OcPoC files:

If you have not downloaded the OcPoC Zynq Mini files previously you can acquire them by cloning our git repository.

git clone https://github.com/aerotenna/ocpoc_mini_zynq_files.git

Copy OcPoC Configuration:

Now we will have to inject the OcPoC Zynq's specifics into Xilinx's linux-xlnx. Below is an example that would work if you downloaded the two git repositories in the same directory. If you are following our recommendations and keeping these files in one directory, open a terminal in that directory and execute the following command:

cp ocpoc_mini_zynq_files/Kernel_Config/ocpoc_defconfig linux-xlnx/arch/arm/configs

Setup Build Environment:

Next you will change to the Xilinx 2015.4 build, utilize the Xilinx 2016.2 i2c drivers, and load the ocpoc configuration. From the same terminal, in the same directory execute the following commands:

cd linux-xlnx
git checkout xilinx-v2015.4
git checkout xilinx-v2016.2 -- drivers/i2c/busses/i2c-xiic.c
make ARCH=arm ocpoc_defconfig

You are now ready to build a kernel to suit your specific needs!

Customizing the Kernel

From here you are free to test whatever your heart may desire. The majority of your default options will be made available with the menuconfig command.

make ARCH=arm menuconfig

Beyond this, you now have the proper environment configured for installing your own custom kernel modules and device drivers. Once you are satisfied and ready to produce the kernel itself you can package everything up with the following command.

make ARCH=arm UIMAGE_LOADADDR=0x8000 uImage

This may take some time to complete, especially if it is your first compilation of the kernel. Once it is completed successfully, the uImage will be in 'linux-xlnx/arch/arm/boot' directory