Re: PCI device driver question



I cannot find any good documentations on sys_open, sys_read, etc. What
are the parameters required to utilize those questions?

Let me rephrase what I wrote before. I have implemented a pci device
driver. I have the __init, __exit, probe, and remove functions just
like standard pci device drivers. Originally, in my probe function, I
tested the pci device driver by reading/writing to different base
address. On the FPGA, I had a simple test program involving LED's to
verify that I have read/write to the specific memory address.

Now, instead of writing/reading from the pci device driver, I want to
be able to do the reading/writing from the userspace. From the
userspace, I want to input a file using stdio that contains the data to
be written. I will then write out the data to the pci device driver.

My questions are:
a) In the pci device driver, do I need a write and read functions? Are
the functions similar to the char device driver read/write functions?
b) In the userspace, how do I access the pci device driver? The
previous poster mentioned to use sys_open, sys_read, sys_write, etc.
What are the parameters needed to utilize sys_open, sys_read,
sys_write, etc.? Do I need to know major/minor numbers?


ellis@xxxxxxx wrote:
In article <1166736838.855581.113720@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
elliotng.ee@xxxxxxxxx <elliotng.ee@xxxxxxxxx> wrote:

Now instead of hard-coding what to write in the memory region, I want
to input a file, read the file, and write the appropriate contents to
the memory region. What are the appropriate steps to do that? It seems
as though that I cannot use the library stdio in pci device drivers. Is
there another library that contains file IO?

Look in the kernel source for examples of sys_open, sys_read, etc.

--
http://www.spinics.net/lists/

.



Relevant Pages

  • Re: PCI device driver question
    ... OK, after doing some research, it appears that I can use the char ... device read and write functions in the pci device driver. ... to be able to access the pci device driver, read from memory, and write ... In userspace code, how do I use fread and fwrite to a specific ...
    (comp.os.linux.development.system)
  • PCI device driver question
    ... I am writing a PCI device driver. ... Now instead of hard-coding what to write in the memory region, ... as though that I cannot use the library stdio in pci device drivers. ...
    (comp.os.linux.development.system)