UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Reply

Petalinux loadable Kernel Module Tutorial

Participant
Posts: 35
Registered: ‎09-02-2014

Petalinux loadable Kernel Module Tutorial

Hi,

is there any good tutorial about a loadable kernel modul for zynq devices?

I know that petalinux has a "create loadable kernel module" function but i didnt found any dokumentation or tutorial about it which helps me.

I just want to get datas from a custom ip core on the pl.

I know thats a basic question but i stuck here at the moment.

 

 

Scholar
Posts: 1,536
Registered: ‎09-10-2008

Re: Petalinux loadable Kernel Module Tutorial

Hi,

Most of what you're asking is an intro to Linux kernel development. Petalinux does provide a command to help you start building a kernel module. (petalinux-create -t modules -n test --enable)

I would recommend getting a good Embedded Linux book such as Embedded Linux Primer or Building Embedded Linux Systems or even going thru some of Free Electrons PDFs to get started.

free-electrons.com/docs/kernel/

I also posted some PDFs that could be helpful for drivers in this thread.

http://forums.xilinx.com/t5/Embedded-Linux/mmap-problems-device-tree-problem/m-p/523043/highlight/true#M10655

Thanks
John
Participant
Posts: 35
Registered: ‎09-02-2014

Re: Petalinux loadable Kernel Module Tutorial

I´m very new to linux/kernel and the stuff, so i think its a little bit to complicated for me at the moment to make my custom kernel modul.

Are there any other ways (easyer ways) to provide a fast interface between linux and the fpga?

I know that /dev/mem is very easy but its not able to handle interrupts.

I dont want to get an kernel expert is just want to use it. For Standalone Applications there are lots of drivers why not so for linux?

 

 

 

Scholar
Posts: 1,536
Registered: ‎09-10-2008

Re: Petalinux loadable Kernel Module Tutorial

You might consider using UIO as others with less kernel knowledge do that and it does handle interrupts, although not as well as a kernel module.  It's nearly the same as /dev/mem with regards to the amount of work but does provide better infrastructure to do what need.

 

http://lwn.net/Articles/232575/

http://blackfin.uclinux.org/doku.php?id=auto_generated_kernel_docs:uio-howto

 

I posted some stuff to this thread about UIO in the past.

 

http://forums.xilinx.com/t5/Embedded-Linux/mmap-problems-device-tree-problem/m-p/523043/highlight/true#M10655

 

With regards to Linux there are a good number of drivers and almost a matching one for each standalone driver. Linux (like all OSes) is a bit different in that the OS provides lots of frameworks which the developer needs to understand and use.  What gaps are you seeing that we need to fill?

 

Thanks

John