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 06-30-2005, 03:41 AM   #1
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444

Rep: Reputation: 30
Finding my /dev/hardware


Hi, I'm wondering how hardware is set up on linux. For example, there is the dev directory which contains a list of all my devices or does it? How would I set up a USB printer? Is there any way to figure out what the device is just by looking in the dev directory? What is the equivalent to a device driver in linux and where is it put? If there is anything else let me know. Thanks.
 
Old 06-30-2005, 03:51 AM   #2
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
Which distribution of Linux are you using?
Rather than ask you a lot of questions, I'll refer you here :->
How To Ask a Question
and here :->
LinuxPrinting.org
 
Old 06-30-2005, 04:06 AM   #3
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444

Original Poster
Rep: Reputation: 30
I'm using Slackware.
 
Old 06-30-2005, 04:20 AM   #4
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
Some good reading for a Slacker :->

The Revised Slackware Book Project

Slackware Linux Basics

Slackware Tips & Tricks by Jack S. Lai

##slackware FAQ

Any questions you can't find answered in those links, please post back...
 
Old 06-30-2005, 05:48 AM   #5
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444

Original Poster
Rep: Reputation: 30
Alright, I have read through most of the sources, but my question still isn't answered. Let me modify the question a bit. I want to know how a dev file comes to be. Is a dev file automatically created by linux, or does a device driver need to installed? If the dev file is automatically created what can I learn from it?
 
Old 06-30-2005, 04:09 PM   #6
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444

Original Poster
Rep: Reputation: 30
Alright, I have gotton a little hint on how the devices work. You do end up creating the devices using MAKEDEV or mknod. I still am unclear about a few things. How does the kernel know which PCI slot the hardware is in? What about IRC lines?
 
Old 06-30-2005, 05:48 PM   #7
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
No need to use mknod anymore...
http://www.atnf.csiro.au/people/rgoo...ocs/devfs.html

First hit on Google for devfs
 
Old 07-02-2005, 06:57 PM   #8
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444

Original Poster
Rep: Reputation: 30
I'm trying to read through the /devfs FAQ, but there are certain words that I do not understand yet.
What is a device namespace?
What is an inode?
What is "real" character device?
What is a block device?

Also, I'm confused because Gooch starts off talking about major and minor numbers and then mentions all the requirements for specifying a SCSI device.

host 6 bits (say up to 64 hosts on a really big machine)
channel 4 bits (say up to 16 SCSI buses per host)
id 4 bits
lun 3 bits
partition 6 bits
TOTAL 23 bits

What does this have to with major and minor numbers and how can major and minor numbers describe all these parameters? Thanks.
 
Old 07-02-2005, 07:04 PM   #9
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
Most of that is beyond me, too, but simply know that if your hardware
has a module in the kernel, and you use devfs, it's probably recognized
by Slackware.

I think your original question:

Q: How would I set up a USB printer?

A: Use CUPS...the link I provided has info for your printer if it's supported,
and you simply need to open a web browser and then type:
http://localhost:631/
and login as root, then follow the instructions for setting up your
printer.
 
Old 07-02-2005, 07:17 PM   #10
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444

Original Poster
Rep: Reputation: 30
Sorry, when I do not know where to look, I ask a whole bunch of questions hoping to find a hint. The printer was did not really have to do with my question. What I want to understand is hardware and GNU/Linux cooperate. I'm sure this is an extremely hard thing to explain, but I need to learn about it sometime. The USB printer was just a hypothetical question. I'm trying to figure out the flow of events. For example, say programmer needs to send a message to the internet. The order of events might be:
1. Ask the OS what device is the internet device.
2. Write to the proper devfs file.
3. devfs calls driver.
4. driver communicates with the device.
Learning the flow of events might be the first step to understanding hardware in Linux.
 
Old 07-03-2005, 05:57 PM   #11
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444

Original Poster
Rep: Reputation: 30
Well, does anyone no what the chain of events is? (Is sounds funny in that position, but the subject is actually singular, chain)

: )
 
Old 07-03-2005, 08:16 PM   #12
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Devfs isn't used much any more. Udev is the new standard for dynamically populating the /dev directory.

Basically, a device file is one of two types, a block device (like a hard drive, which reads or writes blocks from magnetic media) or a character device (or raw device in some usages -- these are basically like a terminal, you can read/write one byte at a time). A device file is a "magic" file that gets interpreted by the kernel directly. Basically, a driver is a piece of code ruunning in the kernel (either compiled in or insmoded) that can associate itself with a particular device major number. A program can then open/read/write the device file and the operations will be sent by the kernel I/O handler to the correct driver code.

If you're interested, read Linux Device Drivers, which is online (legally) here.
 
Old 07-04-2005, 04:41 PM   #13
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444

Original Poster
Rep: Reputation: 30
Thank you, I will take at least a week to read Linux Device Drivers because I have school this week. I will write back when I'm done.
 
  


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
Finding TV-out hardware mjvdvlugt Linux - Hardware 4 09-03-2004 03:59 AM
Finding all my hardware Mega Man X Linux - Hardware 2 01-14-2004 02:53 AM
Finding new hardware! akasantos Fedora 1 11-15-2003 10:13 PM
Need help finding libpng-dev IGNGcubeman Linux - Software 3 08-02-2003 11:30 AM
Finding Hardware OrganicX Linux - General 6 10-27-2002 09:15 PM

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

All times are GMT -5. The time now is 04:30 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
Open Source Consulting | Domain Registration