Remove whitespace right before punctuation marks in running text.
This commit is contained in:
parent
a81654a84a
commit
c4d8816e3d
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=12182
12 changed files with 32 additions and 33 deletions
|
@ -49,7 +49,7 @@
|
||||||
changes.</para>
|
changes.</para>
|
||||||
|
|
||||||
<para>The kld interface is used through the following
|
<para>The kld interface is used through the following
|
||||||
administrator commands :
|
administrator commands:
|
||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem><simpara><command>kldload</command> - loads a new kernel
|
<listitem><simpara><command>kldload</command> - loads a new kernel
|
||||||
|
@ -122,7 +122,7 @@ KMOD=skeleton
|
||||||
|
|
||||||
<para>Simply running <command>make</command> with this makefile
|
<para>Simply running <command>make</command> with this makefile
|
||||||
will create a file <filename>skeleton.ko</filename> that can
|
will create a file <filename>skeleton.ko</filename> that can
|
||||||
be loaded into your system by typing :
|
be loaded into your system by typing:
|
||||||
<screen>&prompt.root; kldload -v ./skeleton.ko</screen>
|
<screen>&prompt.root; kldload -v ./skeleton.ko</screen>
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
|
@ -334,12 +334,12 @@ echo_write(dev_t dev, struct uio *uio, int ioflag)
|
||||||
DEV_MODULE(echo,echo_loader,NULL);</programlisting>
|
DEV_MODULE(echo,echo_loader,NULL);</programlisting>
|
||||||
|
|
||||||
<para>To install this driver you will first need to make a node on
|
<para>To install this driver you will first need to make a node on
|
||||||
your filesystem with a command such as : </para>
|
your filesystem with a command such as:</para>
|
||||||
|
|
||||||
<screen>&prompt.root; mknod /dev/echo c 33 0</screen>
|
<screen>&prompt.root; mknod /dev/echo c 33 0</screen>
|
||||||
|
|
||||||
<para>With this driver loaded you should now be able to type
|
<para>With this driver loaded you should now be able to type
|
||||||
something like :</para>
|
something like:</para>
|
||||||
|
|
||||||
<screen>&prompt.root; echo -n "Test Data" > /dev/echo
|
<screen>&prompt.root; echo -n "Test Data" > /dev/echo
|
||||||
&prompt.root; cat /dev/echo
|
&prompt.root; cat /dev/echo
|
||||||
|
|
|
@ -206,7 +206,7 @@
|
||||||
|
|
||||||
<listitem><para><function>char
|
<listitem><para><function>char
|
||||||
*device_get_nameunit(dev)</function> Get the device name
|
*device_get_nameunit(dev)</function> Get the device name
|
||||||
including the unit number, such as "xxx0" , "xxx1" and so
|
including the unit number, such as "xxx0", "xxx1" and so
|
||||||
on.</para></listitem>
|
on.</para></listitem>
|
||||||
|
|
||||||
<listitem><para><function>char
|
<listitem><para><function>char
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
<title>Userland code</title>
|
<title>Userland code</title>
|
||||||
|
|
||||||
<para>The source for the user-land jail is located in
|
<para>The source for the user-land jail is located in
|
||||||
<filename>/usr/src/usr.sbin/jail</filename> , consisting of
|
<filename>/usr/src/usr.sbin/jail</filename>, consisting of
|
||||||
one file, <filename>jail.c</filename>. The program takes these
|
one file, <filename>jail.c</filename>. The program takes these
|
||||||
arguments: the path of the jail, hostname, ip address, and the
|
arguments: the path of the jail, hostname, ip address, and the
|
||||||
command to be executed.</para>
|
command to be executed.</para>
|
||||||
|
|
|
@ -234,7 +234,7 @@ DRIVER_MODULE(mypci, pci, mypci_driver, mypci_devclass, 0, 0);</programlisting>
|
||||||
the <function>bus_alloc_resource()</function> function.</para>
|
the <function>bus_alloc_resource()</function> function.</para>
|
||||||
|
|
||||||
<para>For example, a typical driver might have something similar
|
<para>For example, a typical driver might have something similar
|
||||||
to this in the <function>attach()</function> function. : </para>
|
to this in the <function>attach()</function> function:</para>
|
||||||
|
|
||||||
<programlisting> sc->bar0id = 0x10;
|
<programlisting> sc->bar0id = 0x10;
|
||||||
sc->bar0res = bus_alloc_resource(dev, SYS_RES_MEMORY, &(sc->bar0id),
|
sc->bar0res = bus_alloc_resource(dev, SYS_RES_MEMORY, &(sc->bar0id),
|
||||||
|
@ -267,8 +267,7 @@ DRIVER_MODULE(mypci, pci, mypci_driver, mypci_devclass, 0, 0);</programlisting>
|
||||||
<para>These handles can then be used to read or write from the
|
<para>These handles can then be used to read or write from the
|
||||||
device registers with the <function>bus_space_*</function>
|
device registers with the <function>bus_space_*</function>
|
||||||
functions. For example, a driver might contain a shorthand
|
functions. For example, a driver might contain a shorthand
|
||||||
function to read from a board specific register like this :
|
function to read from a board specific register like this:</para>
|
||||||
</para>
|
|
||||||
|
|
||||||
<programlisting>uint16_t
|
<programlisting>uint16_t
|
||||||
board_read(struct ni_softc *sc, uint16_t address) {
|
board_read(struct ni_softc *sc, uint16_t address) {
|
||||||
|
@ -276,7 +275,7 @@ board_read(struct ni_softc *sc, uint16_t address) {
|
||||||
}
|
}
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
<para>Similarly, one could write to the registers with : </para>
|
<para>Similarly, one could write to the registers with:</para>
|
||||||
|
|
||||||
<programlisting>void
|
<programlisting>void
|
||||||
board_write(struct ni_softc *sc, uint16_t address, uint16_t value) {
|
board_write(struct ni_softc *sc, uint16_t address, uint16_t value) {
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<para>This document assumes that the reader has a general
|
<para>This document assumes that the reader has a general
|
||||||
understanding of device drivers in FreeBSD and of the SCSI
|
understanding of device drivers in FreeBSD and of the SCSI
|
||||||
protocol. Much of the information in this document was
|
protocol. Much of the information in this document was
|
||||||
extracted from the drivers :</para>
|
extracted from the drivers:</para>
|
||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@
|
||||||
bus? The answer given in the comments to the CAM code is:
|
bus? The answer given in the comments to the CAM code is:
|
||||||
either way, as the driver's author prefers.</para>
|
either way, as the driver's author prefers.</para>
|
||||||
|
|
||||||
<para>The arguments are :
|
<para>The arguments are:
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
|
|
||||||
<listitem><para><function>action_func</function> - pointer to
|
<listitem><para><function>action_func</function> - pointer to
|
||||||
|
@ -1061,7 +1061,7 @@ of the union ccb:</para>
|
||||||
|
|
||||||
<listitem><para><emphasis>flags</emphasis> - consists of two
|
<listitem><para><emphasis>flags</emphasis> - consists of two
|
||||||
parts, binary arguments and identification of
|
parts, binary arguments and identification of
|
||||||
sub-operations. The binary arguments are :</para>
|
sub-operations. The binary arguments are:</para>
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem><para><emphasis>CCB_TRANS_DISC_ENB</emphasis> - enable disconnection</para></listitem>
|
<listitem><para><emphasis>CCB_TRANS_DISC_ENB</emphasis> - enable disconnection</para></listitem>
|
||||||
<listitem><para><emphasis>CCB_TRANS_TAG_ENB</emphasis> -
|
<listitem><para><emphasis>CCB_TRANS_TAG_ENB</emphasis> -
|
||||||
|
@ -1415,7 +1415,7 @@ CCB as done.</para>
|
||||||
poll routine. So all it needs to do is to call the interrupt
|
poll routine. So all it needs to do is to call the interrupt
|
||||||
routine (or the other way around, the poll routine may be doing
|
routine (or the other way around, the poll routine may be doing
|
||||||
the real action and the interrupt routine would just call the
|
the real action and the interrupt routine would just call the
|
||||||
poll routine). Why bother about a separate function then ?
|
poll routine). Why bother about a separate function then?
|
||||||
Because of different calling conventions. The
|
Because of different calling conventions. The
|
||||||
<function>xxx_poll</function> routine gets the struct cam_sim
|
<function>xxx_poll</function> routine gets the struct cam_sim
|
||||||
pointer as its argument when the PCI interrupt routine by common
|
pointer as its argument when the PCI interrupt routine by common
|
||||||
|
@ -1973,7 +1973,7 @@ xxx_timeout(void *arg)
|
||||||
<para>When we abort a request all the other disconnected requests
|
<para>When we abort a request all the other disconnected requests
|
||||||
to the same target/LUN get aborted too. So there appears a
|
to the same target/LUN get aborted too. So there appears a
|
||||||
question, should we return them with status CAM_REQ_ABORTED or
|
question, should we return them with status CAM_REQ_ABORTED or
|
||||||
CAM_CMD_TIMEOUT ? The current drivers use CAM_CMD_TIMEOUT. This
|
CAM_CMD_TIMEOUT? The current drivers use CAM_CMD_TIMEOUT. This
|
||||||
seems logical because if one request got timed out then probably
|
seems logical because if one request got timed out then probably
|
||||||
something really bad is happening to the device, so if they
|
something really bad is happening to the device, so if they
|
||||||
would not be disturbed they would time out by themselves.</para>
|
would not be disturbed they would time out by themselves.</para>
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
changes.</para>
|
changes.</para>
|
||||||
|
|
||||||
<para>The kld interface is used through the following
|
<para>The kld interface is used through the following
|
||||||
administrator commands :
|
administrator commands:
|
||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem><simpara><command>kldload</command> - loads a new kernel
|
<listitem><simpara><command>kldload</command> - loads a new kernel
|
||||||
|
@ -122,7 +122,7 @@ KMOD=skeleton
|
||||||
|
|
||||||
<para>Simply running <command>make</command> with this makefile
|
<para>Simply running <command>make</command> with this makefile
|
||||||
will create a file <filename>skeleton.ko</filename> that can
|
will create a file <filename>skeleton.ko</filename> that can
|
||||||
be loaded into your system by typing :
|
be loaded into your system by typing:
|
||||||
<screen>&prompt.root; kldload -v ./skeleton.ko</screen>
|
<screen>&prompt.root; kldload -v ./skeleton.ko</screen>
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
|
@ -334,12 +334,12 @@ echo_write(dev_t dev, struct uio *uio, int ioflag)
|
||||||
DEV_MODULE(echo,echo_loader,NULL);</programlisting>
|
DEV_MODULE(echo,echo_loader,NULL);</programlisting>
|
||||||
|
|
||||||
<para>To install this driver you will first need to make a node on
|
<para>To install this driver you will first need to make a node on
|
||||||
your filesystem with a command such as : </para>
|
your filesystem with a command such as:</para>
|
||||||
|
|
||||||
<screen>&prompt.root; mknod /dev/echo c 33 0</screen>
|
<screen>&prompt.root; mknod /dev/echo c 33 0</screen>
|
||||||
|
|
||||||
<para>With this driver loaded you should now be able to type
|
<para>With this driver loaded you should now be able to type
|
||||||
something like :</para>
|
something like:</para>
|
||||||
|
|
||||||
<screen>&prompt.root; echo -n "Test Data" > /dev/echo
|
<screen>&prompt.root; echo -n "Test Data" > /dev/echo
|
||||||
&prompt.root; cat /dev/echo
|
&prompt.root; cat /dev/echo
|
||||||
|
|
|
@ -206,7 +206,7 @@
|
||||||
|
|
||||||
<listitem><para><function>char
|
<listitem><para><function>char
|
||||||
*device_get_nameunit(dev)</function> Get the device name
|
*device_get_nameunit(dev)</function> Get the device name
|
||||||
including the unit number, such as "xxx0" , "xxx1" and so
|
including the unit number, such as "xxx0", "xxx1" and so
|
||||||
on.</para></listitem>
|
on.</para></listitem>
|
||||||
|
|
||||||
<listitem><para><function>char
|
<listitem><para><function>char
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
<title>Userland code</title>
|
<title>Userland code</title>
|
||||||
|
|
||||||
<para>The source for the user-land jail is located in
|
<para>The source for the user-land jail is located in
|
||||||
<filename>/usr/src/usr.sbin/jail</filename> , consisting of
|
<filename>/usr/src/usr.sbin/jail</filename>, consisting of
|
||||||
one file, <filename>jail.c</filename>. The program takes these
|
one file, <filename>jail.c</filename>. The program takes these
|
||||||
arguments: the path of the jail, hostname, ip address, and the
|
arguments: the path of the jail, hostname, ip address, and the
|
||||||
command to be executed.</para>
|
command to be executed.</para>
|
||||||
|
|
|
@ -333,7 +333,7 @@
|
||||||
<para>The second scenario is to drop to the debugger once the
|
<para>The second scenario is to drop to the debugger once the
|
||||||
system has booted. There are two simple ways to accomplish
|
system has booted. There are two simple ways to accomplish
|
||||||
this. If you would like to break to the debugger from the
|
this. If you would like to break to the debugger from the
|
||||||
command prompt, simply type the command :</para>
|
command prompt, simply type the command:</para>
|
||||||
|
|
||||||
<screen>&prompt.root; sysctl debug.enter_debugger=ddb</screen>
|
<screen>&prompt.root; sysctl debug.enter_debugger=ddb</screen>
|
||||||
|
|
||||||
|
|
|
@ -234,7 +234,7 @@ DRIVER_MODULE(mypci, pci, mypci_driver, mypci_devclass, 0, 0);</programlisting>
|
||||||
the <function>bus_alloc_resource()</function> function.</para>
|
the <function>bus_alloc_resource()</function> function.</para>
|
||||||
|
|
||||||
<para>For example, a typical driver might have something similar
|
<para>For example, a typical driver might have something similar
|
||||||
to this in the <function>attach()</function> function. : </para>
|
to this in the <function>attach()</function> function:</para>
|
||||||
|
|
||||||
<programlisting> sc->bar0id = 0x10;
|
<programlisting> sc->bar0id = 0x10;
|
||||||
sc->bar0res = bus_alloc_resource(dev, SYS_RES_MEMORY, &(sc->bar0id),
|
sc->bar0res = bus_alloc_resource(dev, SYS_RES_MEMORY, &(sc->bar0id),
|
||||||
|
@ -267,8 +267,7 @@ DRIVER_MODULE(mypci, pci, mypci_driver, mypci_devclass, 0, 0);</programlisting>
|
||||||
<para>These handles can then be used to read or write from the
|
<para>These handles can then be used to read or write from the
|
||||||
device registers with the <function>bus_space_*</function>
|
device registers with the <function>bus_space_*</function>
|
||||||
functions. For example, a driver might contain a shorthand
|
functions. For example, a driver might contain a shorthand
|
||||||
function to read from a board specific register like this :
|
function to read from a board specific register like this:</para>
|
||||||
</para>
|
|
||||||
|
|
||||||
<programlisting>uint16_t
|
<programlisting>uint16_t
|
||||||
board_read(struct ni_softc *sc, uint16_t address) {
|
board_read(struct ni_softc *sc, uint16_t address) {
|
||||||
|
@ -276,7 +275,7 @@ board_read(struct ni_softc *sc, uint16_t address) {
|
||||||
}
|
}
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
<para>Similarly, one could write to the registers with : </para>
|
<para>Similarly, one could write to the registers with:</para>
|
||||||
|
|
||||||
<programlisting>void
|
<programlisting>void
|
||||||
board_write(struct ni_softc *sc, uint16_t address, uint16_t value) {
|
board_write(struct ni_softc *sc, uint16_t address, uint16_t value) {
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<para>This document assumes that the reader has a general
|
<para>This document assumes that the reader has a general
|
||||||
understanding of device drivers in FreeBSD and of the SCSI
|
understanding of device drivers in FreeBSD and of the SCSI
|
||||||
protocol. Much of the information in this document was
|
protocol. Much of the information in this document was
|
||||||
extracted from the drivers :</para>
|
extracted from the drivers:</para>
|
||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@
|
||||||
bus? The answer given in the comments to the CAM code is:
|
bus? The answer given in the comments to the CAM code is:
|
||||||
either way, as the driver's author prefers.</para>
|
either way, as the driver's author prefers.</para>
|
||||||
|
|
||||||
<para>The arguments are :
|
<para>The arguments are:
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
|
|
||||||
<listitem><para><function>action_func</function> - pointer to
|
<listitem><para><function>action_func</function> - pointer to
|
||||||
|
@ -1061,7 +1061,7 @@ of the union ccb:</para>
|
||||||
|
|
||||||
<listitem><para><emphasis>flags</emphasis> - consists of two
|
<listitem><para><emphasis>flags</emphasis> - consists of two
|
||||||
parts, binary arguments and identification of
|
parts, binary arguments and identification of
|
||||||
sub-operations. The binary arguments are :</para>
|
sub-operations. The binary arguments are:</para>
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem><para><emphasis>CCB_TRANS_DISC_ENB</emphasis> - enable disconnection</para></listitem>
|
<listitem><para><emphasis>CCB_TRANS_DISC_ENB</emphasis> - enable disconnection</para></listitem>
|
||||||
<listitem><para><emphasis>CCB_TRANS_TAG_ENB</emphasis> -
|
<listitem><para><emphasis>CCB_TRANS_TAG_ENB</emphasis> -
|
||||||
|
@ -1415,7 +1415,7 @@ CCB as done.</para>
|
||||||
poll routine. So all it needs to do is to call the interrupt
|
poll routine. So all it needs to do is to call the interrupt
|
||||||
routine (or the other way around, the poll routine may be doing
|
routine (or the other way around, the poll routine may be doing
|
||||||
the real action and the interrupt routine would just call the
|
the real action and the interrupt routine would just call the
|
||||||
poll routine). Why bother about a separate function then ?
|
poll routine). Why bother about a separate function then?
|
||||||
Because of different calling conventions. The
|
Because of different calling conventions. The
|
||||||
<function>xxx_poll</function> routine gets the struct cam_sim
|
<function>xxx_poll</function> routine gets the struct cam_sim
|
||||||
pointer as its argument when the PCI interrupt routine by common
|
pointer as its argument when the PCI interrupt routine by common
|
||||||
|
@ -1973,7 +1973,7 @@ xxx_timeout(void *arg)
|
||||||
<para>When we abort a request all the other disconnected requests
|
<para>When we abort a request all the other disconnected requests
|
||||||
to the same target/LUN get aborted too. So there appears a
|
to the same target/LUN get aborted too. So there appears a
|
||||||
question, should we return them with status CAM_REQ_ABORTED or
|
question, should we return them with status CAM_REQ_ABORTED or
|
||||||
CAM_CMD_TIMEOUT ? The current drivers use CAM_CMD_TIMEOUT. This
|
CAM_CMD_TIMEOUT? The current drivers use CAM_CMD_TIMEOUT. This
|
||||||
seems logical because if one request got timed out then probably
|
seems logical because if one request got timed out then probably
|
||||||
something really bad is happening to the device, so if they
|
something really bad is happening to the device, so if they
|
||||||
would not be disturbed they would time out by themselves.</para>
|
would not be disturbed they would time out by themselves.</para>
|
||||||
|
|
|
@ -403,7 +403,8 @@ int main() {
|
||||||
to superuser power for imprisoned processes.</para>
|
to superuser power for imprisoned processes.</para>
|
||||||
|
|
||||||
<para>A superuser process within a jailed environment has the
|
<para>A superuser process within a jailed environment has the
|
||||||
power to : </para>
|
power to:</para>
|
||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem><simpara>Manipulate credential with
|
<listitem><simpara>Manipulate credential with
|
||||||
<function>setuid</function>, <function>seteuid</function>,
|
<function>setuid</function>, <function>seteuid</function>,
|
||||||
|
@ -454,7 +455,7 @@ int main() {
|
||||||
|
|
||||||
<para>An application should never assume that anything about the
|
<para>An application should never assume that anything about the
|
||||||
users environment is sane. This includes (but is certainly not
|
users environment is sane. This includes (but is certainly not
|
||||||
limited to) : user input, signals, environment variables,
|
limited to): user input, signals, environment variables,
|
||||||
resources, IPC, mmaps, the file system working directory, file
|
resources, IPC, mmaps, the file system working directory, file
|
||||||
descriptors, the # of open files, etc.</para>
|
descriptors, the # of open files, etc.</para>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue