[plug] Device files
Mark O'Shea
mark at musicalstoat.co.uk
Wed Mar 30 23:56:16 WST 2005
On Wed, 2005-03-30 at 23:28 +0800, Jim Householder wrote:
> Hi
>
> How is the correspondence between device files in /dev and hardware
> determined and/or coded?
>
> I want to use a parallel port to control a small LCD character display
> and some relays. I have installed parapin
> (http://parapin.sourceforge.net) with no errors.
>
> I have a separate parallel port card installed which I want to use.
> Having burned my fingers in the past, I *really* don't want to
> use the port on the motherboard.
>
> The parapin program appears to execute ok, but I see nothing. I
> suspect the driver defaults to the port I don't want to use.
>
> The script I run to create /dev/parport has the following:
> NAME="parport"
> depmod
> modprobe kparapin
> modprobe parapindriver devname=${NAME}
> rm -f /dev/${NAME}
> mknod /dev/${NAME} u `grep $NAME /proc/devices | cut -d " " -f 1` 0
>
> /proc/devices appears empty (length 0, file says it's empty), yet
> ls -al /dev/parport gives
> crwxrwxrwx 1 root root 253, 0 Mar 30 22:15 2005 parport
>
> Where did the 253 major come from?
> How can I create a file that points to the PCI card?
> I get the following numbers according to XP:
> PCI
> Bus 0
> Device 7
> Sub-device 16
> Function 0
>
> TIA
> Jim
Hi Jim,
It looks like you need to edit the $NAME to set it to the correct
parallel port. See:
dmesg|grep par
for the one you want.
try using cat to see the contents of /proc/devices this will tell you
where it got that major from. Remember that /proc is not a real
filesystem, most of it's contents have 0 length, but they are not empty.
Regards,
--
Mark O'Shea
More information about the plug
mailing list