[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-smp
Subject:    Re: proc file system
From:       jj () spiderentertainment ! com
Date:       1999-09-30 19:35:06
[Download RAW message or body]



Alexander Viro wrote:

> >A while back, 4, 5 years ago, I used to program in assembler (for dos
> > only tho), C++, and others, I understand the old x86 architecture,
> > however I have not kept up with the news pretty much after pentium was
> > released.
>
> Hmm... Funny omission in that list - C. You know, the language this system
> is written in...

Yeah, well at that time I started to program in basic, then I learned
assembler, and then C, and C++ and OOP which I liked so much, that I gave up
hope in C.

> > Anyway, I wish to understand every number in every file in the proc, so
> > that I may write system utilities, as that is what I used to do and wish
> > to do so now for linux. However it is hard to try to figure out what the
>
> Sorry for the cold shower, but /proc is extermely non-portable and should
> be used only when there is no other way to do the thing (or when the
> alternative is equally unportable and more messy - access to kmem, for
> one). Amount of "system utilities" is actually very small - it's not DOS,
> it's UNIX.

> Rule of the tumb: if you don't know what it is for - most likely you
> don'tneed it. Good programs come from the need to do something, not from the

> desire to use every existing feature. And they are rarely (if ever)
> limited to one flavor of UNIX.

I understand, but please keep in mind, I do not wish to even begin to write
the utilities just yet, at the present moment I'm trying to understand *how*
the kernel functions, and one way to see it's behavour is through /proc
system, correct me if I'm wrong.
My final goal here is to know which line where and what.

> > Can you possibly suggest how I may go about learning the proc file
> > system ? At this stage it would not be efficient for me to go into the
> > code, as I'm relearning programming in C for linux.
>
> procfs is _not_ a good place to start. Really. You can do worse than that
> (SCSI mid-layer for one ;-/), but it's one of the messiest parts of
> fs/*/*. If you want to look at something more readable - go for
> fs/{namei,open,fcntl,dcache,inode}.c. And use any book on the UNIX kernel
> arcitecture - Linux VFS differs from BSD and SunOS ones in implementation
> (IMO it's much nicer), but the external interface and many ideas are the
> same. And look into one of the decent filesystems - ext2, for one. As for
> the decent books - try combination of the Daemon Book (4.4BSD Design and
> Implementation) and TLK (look on sunsite.unc.edu/pub/Linux/docs/LDP/).
> BTW, many ideas are very old - Lions' Book ("Lions' Commentary on UNIX 6th
> Edition") may be useful too, especially since it learns to read C (and
> contains the full source of v6 kernel). The language had changed since
> then, but the principles remain the same.
>
> > Also you have any docs in terms of Linux and SMP, specially pertaining
> > to security I would be mostly interested.
>
> The same as for single-processor, unless you are inside the kernel.
> There you should care for additional races. Start with Vahalia ("UNIX
> Internals") if you are into that area - this stuff is not Linux-specific.

THx !

-
Linux SMP list: FIRST see FAQ at http://www.irisa.fr/prive/mentre/smp-faq/
To Unsubscribe: send "unsubscribe linux-smp" to majordomo@vger.rutgers.edu

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic