LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 09-27-2008, 03:24 AM   #1
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Rep: Reputation: 31
doubt in /sys


i connect the webcam...it loads the zc0301 module...along with some other modules too...in that i found that the module v4l1_compat and v4l2_common intalled..and its in /sys/modules...actually what type of files will be in /sys/module directory?what is the use of that v4l1_compat and v4l2_common modules?can anyone help me please....
 
Old 09-28-2008, 10:43 PM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 7,506

Rep: Reputation: 2388Reputation: 2388Reputation: 2388Reputation: 2388Reputation: 2388Reputation: 2388Reputation: 2388Reputation: 2388Reputation: 2388Reputation: 2388Reputation: 2388
Everything in both /sys and /proc has the following very-important characteristic: it doesn't really "exist."

Everything that you "see" in either of these two "directories" is actually something that describes the operating-system itself. In other words, when you "ask for a list of the 'files' and 'directories' in" either of these two "locations," Linux actually generates what you see ... "on the fly!"

For instance: try dir /proc. In this "directory" you will find a slew of "sub-directories" whose names are numbers. (Say... /proc/3569.) "Inside of" each of these "sub-directories" you will find other "files" and "directories."

So far, so good?

Well... the truth is, /proc/3569 does not correspond to any physical resource: it corresponds to a currently-running process, #3569. The "files and subdirectories" within that "directory" correspond to various characteristics of that process. When process #3569 ceases to exist, so will the "directory" and all of its "contents."

This peculiar strategy enables commands like ps ("process list") to do their magic without being "magical." All they need to do is to look at the "contents of" /proc.

To make a long story short, /sys works in exactly the same way. This "directory" allows the Linux system to expose useful characteristics of itself in exactly the same way that /proc allows it to expose useful characteristics of the process-table.

This strategy is actually very, very clever. You see, "ordinary" programs already know how to deal with "files and directories." It doesn't take any "special voodoo" for them to do that. But if they wanted to take a peek at the process-table??? If they wanted to take a peek at the current characteristics of "Linux itself?" Major Voodoo!! Not! Instead of subjecting these programs to the 'necessity' of performing 'major voodoo,' Linux provides a mechanism that exposes the necesssary 'voodoo' information "as though it were 'just' an ordinary file."

And that, I assure you, is "real voodoo!"
 
Old 09-29-2008, 03:56 AM   #3
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Original Poster
Rep: Reputation: 31
what is meant by voodoo?sorry...i cant understand that voodoo...
 
Old 09-29-2008, 06:24 AM   #4
jf.argentino
Member
 
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493

Rep: Reputation: 50
Quote:
what is meant by voodoo?sorry...i cant understand that voodoo...
Voodoo is a way to talk with spirits and to awake the deads... But for sundialsvcs, it's a way to explain that programs don't have to use tricks (complicated things, dark system calls...) to take some stat from the kernel.

To try to answer your first question:
V4L2 (read Video For Linux version 2) is a generic API for a user program to use video related devices, without knowing what device it really uses. In fact, if the system calls to get the last image grabbed by your web-cam depends on the web-cam models, you have to write as many program version that there's webcam you want your program to run with, and if a new webcam with a different driver come, you have to add it to your program. That where a framework like V4L2 is great, your program uses system call provided by the V4L2 user side, which won't change, and there's the driver part of V4L2 which deal with the hardware. So if your user program is V4L2 compliant, it will work with all hardware which have, and will have, a V4L2 driver!
You have the same principle in ALSA for sound devices, COMEDI for acquisition devices ....

v4l1_compat is just a layer for compatibility issue between V4L version 2 and 1.
 
Old 09-30-2008, 01:13 PM   #5
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Original Poster
Rep: Reputation: 31
ok...Thanks a lot
 
  


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
doubt ? ashintoms Linux - Networking 1 07-24-2006 01:05 PM
A doubt !!! gabsik Linux - Networking 1 07-20-2006 01:54 PM
Doubt in C++ zeropash Programming 1 07-05-2005 01:33 PM
Is a Linux sys w/o any passwd's as secure as a microsoft windows sys w/no passwd? t3gah Linux - Security 4 04-22-2005 09:01 PM
DOUBT .- jordomi Linux - Distributions 2 08-23-2000 07:53 AM


All times are GMT -5. The time now is 09:53 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration