LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-05-2016, 01:08 PM   #1
khhyle
LQ Newbie
 
Registered: Dec 2016
Location: San Jose, California
Distribution: Red Hat (Tikanga)
Posts: 6

Rep: Reputation: Disabled
Clarification of Proc Filesystem for PCIe


I am relatively new to working with the Linux kernel and had a question about the proc fs and what exactly is going on.

I have been using the proc/bus/pci/xx/xx.x files to read config data (ID's, link status, etc.) for one of my PCI devices but I am curious.. is this proc file actually memory mapped to the device's configuration space? If I write to this proc file am I actually writing to the config registers of the device?

I am curious because I am trying to create a test where I stress the PCI link by writing to the device over the link for an extended period of time and record any correctable errors that occur. It is important that I am actually writing to the device and not just some sort of cached copy of the file somewhere that won't actually stress the link.
 
Old 12-05-2016, 02:31 PM   #2
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,521

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
No, /proc does not provide direct access. There's a hardware abstraction between the hardware and the /proc file system. That's the whole idea of a modern operating system. But sometimes it might be nice to gain direct access.
 
2 members found this post helpful.
Old 12-05-2016, 02:51 PM   #3
khhyle
LQ Newbie
 
Registered: Dec 2016
Location: San Jose, California
Distribution: Red Hat (Tikanga)
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by AwesomeMachine View Post
No, /proc does not provide direct access. There's a hardware abstraction between the hardware and the /proc file system. That's the whole idea of a modern operating system. But sometimes it might be nice to gain direct access.
What is the end result of writing to the proc file for a PCI device if not to modify the config registers of the device? Even if it is abstracted, is it still logically the same as if you were actually writing to the hardware? Or is this just not a feature of the proc file

Last edited by khhyle; 12-05-2016 at 02:57 PM.
 
Old 12-05-2016, 04:32 PM   #4
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
What is the end result of writing to the proc file for a PCI device if not to modify the config registers of the device?
Since the proc pci file list's a summary of devices attached to the PCI bus and modules it could (I'm not sure I've never written to proc) wreck havoc.

Quote:
Or is this just not a feature of the proc file
AwesomeMachine did say; "proc does not provide direct access".

You can access the Kernel using the proc file system but you better know what you are doing. If not you could wind up potentially with kernel panic.
http://www.ibm.com/developerworks/library/l-proc/

Are you thinking of writing a script for the test you'd like to perform?

http://tldp.org/LDP/Linux-Filesystem...html/proc.html
https://access.redhat.com/documentat...-topfiles.html
http://man7.org/linux/man-pages/man5/proc.5.html
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Proc filesystem deprication kemosparc Linux - General 7 11-12-2014 10:18 PM
proc filesystem Aquarius_Girl Linux - General 11 10-07-2009 02:03 AM
Need clarification on encrypted root filesystem -kc- Slackware 4 01-21-2009 08:14 PM
/proc filesystem dawsonbdky Linux - General 1 08-16-2004 10:06 AM
/proc filesystem dawsonbdky Linux - General 1 08-13-2004 09:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration