Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12455 Discussions

Where is the kernel header files for driver module?

Altera_Forum
Honored Contributor II
944 Views

Hi, 

I have a Arrow Cyclone V FPGASoC kit, and am studying the linux driver.  

In order to compile the driver for the platform, I need the kernel header files which matches the kernel version running on my board. I made the zImage of my board using the source here: 

https://github.com/altera-opensource/linux-socfpga/tree/socfpga-3.10-ltsi-rt  

and the result of 'uname -r' on my board is '3.10.31-ltsi-05151-gc8b20a4'. 

However, the source code lacks its header files, and /usr/src, which usually contains the header file, is almost empty. 

So where can I find the header files I need? 

Thanks so much~~~
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
191 Views

Please ignore the question in my post above. 

 

As far as I know, compiling driver for desktop linux requires kernel header files which are usually set under /usr/src, and with the same kernel version number; 

Compiling driver for embedded linux usually needs the linux source code direcory where you build your zImage for the board, not header files. 

 

In other words: 

(1) For desktop linux: make -C /usr/src/(header file directory) M=${PWD} modules; 

(2) For embedded linux: make ARCH=arm -C /linux-socfpga-ret-ltsi M=${PWD} modules; 

 

I have successfully compiled a simple driver for my Arrow SoC like this, but the difference are not sure. Could be that desktop linux is too large for you to have all source code; and embedded linux usually not that large so that you can work under its source code directory which already contains header files.
Reply