1820553 Members
2399 Online
109626 Solutions
New Discussion юеВ

Creating a Device File

 
Joe Robinson_2
Super Advisor

Creating a Device File

In creating a device file for the robotics controller (using the following syntax), how do I determine the minor number? How do I identify the card number to use?

/user/sbin/mknod /dev/scsi/ c

from what I've read, the majornumber will be the character number from using lsdev?
8 REPLIES 8
S.K. Chan
Honored Contributor

Re: Creating a Device File

If the driver is in the kernel already, the lsdev command will give you the major number and yes the "Character" field.
Sanjay_6
Honored Contributor

Re: Creating a Device File

Hi Joe,

You should not have to create the robotics device file. Enable the "schgr" driver in the kernel and trebuild the kernel and reboot. The robotics device will be sensed and the device file will be created. Can you post your ioscan -fn output. Also in case after reboot the device files are not created and proper driver is configured, do a "insf -e" to manually create the device file. The robotics device files are normally called /dev/rac/cxtydz.

Hope this helps.

regds
Joe Robinson_2
Super Advisor

Re: Creating a Device File

ioscan -fn output.
Sanjay_6
Honored Contributor

Re: Creating a Device File

Hi Joe,

Like i had suggested above, enable the driver "schgr" in the kernel and rebuild the kernel, reboot the system and you can see the library as claimed. It is shown as unclaimed at present. Once the driver is enabled and the library is shown as claimed, you can see the deive file has been automatically created.

to enable the driver go to sam --> Kernel Configuration --> Drivers --> Select "schgr" --> Press tab --> go to action --> Enable Driver --> Then rebuild the kernel and reboot.

Hope this helps.

Regds
harry d brown jr
Honored Contributor

Re: Creating a Device File

Re: Major Correct.

Re: Minor - well you need to know more about the Major.
read:
http://docs.hp.com/hpux/onlinedocs/B2355-90053/B2355-90053_top.html

live free or die
harry
Live Free or Die
Joe Robinson_2
Super Advisor

Re: Creating a Device File

Too fast on the gun; sent results from ioscan prior to adding the driver.
A. Clay Stephenson
Acclaimed Contributor

Re: Creating a Device File

Hi Joe:

The answer is that it depends; you may need to use the schgr driver or you may simply use the sctl or pass-thru SCSI driver.

Let's assume that you determine that you need to use the 'sctl' driver character major device type 203.

How do you determine the desired controller no. - the 'c' part of cXtYdZ ?

Do an ioscan -fn and look for 'ext_bus' in the Class Column. Note the number in the Instance 'I' column that matches your desired controller. That number is the cX number. Let's pretend that it is '5'. The controller numer becomes the first two digots of the minor device number - in your case '05'. Now you should know the SCSI target setting of your robotic device - that becomes the tY part as a single hexadecimal digit - let's pretend that that is '3'. The dZ part is zero in very case that I know.

To create a major number device 203, with c5t3d0, you simply do this:

mknod /dev/robot/c2t3d0 203 0x053000

BTW, This was the standand method of creating device nodes before the days of the 'insf' command.

Man 7 scsi_ctl for more details and also man lsdev.

Regards, Clay
If it ain't broke, I can fix that.
Steve Lewis
Honored Contributor

Re: Creating a Device File

As an addendum, if you are talking about an optical library in LUN mode, then the d number of the drive will be 0-9 depending on the number of drives. Most software prefers it to be in SCSI-id mode as per ACS's post above.

If you have connected the library to two servers in a HA environment then it must be in SCSI id mode, since a device cannot tell where a request comes from when in LUN mode.

The minor number is 0x0CTD00 where C is the controller (0-F), T is the SCSI target (0-F) and D is the LUN (0-9).
You can test your device file by compiling /usr/contrib/src/scsi_io and running it with your device file as a parameter. If you got it right, it should return with a description, such as "Thing claims to be: Magneto...."