cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
8,675 Views
Registered: ‎07-08-2008

How to use a Linux driver? (beginners)

Hi,

 

I'm working with open source Embedded Linux from Xilinx Wikidot. I'm using xapp1129 project as my reference design. I have already been able to load this project over my board (ML507). Now I want to write a user application to control the pcore (locallink example core) through the given driver.

 

Could anyone tell me how to use a Linux driver? It would be nice if someone could show me a simple code example.

 

P.S. I have been reading about the GPIO driver and the user application from Wikidot but I get confused since the user application doesn't use the GPIO functions that appears in xilinx_GPIO.c located in the Linux tree.

 

Thank you.

0 Kudos
4 Replies
Highlighted
Anonymous
Not applicable
8,659 Views

Check out some of the other drivers in the kernel soruces for examples, and pick up a good book as well..  "Linux Device Drivers, 3rd Edition" is a good one that is available online as well.
0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
8,651 Views
Registered: ‎04-23-2008

Linux drivers are accessed by user applications through the file system. Special files in the /dev directory are opened/accessed by the application. Ordiary file IO operations (open, close, read, write) result in the driver code being called.

 

I'd recommend

Linux Device Drivers, Corebet, Rubini, Kroah-Hartman, O'Reilly Press

Linux Kernel Development,  Robert Love, Novell Press

 

-Brian

0 Kudos
Highlighted
Contributor
Contributor
8,636 Views
Registered: ‎07-08-2008


toneal wrote:
Check out some of the other drivers in the kernel soruces for examples

Where can I find them? In some path of the Linux kernel?

0 Kudos
Highlighted
Anonymous
Not applicable
8,628 Views

For example, here is a driver for some xilinx-specific hardware - it's one of the more generic examples of a device-tree character driver out there.

 

drivers/char/xilinx_hwicap/xilinx_hwicap.c

 

 

 

 

 

 

0 Kudos