Skip to contentSkip to conversation

Accessing Ram on PCI card

DISCUSSION Robert Clove 2 participants 7 messages Jun 1, 2015 – Jun 4, 2015

lore
Share & tools
lore
#1 lore raw
Quoted 3 lines · Robert Clove

Hi,

I have a pci card that has some amount of ram and flash memory on it.

What kind of card?

Quoted 2 lines

I have found the bar address range for the memory.
I want to transfer a file to that memory and read from that memory.

PCI card memory are not usually set up as a filesystem, how can you copy a file to it?

Quoted 1 line

Any pointers(in terms of sample code) how can i do that?

Why do you want to do this? What exactly are you trying to solve here?

greg k-h

#2 lore raw

Hi I have a PCI based card which have few RAM on it. I have to copy the text file to RAM and read it too.

Actually i want my pci device to be exposed as block device and then mount file system on it.

Quoted 10 lines · Greg KH
Quoted 3 lines · Robert Clove

Hi,

I have a pci card that has some amount of ram and flash memory on it.

What kind of card?

Quoted 2 lines

I have found the bar address range for the memory.
I want to transfer a file to that memory and read from that memory.

Quoted 9 lines

PCI card memory are not usually set up as a filesystem, how can you copy a file to it?

Quoted 1 line

Any pointers(in terms of sample code) how can i do that?

Why do you want to do this? What exactly are you trying to solve here?

greg k-h

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150603/7edec0fb/attachment.html

#3 lore raw
Quoted 1 line · Robert Clove

Hi I have a PCI based card which have few RAM on it.

You said that before :)

You didn't answer the question of "what kind of PCI card is this?"

Quoted 1 line

I have to copy the text file to RAM and read it too.

Who is telling you you "have to"?

Quoted 2 lines

Actually i want my pci device to be exposed as block device and then mount file system on it.

Then use it as a block device. Note, you need a special type of PCI card to be able to do this, as well as a special kernel driver for that PCI card to make it work properly.

But without any knowledge of what type of PCI card you have, it's a bit hard to give you anymore help, sorry.

greg k-h

#4 lore raw

Actually it is a PCI based NIC card having a NIC port and some RAM on it.

Quoted 15 lines · Greg KH
Quoted 1 line · Robert Clove

Hi I have a PCI based card which have few RAM on it.

You said that before :)

You didn't answer the question of "what kind of PCI card is this?"

Quoted 1 line

I have to copy the text file to RAM and read it too.

Who is telling you you "have to"?

Quoted 1 line

Actually i want my pci device to be exposed as block device and then

mount file

Quoted 1 line

system on it.

Quoted 9 lines

Then use it as a block device. Note, you need a special type of PCI card to be able to do this, as well as a special kernel driver for that PCI card to make it work properly.

But without any knowledge of what type of PCI card you have, it's a bit hard to give you anymore help, sorry.

greg k-h

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150604/d888cf1c/attachment.html

#5 lore raw
Quoted 1 line · Robert Clove

Actually it is a PCI based NIC card having a NIC port and some RAM on it.

A NIC card is not designed to hold a filesystem. If you wish to change this, you are going to have to write a kernel driver that talks to that card and exposes a block interface to userspace.

Best of luck!

greg k-h

#6 lore raw

That is what i have to do.

Quoted 11 lines · Greg KH
Quoted 1 line · Robert Clove

Actually it is a PCI based NIC card having a NIC port and some RAM on it.

A NIC card is not designed to hold a filesystem. If you wish to change this, you are going to have to write a kernel driver that talks to that card and exposes a block interface to userspace.

Best of luck!

greg k-h

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150604/56796019/attachment.html