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!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
2,193 Views
Registered: ‎10-01-2008

Testing a custom device driver

Can anyone suggest what would be a straightforward (or typical) way of testing a custom driver's read/write function in the user interface (rather than writing a new application)? 

 

As far as I know, I can test it though:

- echo <something> > /dev/<driver> for write, or 

- cat /dev/<driver> for read.

 

I am just wondering if this is a good method for testing.

 

And on top of this, I wonder, how a driver read function should be written, if the returned data is only ready after an interrupt from the device? What is the typical way of designing this? 

 

Thanks,

Shun

0 Kudos
1 Reply
Xilinx Employee
Xilinx Employee
2,174 Views
Registered: ‎09-10-2008

Re: Testing a custom device driver

Hi,

 

Sounds like you're on a reasonable path to me.

 

If you don't have a copy, you should get a copy of Linux Device Drivers 3rd edition.  Chapter 3 covers a lot of character drivers.  It's available for download from the following url.

 

http://lwn.net/Kernel/LDD3/

 

I'll try to add a link to this on our wiki.

 

On the interrupt issue, probably depends on the device interface and what you're trying to do with it. Chapter 10 in LDD3 on interrupts can also give you some ideas.

 

Thanks.

 

0 Kudos