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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-11-2003, 09:33 AM
|
#1
|
LQ Newbie
Registered: Oct 2003
Posts: 16
Rep:
|
/proc/bus/pci/devices file question
Hi,
I have a general question on Linux. I believe the "/proc/bus/pci/devices" file in Linux lists all the devices on the PCI bus. I'm wondering if anyone knows how this file is updated or maintained? How is this file updated with the devices.? Is it updated every time the system is turned on or does the system admin update with the appropriate information?
Thanks in advance!
Michelle
|
|
|
11-11-2003, 01:11 PM
|
#2
|
Member
Registered: Feb 2003
Location: Atlanta, GA
Posts: 151
Rep:
|
/proc is a fake filesystem, it's really just outputs from the kernel
|
|
|
11-11-2003, 01:18 PM
|
#3
|
LQ Newbie
Registered: Oct 2003
Posts: 16
Original Poster
Rep:
|
I'm sorry but I'm not totally understanding it. What do you mean by "fake" filesystem, you mean it's not an actual physical file?
|
|
|
11-11-2003, 02:03 PM
|
#4
|
Member
Registered: Jan 2003
Location: Poland, Warsaw
Distribution: LFS, Gentoo
Posts: 591
Rep:
|
Well, the /proc idea is following.
Assume that your program uses several variables which values determine or report the program behavior. You want to change the value of this variables or just see these values to see what your program is doing. For that purposes your program is writing these variables to the file (you can see them for report information). Since you need also to control the program by changing a variable values the program has to read the file permanently - at any moment you can edit a variable value, store in the file and your program should read the new value and modify its action.
If you have a lot of the variables in your program it is a sense to use not the only file but to create a directory with a number of files (because of easier access using a tree directory structure)
Linux kernel has a lot of such 'variables' representing current kernel setting, states, etc.
And gives you the way to access them. It creates the directory /proc. This is built up dynamically according to the kernel state. And allows you to write into. This way you can change kernel's 'variable'.
The /proc is fake directory since nothing is written onto the hdd! You see the kernel internals as a regular directory because kernel shows you its internal state in that way.
|
|
|
11-11-2003, 02:55 PM
|
#5
|
LQ Newbie
Registered: Oct 2003
Posts: 16
Original Poster
Rep:
|
Thanks!
So basically that means I can't go into the file and modify this variable used by the kernel. Does that imply the kernel updates the /proc/bus/pci/devices automatically each time at bootup?
|
|
|
11-11-2003, 04:37 PM
|
#6
|
Member
Registered: Jan 2003
Location: Poland, Warsaw
Distribution: LFS, Gentoo
Posts: 591
Rep:
|
Quote:
So basically that means I can't go into the file and modify this variable used by the kernel.
|
Not true. Some are used just for enabling/disabling kernel function.
For instance: if you are using linux as a router you need to enable packet forwarding. You can do it with the command: 'echo 1 > /proc/sys/net/ipv4/ip_forward' = writing '1' to the file 'ip_forward'
Quote:
Does that imply the kernel updates the /proc/bus/pci/devices automatically each time at bootup?
|
Not only at bootup. It can be updated it at any moment. In /proc you can see subdirs with 'numerical' names. Each one concerns running process. Pid is the 'numerical' name of the subdir. The subdir exists as long as the process exists.
|
|
|
11-12-2003, 10:16 AM
|
#7
|
Member
Registered: Feb 2003
Location: Atlanta, GA
Posts: 151
Rep:
|
yeah there you go, i was just being lazy with my post :-X
|
|
|
All times are GMT -5. The time now is 07:07 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|