Editing
Solaris 10 System Administration Part I
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== device files ==== device file provides access to a device When using long listing on file the size field is populated by two numbers separated by comma The two numbers are called major & minor device numbers major device # identifies the specific device driver required to access device minor device # identifies specific unit of the type that the device driver controls Long listing: <pre>bash-3.00$ ls -l | grep pci drwxr-xr-x 4 root sys 512 May 3 16:25 pci@1c,600000 crw------- 1 root sys 109, 767 Jul 14 16:50 pci@1c,600000:devctl crw------- 1 root sys 109, 764 Jul 14 16:50 pci@1c,600000:intr crw------- 1 root sys 109, 765 Jul 14 16:50 pci@1c,600000:reg drwxr-xr-x 5 root sys 512 May 3 16:25 pci@1d,700000 crw------- 1 root sys 109, 1023 Jul 14 16:50 pci@1d,700000:devctl crw------- 1 root sys 109, 1020 Jul 14 16:50 pci@1d,700000:intr crw------- 1 root sys 109, 1021 Jul 14 16:50 pci@1d,700000:reg drwxr-xr-x 6 root sys 512 May 3 16:25 pci@1e,600000 crw------- 1 root sys 109, 511 Jul 14 16:50 pci@1e,600000:devctl crw------- 1 root sys 109, 508 Jul 14 16:50 pci@1e,600000:intr crw------- 1 root sys 109, 509 Jul 14 16:50 pci@1e,600000:reg drwxr-xr-x 4 root sys 512 May 3 16:25 pci@1f,700000 crw------- 1 root sys 109, 255 Jul 14 16:50 pci@1f,700000:devctl crw------- 1 root sys 109, 252 Jul 14 16:50 pci@1f,700000:intr crw------- 1 root sys 109, 253 Jul 14 16:50 pci@1f,700000:reg</pre> '''File pci@1c,600000:devctl refers to major device # 109 & minor device # 767''' You can also use the <code>file</code> command: <pre>bash-3.00$ file pci@1c,600000:devctl pci@1c,600000:devctl: character special (109/767)</pre> Use <code>devfsadm</code> command to create new device files A relationship exists between device file & device it controls. Major & minor device #s contained in inode establish relationship <image showing relationship from above example> Verify device driver is available as kernel module: <pre>bash-3.00# modinfo -w | grep -w scsi 22 1313a40 122a8 - 1 scsi (SCSI Bus Utility Routines) bash-3.00# modinfo -c | grep -w scsi 22 1 scsi LOADED/INSTALLED bash-3.00# modinfo -w | grep -w iscsi 96 7b600000 328c8 279 1 iscsi (Sun iSCSI Initiator v20100714-0) bash-3.00# modinfo -c | grep -w iscsi 96 1 iscsi LOADED/INSTALLED</pre> device files are categorized as character-special [character or raw devices] or block-special devices [block devices] device files in each category interact with devices differently ===== character-special device files ===== File type of "c" is character-special device file & data is accessed as a data stream <pre>crw------- 1 root sys 109, 767 Jul 14 16:50 pci@1c,600000:devctl</pre> Result of <code>file</code> command: <pre>bash-3.00# file pci@1c,600000:devctl pci@1c,600000:devctl: character special (109/767)</pre> ===== block-special device files ===== File type of "b" is a block-special device file & for disk devices, block-special device files call for I/O operations based on a defined block size Block size depends on particular device file <example of long listing of block file> data transferred between process & block-special device is first stored in kernel-managed memory-based cache block devices allow random seeks to be performed [character devices do not]
Summary:
Please note that all contributions to GotOpinion may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
GotOpinion:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information