📄 1094-1096.html
字号:
<HTML>
<HEAD>
<TITLE>Linux Complete Command Reference:Special Files:EarthWeb Inc.-</TITLE>
</HEAD>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!-- ISBN=0672311046 //-->
<!-- TITLE=Linux Complete Command Reference//-->
<!-- AUTHOR=Red Hat//-->
<!-- PUBLISHER=Macmillan Computer Publishing//-->
<!-- IMPRINT=Sams//-->
<!-- CHAPTER=04 //-->
<!-- PAGES=1063-1102 //-->
<!-- UNASSIGNED1 //-->
<!-- UNASSIGNED2 //-->
<P><CENTER>
<a href="1091-1093.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="1097-1098.html">Next</A></CENTER></P>
<A NAME="PAGENUM-1094"><P>Page 1094</P></A>
<P><B>
MM PROTOCOL
</B></P>
<P>The MM protocol uses 1 start bit, 8 data bits, odd parity, and 1 stop bit at the speed of 1200 bits/sec. Data is sent to RxD
in 3-byte packets. dx and dy are sent as single signed values, the sign bit indicating a negative value.
lb (mb, rb) is set when the left (middle, right) button is pressed:
</P>
<TABLE>
<TR><TD>
Byte
</TD><TD>
d7
</TD><TD>
d6
</TD><TD>
d5
</TD><TD>
d4
</TD><TD>
d3
</TD><TD>
d2
</TD><TD>
d1
</TD><TD>
d0
</TD></TR><TR><TD>
1
</TD><TD>
1
</TD><TD>
?
</TD><TD>
?
</TD><TD>
dxs
</TD><TD>
dys
</TD><TD>
lb
</TD><TD>
mb
</TD><TD>
rb
</TD></TR><TR><TD>
2
</TD><TD>
0
</TD><TD>
dx6
</TD><TD>
dx5
</TD><TD>
dx4
</TD><TD>
dx3
</TD><TD>
dx2
</TD><TD>
dx1
</TD><TD>
dx0
</TD></TR><TR><TD>
3
</TD><TD>
0
</TD><TD>
dy6
</TD><TD>
dy5
</TD><TD>
dy4
</TD><TD>
dy3
</TD><TD>
dy2
</TD><TD>
dy1
</TD><TD>
dy0
</TD></TR></TABLE>
<P><B>
FILES
</B></P>
<P>/dev/mouse a commonly used symlink pointing to a mouse device
</P>
<P><B>
SEE ALSO
</B></P>
<!-- CODE SNIP //-->
<PRE>cua(4), bm(4)
</PRE>
<!-- END CODE SNIP //-->
<P>Linux, 10 February 1996
</P>
<H3><A NAME="ch04_ 12">
null, zero
</A></H3>
<P>null, zero—Data sink.
</P>
<P><B>
DESCRIPTION
</B></P>
<P>Data written on a null or zero special file is discarded.
</P>
<P>Reads from the null special file always return end of file, whereas reads from
zero always return \0 characters.
</P>
<P>null and zero are typically created by
</P>
<!-- CODE SNIP //-->
<PRE>
mknod -m 666 /dev/null c 1 3
mknod -m 666 /dev/zero c 1 5
chown root.mem /dev/null /dev/zero
</PRE>
<!-- END CODE SNIP //-->
<P><B>
NOTES
</B></P>
<P>If these devices are not writable and readable for all users, many programs will act strangely.
</P>
<P><B>
FILES
</B></P>
<!-- CODE SNIP //-->
<PRE>
/dev/null
/dev/zero
</PRE>
<!-- END CODE SNIP //-->
<P><B>
SEE ALSO
</B></P>
<!-- CODE SNIP //-->
<PRE>
mknod(1), chown(1)
</PRE>
<!-- END CODE SNIP //-->
<P>Linux, 21 November 1992
</P>
<H3><A NAME="ch04_ 13">
ram
</A></H3>
<P>ram—Ram disk device.
</P>
<A NAME="PAGENUM-1095"><P>Page 1095</P></A>
<P><B>
DESCRIPTION
</B></P>
<P>ram is a block device to access the ram disk in raw mode.
</P>
<P>It is typically created by
</P>
<!-- CODE SNIP //-->
<PRE>
mknod -m 660 /dev/ram b 1 1
chown root.disk /dev/ram
</PRE>
<!-- END CODE SNIP //-->
<P><B>
FILES
</B></P>
<!-- CODE SNIP //-->
<PRE>
/dev/ram
</PRE>
<!-- END CODE SNIP //-->
<P><B>
SEE ALSO
</B></P>
<!-- CODE SNIP //-->
<PRE>
mknod(1), chown(1), mount(8)
</PRE>
<!-- END CODE SNIP //-->
<P>Linux, 21 November 1992
</P>
<H3><A NAME="ch04_ 14">
sd
</A></H3>
<P>sd—Driver for SCSI disk drives.
</P>
<P><B>
SYNOPSIS
</B></P>
<!-- CODE SNIP //-->
<PRE>
#include <linux/hdreg.h>
</PRE>
<!-- END CODE SNIP //-->
<P><B>
CONFIG
</B></P>
<P>The block device name has the following form:
sdlp, where l is a letter denoting the physical drive, and
p is a number denoting the partition on that physical drive. Often, the partition number,
p, will be left off when the device corresponds to the whole drive.
</P>
<P>SCSI disks have a major device number of 8 and a minor device number of the form (16 *
drive_number) + partition_number, where
drive_number is the number of the physical drive in order of detection and
partition_number is as follows:
</P>
<TABLE>
<TR><TD>
Partition 0
</TD><TD>
The whole drive
</TD></TR><TR><TD>
Partitions 1-4
</TD><TD>
The DOS "primary" partitions
</TD></TR><TR><TD>
Partitions 5-8
</TD><TD>
The DOS "extended" (or "logical") partitions
</TD></TR></TABLE>
<P>For example, /dev/sda will have major 8 and minor 0 and will refer to all the first SCSI drives in the system;
/dev/sdb3 will have major 8 and minor 19 and will refer to the third DOS "primary" partition on the second SCSI drive in the system.
</P>
<P>At this time, only block devices are provided. Raw devices have not yet been implemented.
</P>
<P><B>
DESCRIPTION
</B></P>
<P>The following ioctls are provided:
</P>
<TABLE>
<TR><TD>
HDIO_REQ
</TD><TD>
Returns the BIOS disk parameters in the following structure:
</TD></TR><TR><TD>
</TD><TD>
<!-- CODE SNIP //-->
<PRE>
struct hd geometry {
unsigned char heads;
unsigned char sectors;
unsigned short cylinders;
unsigned long start;
};
</PRE>
<!-- END CODE SNIP //-->
</TD></TR><TR><TD>
</TD><TD>
A pointer to this structure is passed as the
ioctl(2) parameter.
The information returned in the parameter is the disk geometry of
the drive as understood by DOS! This geometry is not the physical
geometry of the drive. It is used when constructing the drive's partition
table,
</TD></TR></TABLE>
<A NAME="PAGENUM-1096"><P>Page 1096</P></A>
<TABLE>
<TR><TD>
</TD><TD>
however, and is needed for convenient operation of
fdisk(1), efdisk(1), and lilo(1). If the geometry information is not available, zero is
returned for all the parameters.
</TD></TR><TR><TD>
BLKGETSIZE
</TD><TD>
Returns the device size in sectors. The
ioctl(2) parameter should be a pointer to a long.
</TD></TR><TR><TD>
BLKRRPART
</TD><TD>
Forces a re-read of the SCSI disk partition tables. No parameter
is needed.
</TD></TR><TR><TD>
</TD><TD>
The scsi(4) ioctls are also supported. If the
ioctl(2) parameter is required and it is NULL, then
ioctl(2) will return -EINVAL.
</TD></TR></TABLE>
<P><B>
FILES
</B></P>
<P>/dev/sd[a-h]: The whole device
</P>
<P>/dev/sd[a-h][0-8]: Individual block partitions
</P>
<P><B>
SEE ALSO
</B></P>
<P>scsi(4)
</P>
<P>17 December 1992
</P>
<H3><A NAME="ch04_ 15">
st
</A></H3>
<P>st—SCSI tape device.
</P>
<P><B>
SYNOPSIS
</B></P>
<!-- CODE //-->
<PRE>
#include <sys/mtio.h>
int ioctl(int fd, int request [, (void *)arg3])
int ioctl(int fd, MTIOCTOP, (struct mtop *)mt_cmd)
int ioctl(int fd, MTIOCGET, (struct mtget *)mt_status)
int ioctl(int fd, MTIOCPOS, (struct mtpos *)mt_pos)
</PRE>
<!-- END CODE //-->
<P><B>
DESCRIPTION
</B></P>
<P>The st driver provides the interface to a variety of SCSI tape devices. Currently, the driver takes control of all
detected devices of type sequential-access. The st driver uses major device number 9.
</P>
<P>Each device uses two minor device numbers: a principal minor device number,
n, assigned sequentially in order of detection, and a no-rewind device number,
(n + 128). Devices opened using the principal device number are sent a
REWIND command when they are closed. Devices opened using the no-rewind device number are not. Options such as density or block size
are not coded in the minor device number. These options must be set by explicit
ioctl() calls and remain in effect when the device is closed and reopened.
</P>
<P>Devices are typically created by
</P>
<!-- CODE SNIP //-->
<PRE>
mknod -m 660 /dev/st0 c 9 0
mknod -m 660 /dev/st1 c 9 1
mknod -m 660 /dev/nst0 c 9 128
mknod -m 660 /dev/nst1 c 9 129
</PRE>
<!-- END CODE SNIP //-->
<P>There is no corresponding block device. The character device provides buffering and read-ahead by default and
supports reads and writes of arbitrary size (limited by the driver's internal buffer size, which defaults to 32768 bytes but can
be changed either by using a kernel startup option or by changing a compile-time constant).
</P>
<P>Device /dev/tape is usually created as a hard or soft link to the default tape device on the system.
</P>
<P><CENTER>
<a href="1091-1093.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="1097-1098.html">Next</A></CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -