Hi Everyone,
Sorry for the delay in posting this, but here is step 4a which is building the stock Linux kernel. We’ll do the stock Linux kernel first and then move on to the root filesystem, then we’ll come back and build the Xenomai variant for all those who want a real time embedded system. I’ll add some more pictures to this once I’ve gotten some more time, which is hopefully soon.
Let’s get the Linux kernel source from the Xilinx repo. Clone the repo:
git clone https://github.com/Xilinx/linux-xlnx.git
This may take a while if you have a slow connection, but once it’s sync’d you now have the Linux kernel source. If you take a look at the directory in the kernel source <path to kernel source>/arch/arm/configs, we should see all the different configurations we can build. We are interested in the Zynq ones, we’ll use the xilinx_zynq_defconfig. Make sure we have exported our CROSS_COMPILER environment variable:
exoport CROSS_COMPILER=arm-xilinx-linux-gnueabi-
Just like when we built u-boot make sure we have the cross compiler in our PATH variable. Once we’ve done that, we can go ahead and start to compile the kernel, let’s first make sure we have a clean build environment:
make mrproper
let’s configure the kernel to build for zynq:
make ARCH=arm xilinx_zynq_defconfig
If we wanted to build in any custom options we can now run
make ARCH=arm menuconfig
This will run the menuconfig utility and allow us to customize the kernel components we want to build. If you do run that make sure you’ve saved your changes and once your done run:
make ARCH=arm UIMAGE_LOADADDR=0x8000 uImage
The build should take about 5-10 minutes and once we’re complete we should be able to find the image in linux-xlnx/arch/arm/boot/.
The build may fail if you don’t have mkimage installed so depending on your distro do some searching and find what package you need to install.
So we still have two more steps to complete before we can put this on the sdcard and boot the Zybo. We need to build a root filesystem and compile the device tree binary blob. The Linux device tree is extremely interesting and is the way the kernel knows what hardware is present in the system. It’s worth the time to read up about the Linux device tree, especially if you may be building your own custom board.
If you’d rather build from mainline then check out my post here on how to do that.
Helpful Links:
http://www.wiki.xilinx.com/Build+Kernel
Hello,
Thanks so much for the tutorial. I have some problems with the device tree.I’m looking forward to seeing the next step.
Thanks for your tutorial so far! I’m really looking forward for the next part.
Your tutorial gives a very nice starting point for the Zybo. I’m really interested in more. Thanks a lot! -RM
I tried to build kernel for zybo and could not find the zynq-zybo.dts source anywhere on the Digilent or Xilinx git sites. I found friendly hacker on the web, I think he was in Japan who had a link to download from his site. I succesfully compiled the linux-xlnx from xilinx web git and assembled the sd boot partition using the devicetree.dtb generated from zynq-zybo.dts which is compatible with the xilinx linux kernel. I also use the uramdisk.image.gz (it has busybox linux system) from xilinx website. Accidentaly the second partition on the sd card had the debian root filing system as a leftover from my BeagleBoneBlack experiments. I was able to chroot from ZYBO to the debian partition and run the debian successfuly on ZYBO. I have posted the devicetree on “sourceforge.net” just search for zybo there or get “http://sourceforge.net/p/zynqzybodts/files”
Have finishde patched Xenomai?I am very expecting it.
should be up in the next few weeks
Are you still working on this? It appears to end at Step 4a …
I’ll have devicetree and Xenomai steps coming soon
Hi there ! Great blog! The tutorials are very helpful. I’m trying something similar on the ZYBO. Waiting for you next post .
Hi Greg,
I really liked your blog, but I’m impatiently waiting for the next part. Any updates?
updates are on the way
Hi Greg,
Which version of Xilinx tool chain did you use for this tutorial?
How will the instructions change for 2016.x or later?
I used the Linaro toolchain, you may need to change the CROSS_COMPILE prefix to arm-xilinx-linux-gnueabihf- depending on what the xilinx toolchain is prefix with now. I believe as of 2017 they have moved to use the Linaro toolchains.