You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lkmpg.tex
+6-7
Original file line number
Diff line number
Diff line change
@@ -836,22 +836,21 @@ \subsection{Device Drivers}
836
836
A userspace program like mp3blaster can use \verb|/dev/sound| without ever knowing what kind of sound card is installed.
837
837
838
838
Let's look at some device files.
839
-
% FIXME: use popular devices
840
-
Here are device files which represent the first three partitions on the primary master IDE hard drive:
839
+
Here are device files which represent the first three partitions on the primary SCSI storage devices:
841
840
842
841
\begin{verbatim}
843
-
$ ls -l /dev/hda[1-3]
844
-
brw-rw---- 1 root disk 3, 1 Jul 5 2000 /dev/hda1
845
-
brw-rw---- 1 root disk 3, 2 Jul 5 2000 /dev/hda2
846
-
brw-rw---- 1 root disk 3, 3 Jul 5 2000 /dev/hda3
842
+
$ ls -l /dev/sda[1-3]
843
+
brw-rw---- 1 root disk 8, 1 Apr 9 2025 /dev/sda1
844
+
brw-rw---- 1 root disk 8, 2 Apr 9 2025 /dev/sda2
845
+
brw-rw---- 1 root disk 8, 3 Apr 9 2025 /dev/sda3
847
846
\end{verbatim}
848
847
849
848
Notice the column of numbers separated by a comma.
850
849
The first number is called the device's major number.
851
850
The second number is the minor number.
852
851
The major number tells you which driver is used to access the hardware.
853
852
Each driver is assigned a unique major number; all device files with the same major number are controlled by the same driver.
854
-
All the above major numbers are 3, because they're all controlled by the same driver.
853
+
All the above major numbers are 8, because they're all controlled by the same driver.
855
854
856
855
The minor number is used by the driver to distinguish between the various hardware it controls.
857
856
Returning to the example above, although all three devices are handled by the same driver they have unique minor numbers because the driver sees them as being different pieces of hardware.
0 commit comments