Escape <, >, &'s, plus some cleanups against the SGML. There should not
be any content changes involved in this commit, however, localization teams are encouraged to catch up with this change. Requested by: intron at intron ac Reviewed by: Niclas Zeising <lothrandil at n00b apagnu se> Glanced by: simon
This commit is contained in:
parent
8ecae3308c
commit
e140896ec8
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=26779
44 changed files with 568 additions and 570 deletions
en_US.ISO8859-1
books
arch-handbook
boot
driverbasics
isa
jail
kobj
locking
mac
pccard
pci
scsi
sound
developers-handbook
introduction
ipv6
kerneldebug
secure
sockets
tools
x86
fdp-primer
handbook
advanced-networking
basics
config
cutting-edge
disks
firewalls
geom
install
kernelconfig
linuxemu
mac
mail
mirrors
network-servers
ppp-and-slip
security
serialcomms
x11
pmake
porters-handbook
share/sgml
|
@ -83,7 +83,7 @@ F5 Disk 2</screen>
|
|||
|
||||
<row>
|
||||
<entry><para>
|
||||
<screen>>>FreeBSD/i386 BOOT
|
||||
<screen>>>FreeBSD/i386 BOOT
|
||||
Default: 1:ad(1,a)/boot/loader
|
||||
boot:</screen>
|
||||
</para></entry>
|
||||
|
@ -453,7 +453,7 @@ struct bootinfo {
|
|||
passing the execution to the loader's entry:</para>
|
||||
|
||||
<programlisting><filename>sys/boot/i386/boot2/boot2.c:</filename>
|
||||
__exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK),
|
||||
__exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK),
|
||||
MAKEBOOTDEV(dev_maj[dsk.type], 0, dsk.slice, dsk.unit, dsk.part),
|
||||
0, 0, 0, VTOP(&bootinfo));</programlisting>
|
||||
</sect1>
|
||||
|
@ -472,7 +472,7 @@ struct bootinfo {
|
|||
|
||||
<programlisting><filename>sys/boot/common/boot.c:</filename>
|
||||
/* Call the exec handler from the loader matching the kernel */
|
||||
module_formats[km->m_loader]->l_exec(km);</programlisting>
|
||||
module_formats[km->m_loader]->l_exec(km);</programlisting>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="boot-kernel">
|
||||
|
@ -537,7 +537,7 @@ NON_GPROF_ENTRY(btext)</programlisting>
|
|||
they do:</para>
|
||||
|
||||
<informaltable frame="none" pgwide="1">
|
||||
<tgroup cols=2 align=left>
|
||||
<tgroup cols="2" align="left">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><function>recover_bootinfo</function></entry>
|
||||
|
@ -783,7 +783,7 @@ struct gate_descriptor *idt = &idt0[0]; /* interrupt descriptor table */
|
|||
/* skipped */
|
||||
#ifdef DDB
|
||||
kdb_init();
|
||||
if (boothowto & RB_KDB)
|
||||
if (boothowto & RB_KDB)
|
||||
Debugger("Boot flags requested debugger");
|
||||
#endif</programlisting>
|
||||
|
||||
|
@ -801,7 +801,7 @@ struct gate_descriptor *idt = &idt0[0]; /* interrupt descriptor table */
|
|||
#define LSYS5SIGR_SEL 1
|
||||
#define L43BSDCALLS_SEL 2 /* notyet */
|
||||
#define LUCODE_SEL 3
|
||||
#define LSOL26CALLS_SEL 4 /* Solaris >= 2.6 system call gate */
|
||||
#define LSOL26CALLS_SEL 4 /* Solaris >= 2.6 system call gate */
|
||||
#define LUDATA_SEL 5
|
||||
/* separate stack, es,fs,gs sels ? */
|
||||
/* #define LPOSIXCALLS_SEL 5*/ /* notyet */
|
||||
|
@ -838,7 +838,7 @@ struct gate_descriptor *idt = &idt0[0]; /* interrupt descriptor table */
|
|||
/* ... skipped ... */
|
||||
|
||||
/* Call function */
|
||||
(*((*sipp)->func))((*sipp)->udata);
|
||||
(*((*sipp)->func))((*sipp)->udata);
|
||||
/* ... skipped ... */
|
||||
}</programlisting>
|
||||
|
||||
|
@ -1001,7 +1001,7 @@ create_init(const void *udata __unused)
|
|||
error = fork1(&proc0, RFFDG | RFPROC, &initproc);
|
||||
if (error)
|
||||
panic("cannot fork init: %d\n", error);
|
||||
initproc->p_flag |= P_INMEM | P_SYSTEM;
|
||||
initproc->p_flag |= P_INMEM | P_SYSTEM;
|
||||
cpu_set_fork_handler(initproc, start_init, NULL);
|
||||
remrunqueue(initproc);
|
||||
splx(s);
|
||||
|
|
|
@ -207,8 +207,8 @@ KMOD=skeleton
|
|||
|
||||
<para>This simple example pseudo-device remembers whatever values
|
||||
you write to it and can then supply them back to you when you
|
||||
read from it. Two versions are shown, one for &os; 4.X and
|
||||
one for &os; 5.X.</para>
|
||||
read from it. Two versions are shown, one for &os; 4.X and
|
||||
one for &os; 5.X.</para>
|
||||
|
||||
<example>
|
||||
<title>Example of a Sample Echo Pseudo-Device Driver for
|
||||
|
@ -220,7 +220,7 @@ KMOD=skeleton
|
|||
* Murray Stokely
|
||||
*/
|
||||
|
||||
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/module.h>
|
||||
|
@ -284,7 +284,7 @@ echo_loader(struct module *m, int what, void *arg)
|
|||
|
||||
switch (what) {
|
||||
case MOD_LOAD: /* kldload */
|
||||
sdev = make_dev(<literal>&</literal>echo_cdevsw,
|
||||
sdev = make_dev(<literal>&</literal>echo_cdevsw,
|
||||
0,
|
||||
UID_ROOT,
|
||||
GID_WHEEL,
|
||||
|
@ -338,9 +338,9 @@ echo_read(dev_t dev, struct uio *uio, int ioflag)
|
|||
* How big is this read operation? Either as big as the user wants,
|
||||
* or as big as the remaining data
|
||||
*/
|
||||
amt = MIN(uio->uio_resid, (echomsg->len - uio->uio_offset > 0) ?
|
||||
echomsg->len - uio->uio_offset : 0);
|
||||
if ((err = uiomove(echomsg->msg + uio->uio_offset,amt,uio)) != 0) {
|
||||
amt = MIN(uio->uio_resid, (echomsg->len - uio->uio_offset > 0) ?
|
||||
echomsg->len - uio->uio_offset : 0);
|
||||
if ((err = uiomove(echomsg->msg + uio->uio_offset,amt,uio)) != 0) {
|
||||
uprintf("uiomove failed!\n");
|
||||
}
|
||||
return(err);
|
||||
|
@ -357,12 +357,12 @@ echo_write(dev_t dev, struct uio *uio, int ioflag)
|
|||
int err = 0;
|
||||
|
||||
/* Copy the string in from user memory to kernel memory */
|
||||
err = copyin(uio->uio_iov->iov_base, echomsg->msg,
|
||||
MIN(uio->uio_iov->iov_len,BUFFERSIZE - 1));
|
||||
err = copyin(uio->uio_iov->iov_base, echomsg->msg,
|
||||
MIN(uio->uio_iov->iov_len,BUFFERSIZE - 1));
|
||||
|
||||
/* Now we need to null terminate, then record the length */
|
||||
*(echomsg->msg + MIN(uio->uio_iov->iov_len,BUFFERSIZE - 1)) = 0;
|
||||
echomsg->len = MIN(uio->uio_iov->iov_len,BUFFERSIZE);
|
||||
*(echomsg->msg + MIN(uio->uio_iov->iov_len,BUFFERSIZE - 1)) = 0;
|
||||
echomsg->len = MIN(uio->uio_iov->iov_len,BUFFERSIZE);
|
||||
|
||||
if (err != 0) {
|
||||
uprintf("Write failed: bad address!\n");
|
||||
|
@ -383,7 +383,7 @@ DEV_MODULE(echo,echo_loader,NULL);</programlisting>
|
|||
*
|
||||
* Murray Stokely
|
||||
*
|
||||
* Converted to 5.X by Søren (Xride) Straarup
|
||||
* Converted to 5.X by Søren (Xride) Straarup
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -440,7 +440,7 @@ echo_loader(struct module *m, int what, void *arg)
|
|||
|
||||
switch (what) {
|
||||
case MOD_LOAD: /* kldload */
|
||||
echo_dev = make_dev(<literal>&</literal>echo_cdevsw,
|
||||
echo_dev = make_dev(<literal>&</literal>echo_cdevsw,
|
||||
0,
|
||||
UID_ROOT,
|
||||
GID_WHEEL,
|
||||
|
|
|
@ -1368,28 +1368,28 @@
|
|||
</para>
|
||||
<para>
|
||||
Below are the typical call sequences when using a map depend
|
||||
on the use of the map. The characters -> are used to show
|
||||
on the use of the map. The characters -> are used to show
|
||||
the flow of time.
|
||||
</para>
|
||||
<para>
|
||||
For a buffer which stays practically fixed during all the
|
||||
time between attachment and detachment of a device:</para>
|
||||
<para>
|
||||
bus_dmamem_alloc -> bus_dmamap_load -> ...use buffer... ->
|
||||
-> bus_dmamap_unload -> bus_dmamem_free
|
||||
bus_dmamem_alloc -> bus_dmamap_load -> ...use buffer... ->
|
||||
-> bus_dmamap_unload -> bus_dmamem_free
|
||||
</para>
|
||||
|
||||
<para>For a buffer that changes frequently and is passed from
|
||||
outside the driver:
|
||||
|
||||
<!-- XXX is this correct? -->
|
||||
<programlisting> bus_dmamap_create ->
|
||||
-> bus_dmamap_load -> bus_dmamap_sync(PRE...) -> do transfer ->
|
||||
-> bus_dmamap_sync(POST...) -> bus_dmamap_unload ->
|
||||
<programlisting> bus_dmamap_create ->
|
||||
-> bus_dmamap_load -> bus_dmamap_sync(PRE...) -> do transfer ->
|
||||
-> bus_dmamap_sync(POST...) -> bus_dmamap_unload ->
|
||||
...
|
||||
-> bus_dmamap_load -> bus_dmamap_sync(PRE...) -> do transfer ->
|
||||
-> bus_dmamap_sync(POST...) -> bus_dmamap_unload ->
|
||||
-> bus_dmamap_destroy </programlisting>
|
||||
-> bus_dmamap_load -> bus_dmamap_sync(PRE...) -> do transfer ->
|
||||
-> bus_dmamap_sync(POST...) -> bus_dmamap_unload ->
|
||||
-> bus_dmamap_destroy </programlisting>
|
||||
|
||||
</para>
|
||||
<para>
|
||||
|
@ -1817,8 +1817,8 @@
|
|||
int pnperror;
|
||||
int error = 0;
|
||||
|
||||
sc->dev = dev; /* link it back */
|
||||
sc->unit = unit; </programlisting>
|
||||
sc->dev = dev; /* link it back */
|
||||
sc->unit = unit; </programlisting>
|
||||
|
||||
<para>
|
||||
Then check for the PnP devices. The check is carried out by
|
||||
|
@ -1875,8 +1875,8 @@
|
|||
to get the port start value:
|
||||
</para>
|
||||
|
||||
<programlisting> sc->port0 = bus_get_resource_start(dev,
|
||||
SYS_RES_IOPORT, 0 /*rid*/); if(sc->port0 == 0) return ENXIO;
|
||||
<programlisting> sc->port0 = bus_get_resource_start(dev,
|
||||
SYS_RES_IOPORT, 0 /*rid*/); if(sc->port0 == 0) return ENXIO;
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
|
@ -1957,7 +1957,7 @@
|
|||
|
||||
<programlisting>
|
||||
if(pnperror /* only for non-PnP devices */
|
||||
&& bus_set_resource(dev, SYS_RES_IOPORT, 0, sc->port0,
|
||||
&& bus_set_resource(dev, SYS_RES_IOPORT, 0, sc->port0,
|
||||
XXX_PORT_COUNT)<0)
|
||||
return ENXIO;</programlisting>
|
||||
|
||||
|
@ -1968,12 +1968,12 @@
|
|||
</para>
|
||||
|
||||
<programlisting>
|
||||
sc->port0_rid = 0;
|
||||
sc->port0_r = bus_alloc_resource(dev, SYS_RES_IOPORT,
|
||||
&sc->port0_rid,
|
||||
sc->port0_rid = 0;
|
||||
sc->port0_r = bus_alloc_resource(dev, SYS_RES_IOPORT,
|
||||
&sc->port0_rid,
|
||||
/*start*/ 0, /*end*/ ~0, /*count*/ 0, RF_ACTIVE);
|
||||
|
||||
if(sc->port0_r == NULL)
|
||||
if(sc->port0_r == NULL)
|
||||
return ENXIO;</programlisting>
|
||||
|
||||
<para>
|
||||
|
@ -2047,12 +2047,12 @@
|
|||
</para>
|
||||
<programlisting>
|
||||
/* try to find out the config address first */
|
||||
sc->mem0_p = bus_get_resource_start(dev, SYS_RES_MEMORY, 0 /*rid*/);
|
||||
if(sc->mem0_p == 0) { /* nope, not specified by user */
|
||||
sc->mem0_p = xxx_read_mem0_from_device_config(sc);
|
||||
sc->mem0_p = bus_get_resource_start(dev, SYS_RES_MEMORY, 0 /*rid*/);
|
||||
if(sc->mem0_p == 0) { /* nope, not specified by user */
|
||||
sc->mem0_p = xxx_read_mem0_from_device_config(sc);
|
||||
|
||||
|
||||
if(sc->mem0_p == 0)
|
||||
if(sc->mem0_p == 0)
|
||||
/* can't get it from device config registers either */
|
||||
goto bad;
|
||||
} else {
|
||||
|
@ -2068,27 +2068,27 @@
|
|||
* resource which will be automatically handled by the ISA bus.
|
||||
*/
|
||||
if(pnperror) { /* only for non-PnP devices */
|
||||
sc->mem0_size = bus_get_resource_count(dev, SYS_RES_MEMORY, 0 /*rid*/);
|
||||
if(sc->mem0_size == 0) /* not specified by user */
|
||||
sc->mem0_size = xxx_read_mem0_size_from_device_config(sc);
|
||||
sc->mem0_size = bus_get_resource_count(dev, SYS_RES_MEMORY, 0 /*rid*/);
|
||||
if(sc->mem0_size == 0) /* not specified by user */
|
||||
sc->mem0_size = xxx_read_mem0_size_from_device_config(sc);
|
||||
|
||||
if(sc->mem0_size == 0) {
|
||||
if(sc->mem0_size == 0) {
|
||||
/* suppose this is a very old model of device without
|
||||
* auto-configuration features and the user gave no preference,
|
||||
* so assume the minimalistic case
|
||||
* (of course, the real value will vary with the driver)
|
||||
*/
|
||||
sc->mem0_size = 8*1024;
|
||||
sc->mem0_size = 8*1024;
|
||||
}
|
||||
|
||||
if(xxx_set_mem0_size_on_device(sc) < 0)
|
||||
goto bad; /* device does not support that size */
|
||||
|
||||
if(bus_set_resource(dev, SYS_RES_MEMORY, /*rid*/0,
|
||||
sc->mem0_p, sc->mem0_size)<0)
|
||||
sc->mem0_p, sc->mem0_size)<0)
|
||||
goto bad;
|
||||
} else {
|
||||
sc->mem0_size = bus_get_resource_count(dev, SYS_RES_MEMORY, 0 /*rid*/);
|
||||
sc->mem0_size = bus_get_resource_count(dev, SYS_RES_MEMORY, 0 /*rid*/);
|
||||
} </programlisting>
|
||||
|
||||
<para>
|
||||
|
@ -2131,46 +2131,46 @@
|
|||
/* check every resource and free if not zero */
|
||||
|
||||
/* interrupt handler */
|
||||
if(sc->intr_r) {
|
||||
bus_teardown_intr(sc->dev, sc->intr_r, sc->intr_cookie);
|
||||
bus_release_resource(sc->dev, SYS_RES_IRQ, sc->intr_rid,
|
||||
sc->intr_r);
|
||||
sc->intr_r = 0;
|
||||
if(sc->intr_r) {
|
||||
bus_teardown_intr(sc->dev, sc->intr_r, sc->intr_cookie);
|
||||
bus_release_resource(sc->dev, SYS_RES_IRQ, sc->intr_rid,
|
||||
sc->intr_r);
|
||||
sc->intr_r = 0;
|
||||
}
|
||||
|
||||
/* all kinds of memory maps we could have allocated */
|
||||
if(sc->data_p) {
|
||||
bus_dmamap_unload(sc->data_tag, sc->data_map);
|
||||
sc->data_p = 0;
|
||||
if(sc->data_p) {
|
||||
bus_dmamap_unload(sc->data_tag, sc->data_map);
|
||||
sc->data_p = 0;
|
||||
}
|
||||
if(sc->data) { /* sc->data_map may be legitimately equal to 0 */
|
||||
if(sc->data) { /* sc->data_map may be legitimately equal to 0 */
|
||||
/* the map will also be freed */
|
||||
bus_dmamem_free(sc->data_tag, sc->data, sc->data_map);
|
||||
sc->data = 0;
|
||||
bus_dmamem_free(sc->data_tag, sc->data, sc->data_map);
|
||||
sc->data = 0;
|
||||
}
|
||||
if(sc->data_tag) {
|
||||
bus_dma_tag_destroy(sc->data_tag);
|
||||
sc->data_tag = 0;
|
||||
if(sc->data_tag) {
|
||||
bus_dma_tag_destroy(sc->data_tag);
|
||||
sc->data_tag = 0;
|
||||
}
|
||||
|
||||
... free other maps and tags if we have them ...
|
||||
|
||||
if(sc->parent_tag) {
|
||||
bus_dma_tag_destroy(sc->parent_tag);
|
||||
sc->parent_tag = 0;
|
||||
if(sc->parent_tag) {
|
||||
bus_dma_tag_destroy(sc->parent_tag);
|
||||
sc->parent_tag = 0;
|
||||
}
|
||||
|
||||
/* release all the bus resources */
|
||||
if(sc->mem0_r) {
|
||||
bus_release_resource(sc->dev, SYS_RES_MEMORY, sc->mem0_rid,
|
||||
sc->mem0_r);
|
||||
sc->mem0_r = 0;
|
||||
if(sc->mem0_r) {
|
||||
bus_release_resource(sc->dev, SYS_RES_MEMORY, sc->mem0_rid,
|
||||
sc->mem0_r);
|
||||
sc->mem0_r = 0;
|
||||
}
|
||||
...
|
||||
if(sc->port0_r) {
|
||||
bus_release_resource(sc->dev, SYS_RES_IOPORT, sc->port0_rid,
|
||||
sc->port0_r);
|
||||
sc->port0_r = 0;
|
||||
if(sc->port0_r) {
|
||||
bus_release_resource(sc->dev, SYS_RES_IOPORT, sc->port0_rid,
|
||||
sc->port0_r);
|
||||
sc->port0_r = 0;
|
||||
}
|
||||
}</programlisting>
|
||||
|
||||
|
@ -2215,30 +2215,30 @@
|
|||
considered an error).
|
||||
</para>
|
||||
|
||||
<programlisting> sc->port0_rid = 0;
|
||||
sc->port0_r = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->port0_rid,
|
||||
<programlisting> sc->port0_rid = 0;
|
||||
sc->port0_r = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->port0_rid,
|
||||
/*start*/ 0, /*end*/ ~0, /*count*/ 0, RF_ACTIVE);
|
||||
|
||||
if(sc->port0_r == NULL)
|
||||
if(sc->port0_r == NULL)
|
||||
return ENXIO;
|
||||
|
||||
/* on-board memory */
|
||||
sc->mem0_rid = 0;
|
||||
sc->mem0_r = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->mem0_rid,
|
||||
sc->mem0_rid = 0;
|
||||
sc->mem0_r = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->mem0_rid,
|
||||
/*start*/ 0, /*end*/ ~0, /*count*/ 0, RF_ACTIVE);
|
||||
|
||||
if(sc->mem0_r == NULL)
|
||||
if(sc->mem0_r == NULL)
|
||||
goto bad;
|
||||
|
||||
/* get its virtual address */
|
||||
sc->mem0_v = rman_get_virtual(sc->mem0_r);</programlisting>
|
||||
sc->mem0_v = rman_get_virtual(sc->mem0_r);</programlisting>
|
||||
|
||||
<para>The DMA request channel (DRQ) is allocated likewise. To
|
||||
initialize it use functions of the
|
||||
<function>isa_dma*()</function> family. For example:
|
||||
</para>
|
||||
|
||||
<para><function>isa_dmacascade(sc->drq0);</function></para>
|
||||
<para><function>isa_dmacascade(sc->drq0);</function></para>
|
||||
|
||||
<para>The interrupt request line (IRQ) is a bit
|
||||
special. Besides allocation the driver's interrupt handler
|
||||
|
@ -2257,19 +2257,19 @@
|
|||
</para>
|
||||
|
||||
<programlisting>
|
||||
sc->intr_rid = 0;
|
||||
sc->intr_r = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->intr_rid,
|
||||
sc->intr_rid = 0;
|
||||
sc->intr_r = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->intr_rid,
|
||||
/*start*/ 0, /*end*/ ~0, /*count*/ 0, RF_ACTIVE);
|
||||
|
||||
if(sc->intr_r == NULL)
|
||||
if(sc->intr_r == NULL)
|
||||
goto bad;
|
||||
|
||||
/*
|
||||
* XXX_INTR_TYPE is supposed to be defined depending on the type of
|
||||
* the driver, for example as INTR_TYPE_CAM for a CAM driver
|
||||
*/
|
||||
error = bus_setup_intr(dev, sc->intr_r, XXX_INTR_TYPE,
|
||||
(driver_intr_t *) xxx_intr, (void *) sc, &sc->intr_cookie);
|
||||
error = bus_setup_intr(dev, sc->intr_r, XXX_INTR_TYPE,
|
||||
(driver_intr_t *) xxx_intr, (void *) sc, &sc->intr_cookie);
|
||||
if(error)
|
||||
goto bad;
|
||||
|
||||
|
@ -2286,12 +2286,12 @@
|
|||
/*maxsize*/ BUS_SPACE_MAXSIZE_24BIT,
|
||||
/*nsegments*/ BUS_SPACE_UNRESTRICTED,
|
||||
/*maxsegsz*/ BUS_SPACE_MAXSIZE_24BIT, /*flags*/ 0,
|
||||
&sc->parent_tag);
|
||||
&sc->parent_tag);
|
||||
if(error)
|
||||
goto bad;
|
||||
|
||||
/* many things get inherited from the parent tag
|
||||
* sc->data is supposed to point to the structure with the shared data,
|
||||
* sc->data is supposed to point to the structure with the shared data,
|
||||
* for example for a ring buffer it could be:
|
||||
* struct {
|
||||
* u_short rd_pos;
|
||||
|
@ -2299,21 +2299,21 @@
|
|||
* char bf[XXX_RING_BUFFER_SIZE]
|
||||
* } *data;
|
||||
*/
|
||||
error=bus_dma_tag_create(sc->parent_tag, 1,
|
||||
error=bus_dma_tag_create(sc->parent_tag, 1,
|
||||
0, BUS_SPACE_MAXADDR, 0, /*filter*/ NULL, /*filterarg*/ NULL,
|
||||
/*maxsize*/ sizeof(* sc->data), /*nsegments*/ 1,
|
||||
/*maxsegsz*/ sizeof(* sc->data), /*flags*/ 0,
|
||||
&sc->data_tag);
|
||||
/*maxsize*/ sizeof(* sc->data), /*nsegments*/ 1,
|
||||
/*maxsegsz*/ sizeof(* sc->data), /*flags*/ 0,
|
||||
&sc->data_tag);
|
||||
if(error)
|
||||
goto bad;
|
||||
|
||||
error = bus_dmamem_alloc(sc->data_tag, &sc->data, /* flags*/ 0,
|
||||
&sc->data_map);
|
||||
error = bus_dmamem_alloc(sc->data_tag, &sc->data, /* flags*/ 0,
|
||||
&sc->data_map);
|
||||
if(error)
|
||||
goto bad;
|
||||
|
||||
/* xxx_alloc_callback() just saves the physical address at
|
||||
* the pointer passed as its argument, in this case &sc->data_p.
|
||||
* the pointer passed as its argument, in this case &sc->data_p.
|
||||
* See details in the section on bus memory mapping.
|
||||
* It can be implemented like:
|
||||
*
|
||||
|
@ -2324,8 +2324,8 @@
|
|||
* *(bus_addr_t *)arg = seg[0].ds_addr;
|
||||
* }
|
||||
*/
|
||||
bus_dmamap_load(sc->data_tag, sc->data_map, (void *)sc->data,
|
||||
sizeof (* sc->data), xxx_alloc_callback, (void *) &sc->data_p,
|
||||
bus_dmamap_load(sc->data_tag, sc->data_map, (void *)sc->data,
|
||||
sizeof (* sc->data), xxx_alloc_callback, (void *) &sc->data_p,
|
||||
/*flags*/0);</programlisting>
|
||||
|
||||
|
||||
|
@ -2343,7 +2343,7 @@
|
|||
device it may do so, for example:</para>
|
||||
|
||||
<programlisting>
|
||||
device_printf(dev, "has on-card FIFO buffer of %d bytes\n", sc->fifosize);
|
||||
device_printf(dev, "has on-card FIFO buffer of %d bytes\n", sc->fifosize);
|
||||
</programlisting>
|
||||
|
||||
<para>If the initialization routine experiences any problems
|
||||
|
|
|
@ -214,20 +214,20 @@ jail(p, uap)
|
|||
syscallarg(struct jail *) jail;
|
||||
} */ *uap;</programlisting>
|
||||
|
||||
<para>Therefore, <literal>uap->jail</literal> would access the
|
||||
<para>Therefore, <literal>uap->jail</literal> would access the
|
||||
jail structure which was passed to the system call. Next,
|
||||
the system call copies the jail structure into kernel space
|
||||
using the <literal>copyin()</literal>
|
||||
function. <literal>copyin()</literal> takes three arguments:
|
||||
the data which is to be copied into kernel space,
|
||||
<literal>uap->jail</literal>, where to store it,
|
||||
<literal>uap->jail</literal>, where to store it,
|
||||
<literal>j</literal> and the size of the storage. The jail
|
||||
structure <literal>uap->jail</literal> is copied into kernel
|
||||
structure <literal>uap->jail</literal> is copied into kernel
|
||||
space and stored in another jail structure,
|
||||
<literal>j</literal>.</para>
|
||||
|
||||
<programlisting><filename>/usr/src/sys/kern/kern_jail.c: </filename>
|
||||
error = copyin(uap->jail, <![CDATA[&j]]>, sizeof j);</programlisting>
|
||||
error = copyin(uap->jail, <![CDATA[&j]]>, sizeof j);</programlisting>
|
||||
|
||||
<para>There is another important structure defined in
|
||||
jail.h. It is the prison structure
|
||||
|
@ -251,7 +251,7 @@ struct prison {
|
|||
<programlisting><filename>/usr/src/sys/kern/kern_jail.c</filename>:
|
||||
MALLOC(pr, struct prison *, sizeof *pr , M_PRISON, M_WAITOK);
|
||||
bzero((caddr_t)pr, sizeof *pr);
|
||||
error = copyinstr(j.hostname, <![CDATA[&pr->pr_host]]>, sizeof pr->pr_host, 0);
|
||||
error = copyinstr(j.hostname, <![CDATA[&pr->pr_host]]>, sizeof pr->pr_host, 0);
|
||||
if (error)
|
||||
goto bail;</programlisting>
|
||||
|
||||
|
@ -292,20 +292,20 @@ struct prison *p_prison;
|
|||
<para>In <filename>kern_jail.c</filename>, the function then
|
||||
copies the pr structure, which is filled with all the
|
||||
information from the original jail structure, over to the
|
||||
<literal>p->p_prison</literal> structure. It then does a
|
||||
bitwise OR of <literal>p->p_flag</literal> with the constant
|
||||
<literal>p->p_prison</literal> structure. It then does a
|
||||
bitwise OR of <literal>p->p_flag</literal> with the constant
|
||||
<literal>P_JAILED</literal>, meaning that the calling
|
||||
process is now recognized as jailed. The parent process of
|
||||
each process, forked within the jail, is the program jail
|
||||
itself, as it calls the &man.jail.2; system call. When the
|
||||
program is executed through execve, it inherits the
|
||||
properties of its parents proc structure, therefore it has
|
||||
the <literal>p->p_flag</literal> set, and the
|
||||
<literal>p->p_prison</literal> structure is filled.</para>
|
||||
the <literal>p->p_flag</literal> set, and the
|
||||
<literal>p->p_prison</literal> structure is filled.</para>
|
||||
|
||||
<programlisting><filename>/usr/src/sys/kern/kern_jail.c</filename>
|
||||
p->p.prison = pr;
|
||||
p->p.flag |= P.JAILED;</programlisting>
|
||||
p->p.prison = pr;
|
||||
p->p.flag |= P.JAILED;</programlisting>
|
||||
|
||||
<para>When a process is forked from a parent process, the
|
||||
&man.fork.2; system call deals differently with imprisoned
|
||||
|
@ -316,15 +316,15 @@ p->p.flag |= P.JAILED;</programlisting>
|
|||
to the child's unfilled <literal>proc</literal>
|
||||
structure. After copying all relevant data between the
|
||||
structures, &man.fork.2; checks if the structure
|
||||
<literal>p->p_prison</literal> is filled on
|
||||
<literal>p->p_prison</literal> is filled on
|
||||
<literal>p2</literal>. If it is, it increments the
|
||||
<literal>pr.ref</literal> by one, and sets the
|
||||
<literal>p_flag</literal> to one on the child process.</para>
|
||||
|
||||
<programlisting><filename>/usr/src/sys/kern/kern_fork.c</filename>:
|
||||
if (p2->p_prison) {
|
||||
p2->p_prison->pr_ref++;
|
||||
p2->p_flag |= P_JAILED;
|
||||
if (p2->p_prison) {
|
||||
p2->p_prison->pr_ref++;
|
||||
p2->p_flag |= P_JAILED;
|
||||
}</programlisting>
|
||||
|
||||
</sect3>
|
||||
|
@ -339,7 +339,7 @@ if (p2->p_prison) {
|
|||
the process is jailed, and if so, returns an error. For
|
||||
example:</para>
|
||||
|
||||
<programlisting>if (p->p_prison)
|
||||
<programlisting>if (p->p_prison)
|
||||
return EPERM;</programlisting>
|
||||
|
||||
<sect2>
|
||||
|
@ -385,7 +385,7 @@ if (p2->p_prison) {
|
|||
conditional:</para>
|
||||
|
||||
<programlisting><filename>/usr/src/sys/kern/sysv msg.c</filename>:
|
||||
if (!jail.sysvipc.allowed && p->p_prison != NULL)
|
||||
if (!jail.sysvipc.allowed && p->p_prison != NULL)
|
||||
return (ENOSYS);</programlisting>
|
||||
|
||||
<indexterm><primary>semaphores</primary></indexterm>
|
||||
|
@ -473,9 +473,9 @@ int socreate(dom, aso, type, proto, p)
|
|||
register struct protosw *prp;
|
||||
...
|
||||
{
|
||||
if (p->p_prison && jail_socket_unixiproute_only &&
|
||||
prp->pr_domain->dom_family != PR_LOCAL && prp->pr_domain->dom_family != PF_INET
|
||||
&& prp->pr_domain->dom_family != PF_ROUTE)
|
||||
if (p->p_prison && jail_socket_unixiproute_only &&
|
||||
prp->pr_domain->dom_family != PR_LOCAL && prp->pr_domain->dom_family != PF_INET
|
||||
&& prp->pr_domain->dom_family != PF_ROUTE)
|
||||
return (EPROTONOSUPPORT);
|
||||
...
|
||||
}</programlisting>
|
||||
|
@ -498,7 +498,7 @@ register struct protosw *prp;
|
|||
static int bpfopen(dev, flags, fmt, p)
|
||||
...
|
||||
{
|
||||
if (p->p_prison)
|
||||
if (p->p_prison)
|
||||
return (EPERM);
|
||||
...
|
||||
}</programlisting>
|
||||
|
@ -538,8 +538,8 @@ int in.pcbbind(int, nam, p)
|
|||
if (nam) {
|
||||
sin = (struct sockaddr.in *)nam;
|
||||
...
|
||||
if (sin->sin_addr.s_addr != INADDR_ANY)
|
||||
if (prison.ip(p, 0, <![CDATA[&sin]]>->sin.addr.s_addr))
|
||||
if (sin->sin_addr.s_addr != INADDR_ANY)
|
||||
if (prison.ip(p, 0, <![CDATA[&sin]]>->sin.addr.s_addr))
|
||||
return (EINVAL);
|
||||
....
|
||||
}
|
||||
|
@ -559,7 +559,7 @@ int in.pcbbind(int, nam, p)
|
|||
int prison_ip(struct proc *p, int flag, u_int32_t *ip) {
|
||||
u_int32_t tmp;
|
||||
|
||||
if (!p->p_prison)
|
||||
if (!p->p_prison)
|
||||
return (0);
|
||||
if (flag)
|
||||
tmp = *ip;
|
||||
|
@ -567,12 +567,12 @@ int prison_ip(struct proc *p, int flag, u_int32_t *ip) {
|
|||
|
||||
if (tmp == INADDR_ANY) {
|
||||
if (flag)
|
||||
*ip = p->p_prison->pr_ip;
|
||||
else *ip = htonl(p->p_prison->pr_ip);
|
||||
*ip = p->p_prison->pr_ip;
|
||||
else *ip = htonl(p->p_prison->pr_ip);
|
||||
return (0);
|
||||
}
|
||||
|
||||
if (p->p_prison->pr_ip != tmp)
|
||||
if (p->p_prison->pr_ip != tmp)
|
||||
return (1);
|
||||
return (0);
|
||||
}</programlisting>
|
||||
|
@ -584,13 +584,13 @@ int prison_ip(struct proc *p, int flag, u_int32_t *ip) {
|
|||
<programlisting><filename>/usr/src/sys/net inet/in_pcb.c</filename>
|
||||
if (nam) {
|
||||
...
|
||||
lport = sin->sin.port;
|
||||
lport = sin->sin.port;
|
||||
... if (lport) {
|
||||
...
|
||||
if (p && p->p_prison)
|
||||
if (p && p->p_prison)
|
||||
prison = 1;
|
||||
if (prison &&
|
||||
prison_ip(p, 0, <![CDATA[&sin]]>->sin_addr.s_addr))
|
||||
if (prison &&
|
||||
prison_ip(p, 0, <![CDATA[&sin]]>->sin_addr.s_addr))
|
||||
return (EADDRNOTAVAIL);</programlisting>
|
||||
|
||||
</sect2>
|
||||
|
@ -607,10 +607,10 @@ int prison_ip(struct proc *p, int flag, u_int32_t *ip) {
|
|||
int ufs.setattr(ap)
|
||||
...
|
||||
{
|
||||
if ((cred->cr.uid == 0) && (p->prison == NULL)) {
|
||||
if ((ip->i_flags
|
||||
& (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND)) &&
|
||||
securelevel > 0)
|
||||
if ((cred->cr.uid == 0) && (p->prison == NULL)) {
|
||||
if ((ip->i_flags
|
||||
& (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND)) &&
|
||||
securelevel > 0)
|
||||
return (EPERM);
|
||||
}</programlisting>
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
<para>These indirections can be visualized as the
|
||||
following:</para>
|
||||
|
||||
<programlisting>object->cache<->class</programlisting>
|
||||
<programlisting>object->cache<->class</programlisting>
|
||||
|
||||
</sect1>
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@
|
|||
<para>A list of data structures or data structure members
|
||||
that this entry protects. For data structure members, the
|
||||
name will be in the form of
|
||||
<structname/structure name/.<structfield/member name/.</para>
|
||||
<structname/structure name/.<structfield/member name/.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
@ -153,38 +153,38 @@
|
|||
<varname>cnt.v_swtch</varname>,
|
||||
<varname>cp_time</varname>,
|
||||
<varname>curpriority</varname>,
|
||||
<structname/mtx/.<structfield/mtx_blocked/,
|
||||
<structname/mtx/.<structfield/mtx_contested/,
|
||||
<structname/proc/.<structfield/p_procq/,
|
||||
<structname/proc/.<structfield/p_slpq/,
|
||||
<structname/proc/.<structfield/p_sflag/
|
||||
<structname/proc/.<structfield/p_stat/,
|
||||
<structname/proc/.<structfield/p_estcpu/,
|
||||
<structname/proc/.<structfield/p_cpticks/
|
||||
<structname/proc/.<structfield/p_pctcpu/,
|
||||
<structname/proc/.<structfield/p_wchan/,
|
||||
<structname/proc/.<structfield/p_wmesg/,
|
||||
<structname/proc/.<structfield/p_swtime/,
|
||||
<structname/proc/.<structfield/p_slptime/,
|
||||
<structname/proc/.<structfield/p_runtime/,
|
||||
<structname/proc/.<structfield/p_uu/,
|
||||
<structname/proc/.<structfield/p_su/,
|
||||
<structname/proc/.<structfield/p_iu/,
|
||||
<structname/proc/.<structfield/p_uticks/,
|
||||
<structname/proc/.<structfield/p_sticks/,
|
||||
<structname/proc/.<structfield/p_iticks/,
|
||||
<structname/proc/.<structfield/p_oncpu/,
|
||||
<structname/proc/.<structfield/p_lastcpu/,
|
||||
<structname/proc/.<structfield/p_rqindex/,
|
||||
<structname/proc/.<structfield/p_heldmtx/,
|
||||
<structname/proc/.<structfield/p_blocked/,
|
||||
<structname/proc/.<structfield/p_mtxname/,
|
||||
<structname/proc/.<structfield/p_contested/,
|
||||
<structname/proc/.<structfield/p_priority/,
|
||||
<structname/proc/.<structfield/p_usrpri/,
|
||||
<structname/proc/.<structfield/p_nativepri/,
|
||||
<structname/proc/.<structfield/p_nice/,
|
||||
<structname/proc/.<structfield/p_rtprio/,
|
||||
<structname/mtx/.<structfield/mtx_blocked/,
|
||||
<structname/mtx/.<structfield/mtx_contested/,
|
||||
<structname/proc/.<structfield/p_procq/,
|
||||
<structname/proc/.<structfield/p_slpq/,
|
||||
<structname/proc/.<structfield/p_sflag/
|
||||
<structname/proc/.<structfield/p_stat/,
|
||||
<structname/proc/.<structfield/p_estcpu/,
|
||||
<structname/proc/.<structfield/p_cpticks/
|
||||
<structname/proc/.<structfield/p_pctcpu/,
|
||||
<structname/proc/.<structfield/p_wchan/,
|
||||
<structname/proc/.<structfield/p_wmesg/,
|
||||
<structname/proc/.<structfield/p_swtime/,
|
||||
<structname/proc/.<structfield/p_slptime/,
|
||||
<structname/proc/.<structfield/p_runtime/,
|
||||
<structname/proc/.<structfield/p_uu/,
|
||||
<structname/proc/.<structfield/p_su/,
|
||||
<structname/proc/.<structfield/p_iu/,
|
||||
<structname/proc/.<structfield/p_uticks/,
|
||||
<structname/proc/.<structfield/p_sticks/,
|
||||
<structname/proc/.<structfield/p_iticks/,
|
||||
<structname/proc/.<structfield/p_oncpu/,
|
||||
<structname/proc/.<structfield/p_lastcpu/,
|
||||
<structname/proc/.<structfield/p_rqindex/,
|
||||
<structname/proc/.<structfield/p_heldmtx/,
|
||||
<structname/proc/.<structfield/p_blocked/,
|
||||
<structname/proc/.<structfield/p_mtxname/,
|
||||
<structname/proc/.<structfield/p_contested/,
|
||||
<structname/proc/.<structfield/p_priority/,
|
||||
<structname/proc/.<structfield/p_usrpri/,
|
||||
<structname/proc/.<structfield/p_nativepri/,
|
||||
<structname/proc/.<structfield/p_nice/,
|
||||
<structname/proc/.<structfield/p_rtprio/,
|
||||
<varname>pscnt</varname>,
|
||||
<varname>slpque</varname>,
|
||||
<varname>itqueuebits</varname>,
|
||||
|
@ -259,8 +259,8 @@
|
|||
<varname>callfree</varname>,
|
||||
<varname>callwheel</varname>,
|
||||
<varname>nextsoftcheck</varname>,
|
||||
<structname/proc/.<structfield/p_itcallout/,
|
||||
<structname/proc/.<structfield/p_slpcallout/,
|
||||
<structname/proc/.<structfield/p_itcallout/,
|
||||
<structname/proc/.<structfield/p_slpcallout/,
|
||||
<varname>softticks</varname>,
|
||||
<varname>ticks</varname>
|
||||
</entry>
|
||||
|
@ -302,16 +302,16 @@
|
|||
<varname>allproc</varname>
|
||||
<varname>zombproc</varname>
|
||||
<varname>pidhashtbl</varname>
|
||||
<structname/proc/.<structfield/p_list/
|
||||
<structname/proc/.<structfield/p_hash/
|
||||
<structname/proc/.<structfield/p_list/
|
||||
<structname/proc/.<structfield/p_hash/
|
||||
<varname>nextpid</varname>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><varname>proctree_lock</varname></entry>
|
||||
<entry>
|
||||
<structname/proc/.<structfield/p_children/
|
||||
<structname/proc/.<structfield/p_sibling/
|
||||
<structname/proc/.<structfield/p_children/
|
||||
<structname/proc/.<structfield/p_sibling/
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
|
@ -334,7 +334,7 @@
|
|||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para><structname/mtx/.<structfield/mtx_lock/</para>
|
||||
<para><structname/mtx/.<structfield/mtx_lock/</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</sect1>
|
||||
|
|
|
@ -2210,9 +2210,9 @@
|
|||
(object-specific wait) \
|
||||
Label creation o
|
||||
\
|
||||
Relabel events, o--<--.
|
||||
Relabel events, o--<--.
|
||||
Various object-specific, | |
|
||||
Access control events ~-->--o
|
||||
Access control events ~-->--o
|
||||
\
|
||||
Label destruction o</programlisting>
|
||||
|
||||
|
@ -2301,7 +2301,7 @@ Label destruction o</programlisting>
|
|||
<row>
|
||||
<entry><parameter>fslabel</parameter></entry>
|
||||
<entry>Devfs file system label
|
||||
(<varname>mp->mnt_fslabel</varname>)</entry>
|
||||
(<varname>mp->mnt_fslabel</varname>)</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
|
@ -4422,8 +4422,6 @@ Label destruction o</programlisting>
|
|||
update label.</para>
|
||||
</sect4>
|
||||
|
||||
|
||||
|
||||
</sect3>
|
||||
</sect2>
|
||||
|
||||
|
|
|
@ -228,8 +228,8 @@ wi_pccard_probe(dev)
|
|||
|
||||
if ((pp = pccard_product_lookup(dev, wi_pccard_products,
|
||||
sizeof(wi_pccard_products[0]), NULL)) != NULL) {
|
||||
if (pp->pp_name != NULL)
|
||||
device_set_desc(dev, pp->pp_name);
|
||||
if (pp->pp_name != NULL)
|
||||
device_set_desc(dev, pp->pp_name);
|
||||
return (0);
|
||||
}
|
||||
return (ENXIO);
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
* Murray Stokely
|
||||
*/
|
||||
|
||||
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
|
||||
|
||||
#include <sys/param.h> /* defines used in kernel.h */
|
||||
#include <sys/module.h>
|
||||
|
@ -127,7 +127,7 @@ mypci_attach(device_t dev)
|
|||
{
|
||||
|
||||
printf("MyPCI Attach for : deviceID : 0x%x\n",pci_get_vendor(dev));
|
||||
sdev = make_dev(<literal>&</literal>mypci_cdevsw, 0, UID_ROOT,
|
||||
sdev = make_dev(<literal>&</literal>mypci_cdevsw, 0, UID_ROOT,
|
||||
GID_WHEEL, 0600, "mypci");
|
||||
printf("Mypci device loaded.\n");
|
||||
return (ENXIO);
|
||||
|
@ -235,27 +235,27 @@ DRIVER_MODULE(mypci, pci, mypci_driver, mypci_devclass, 0, 0);</programlisting>
|
|||
<para>For example, a typical driver might have something similar
|
||||
to this in the <function>attach()</function> function:</para>
|
||||
|
||||
<programlisting> sc->bar0id = PCIR_BAR(0);
|
||||
sc->bar0res = bus_alloc_resource(dev, SYS_RES_MEMORY, &(sc->bar0id),
|
||||
<programlisting> sc->bar0id = PCIR_BAR(0);
|
||||
sc->bar0res = bus_alloc_resource(dev, SYS_RES_MEMORY, &(sc->bar0id),
|
||||
0, ~0, 1, RF_ACTIVE);
|
||||
if (sc->bar0res == NULL) {
|
||||
if (sc->bar0res == NULL) {
|
||||
printf("Memory allocation of PCI base register 0 failed!\n");
|
||||
error = ENXIO;
|
||||
goto fail1;
|
||||
}
|
||||
|
||||
sc->bar1id = PCIR_BAR(1);
|
||||
sc->bar1res = bus_alloc_resource(dev, SYS_RES_MEMORY, &(sc->bar1id),
|
||||
sc->bar1id = PCIR_BAR(1);
|
||||
sc->bar1res = bus_alloc_resource(dev, SYS_RES_MEMORY, &(sc->bar1id),
|
||||
0, ~0, 1, RF_ACTIVE);
|
||||
if (sc->bar1res == NULL) {
|
||||
if (sc->bar1res == NULL) {
|
||||
printf("Memory allocation of PCI base register 1 failed!\n");
|
||||
error = ENXIO;
|
||||
goto fail2;
|
||||
}
|
||||
sc->bar0_bt = rman_get_bustag(sc->bar0res);
|
||||
sc->bar0_bh = rman_get_bushandle(sc->bar0res);
|
||||
sc->bar1_bt = rman_get_bustag(sc->bar1res);
|
||||
sc->bar1_bh = rman_get_bushandle(sc->bar1res);</programlisting>
|
||||
sc->bar0_bt = rman_get_bustag(sc->bar0res);
|
||||
sc->bar0_bh = rman_get_bushandle(sc->bar0res);
|
||||
sc->bar1_bt = rman_get_bustag(sc->bar1res);
|
||||
sc->bar1_bh = rman_get_bushandle(sc->bar1res);</programlisting>
|
||||
|
||||
<para>Handles for each base address register are kept in the
|
||||
<structname>softc</structname> structure so that they can be
|
||||
|
@ -268,7 +268,7 @@ DRIVER_MODULE(mypci, pci, mypci_driver, mypci_devclass, 0, 0);</programlisting>
|
|||
|
||||
<programlisting>uint16_t
|
||||
board_read(struct ni_softc *sc, uint16_t address) {
|
||||
return bus_space_read_2(sc->bar1_bt, sc->bar1_bh, address);
|
||||
return bus_space_read_2(sc->bar1_bt, sc->bar1_bh, address);
|
||||
}
|
||||
</programlisting>
|
||||
|
||||
|
@ -276,7 +276,7 @@ board_read(struct ni_softc *sc, uint16_t address) {
|
|||
|
||||
<programlisting>void
|
||||
board_write(struct ni_softc *sc, uint16_t address, uint16_t value) {
|
||||
bus_space_write_2(sc->bar1_bt, sc->bar1_bh, address, value);
|
||||
bus_space_write_2(sc->bar1_bt, sc->bar1_bh, address, value);
|
||||
}
|
||||
</programlisting>
|
||||
|
||||
|
@ -301,10 +301,10 @@ board_write(struct ni_softc *sc, uint16_t address, uint16_t value) {
|
|||
|
||||
<programlisting>/* Get the IRQ resource */
|
||||
|
||||
sc->irqid = 0x0;
|
||||
sc->irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &(sc->irqid),
|
||||
sc->irqid = 0x0;
|
||||
sc->irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &(sc->irqid),
|
||||
0, ~0, 1, RF_SHAREABLE | RF_ACTIVE);
|
||||
if (sc->irqres == NULL) {
|
||||
if (sc->irqres == NULL) {
|
||||
printf("IRQ allocation failed!\n");
|
||||
error = ENXIO;
|
||||
goto fail3;
|
||||
|
@ -312,15 +312,15 @@ board_write(struct ni_softc *sc, uint16_t address, uint16_t value) {
|
|||
|
||||
/* Now we should set up the interrupt handler */
|
||||
|
||||
error = bus_setup_intr(dev, sc->irqres, INTR_TYPE_MISC,
|
||||
my_handler, sc, &(sc->handler));
|
||||
error = bus_setup_intr(dev, sc->irqres, INTR_TYPE_MISC,
|
||||
my_handler, sc, &(sc->handler));
|
||||
if (error) {
|
||||
printf("Couldn't set up irq\n");
|
||||
goto fail4;
|
||||
}
|
||||
|
||||
sc->irq_bt = rman_get_bustag(sc->irqres);
|
||||
sc->irq_bh = rman_get_bushandle(sc->irqres);
|
||||
sc->irq_bt = rman_get_bustag(sc->irqres);
|
||||
sc->irq_bh = rman_get_bushandle(sc->irqres);
|
||||
</programlisting>
|
||||
|
||||
<para>Some care must be taken in the detach routine of the
|
||||
|
|
|
@ -281,8 +281,8 @@
|
|||
error; /* some code to handle the error */
|
||||
}
|
||||
|
||||
softc->wpath = path;
|
||||
softc->sim = sim;</programlisting>
|
||||
softc->wpath = path;
|
||||
softc->sim = sim;</programlisting>
|
||||
|
||||
<para>As you can see the path includes:</para>
|
||||
|
||||
|
@ -385,15 +385,15 @@
|
|||
switch:</para>
|
||||
|
||||
<programlisting> struct xxx_softc *softc = (struct xxx_softc *) cam_sim_softc(sim);
|
||||
struct ccb_hdr *ccb_h = &ccb->ccb_h;
|
||||
struct ccb_hdr *ccb_h = &ccb->ccb_h;
|
||||
int unit = cam_sim_unit(sim);
|
||||
int bus = cam_sim_bus(sim);
|
||||
|
||||
switch(ccb_h->func_code) {
|
||||
switch(ccb_h->func_code) {
|
||||
case ...:
|
||||
...
|
||||
default:
|
||||
ccb_h->status = CAM_REQ_INVALID;
|
||||
ccb_h->status = CAM_REQ_INVALID;
|
||||
xpt_done(ccb);
|
||||
break;
|
||||
}</programlisting>
|
||||
|
@ -584,9 +584,9 @@
|
|||
make sure that the command did not get aborted when it was
|
||||
sitting in the queue:</para>
|
||||
|
||||
<programlisting> struct ccb_scsiio *csio = &ccb->csio;
|
||||
<programlisting> struct ccb_scsiio *csio = &ccb->csio;
|
||||
|
||||
if ((ccb_h->status & CAM_STATUS_MASK) != CAM_REQ_INPROG) {
|
||||
if ((ccb_h->status & CAM_STATUS_MASK) != CAM_REQ_INPROG) {
|
||||
xpt_done(ccb);
|
||||
return;
|
||||
}</programlisting>
|
||||
|
@ -594,14 +594,14 @@
|
|||
<para>Also we check that the device is supported at all by our
|
||||
controller:</para>
|
||||
|
||||
<programlisting> if(ccb_h->target_id > OUR_MAX_SUPPORTED_TARGET_ID
|
||||
|| cch_h->target_id == OUR_SCSI_CONTROLLERS_OWN_ID) {
|
||||
ccb_h->status = CAM_TID_INVALID;
|
||||
<programlisting> if(ccb_h->target_id > OUR_MAX_SUPPORTED_TARGET_ID
|
||||
|| cch_h->target_id == OUR_SCSI_CONTROLLERS_OWN_ID) {
|
||||
ccb_h->status = CAM_TID_INVALID;
|
||||
xpt_done(ccb);
|
||||
return;
|
||||
}
|
||||
if(ccb_h->target_lun > OUR_MAX_SUPPORTED_LUN) {
|
||||
ccb_h->status = CAM_LUN_INVALID;
|
||||
if(ccb_h->target_lun > OUR_MAX_SUPPORTED_LUN) {
|
||||
ccb_h->status = CAM_LUN_INVALID;
|
||||
xpt_done(ccb);
|
||||
return;
|
||||
}</programlisting>
|
||||
|
@ -621,15 +621,15 @@
|
|||
<programlisting> struct xxx_hcb *hcb = allocate_hcb(softc, unit, bus);
|
||||
|
||||
if(hcb == NULL) {
|
||||
softc->flags |= RESOURCE_SHORTAGE;
|
||||
softc->flags |= RESOURCE_SHORTAGE;
|
||||
xpt_freeze_simq(sim, /*count*/1);
|
||||
ccb_h->status = CAM_REQUEUE_REQ;
|
||||
ccb_h->status = CAM_REQUEUE_REQ;
|
||||
xpt_done(ccb);
|
||||
return;
|
||||
}
|
||||
|
||||
hcb->ccb = ccb; ccb_h->ccb_hcb = (void *)hcb;
|
||||
ccb_h->status |= CAM_SIM_QUEUED;</programlisting>
|
||||
hcb->ccb = ccb; ccb_h->ccb_hcb = (void *)hcb;
|
||||
ccb_h->status |= CAM_SIM_QUEUED;</programlisting>
|
||||
|
||||
<para>Extract the target data from CCB into the hardware control
|
||||
block. Check if we are asked to assign a tag and if yes then
|
||||
|
@ -638,10 +638,10 @@
|
|||
devices to set the maximal mutually supported bus width,
|
||||
synchronous rate and offset.</para>
|
||||
|
||||
<programlisting> hcb->target = ccb_h->target_id; hcb->lun = ccb_h->target_lun;
|
||||
<programlisting> hcb->target = ccb_h->target_id; hcb->lun = ccb_h->target_lun;
|
||||
generate_identify_message(hcb);
|
||||
if( ccb_h->tag_action != CAM_TAG_ACTION_NONE )
|
||||
generate_unique_tag_message(hcb, ccb_h->tag_action);
|
||||
if( ccb_h->tag_action != CAM_TAG_ACTION_NONE )
|
||||
generate_unique_tag_message(hcb, ccb_h->tag_action);
|
||||
if( !target_negotiated(hcb) )
|
||||
generate_negotiation_messages(hcb);</programlisting>
|
||||
|
||||
|
@ -668,24 +668,24 @@
|
|||
back to a virtual address but with big pain, so we do not do
|
||||
that.</para>
|
||||
|
||||
<programlisting> if(ccb_h->flags & CAM_CDB_POINTER) {
|
||||
<programlisting> if(ccb_h->flags & CAM_CDB_POINTER) {
|
||||
/* CDB is a pointer */
|
||||
if(!(ccb_h->flags & CAM_CDB_PHYS)) {
|
||||
if(!(ccb_h->flags & CAM_CDB_PHYS)) {
|
||||
/* CDB pointer is virtual */
|
||||
hcb->cmd = vtobus(csio->cdb_io.cdb_ptr);
|
||||
hcb->cmd = vtobus(csio->cdb_io.cdb_ptr);
|
||||
} else {
|
||||
/* CDB pointer is physical */
|
||||
#if defined(__alpha__)
|
||||
hcb->cmd = csio->cdb_io.cdb_ptr | alpha_XXX_dmamap_or ;
|
||||
hcb->cmd = csio->cdb_io.cdb_ptr | alpha_XXX_dmamap_or ;
|
||||
#else
|
||||
hcb->cmd = csio->cdb_io.cdb_ptr ;
|
||||
hcb->cmd = csio->cdb_io.cdb_ptr ;
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
/* CDB is in the ccb (buffer) */
|
||||
hcb->cmd = vtobus(csio->cdb_io.cdb_bytes);
|
||||
hcb->cmd = vtobus(csio->cdb_io.cdb_bytes);
|
||||
}
|
||||
hcb->cmdlen = csio->cdb_len;</programlisting>
|
||||
hcb->cmdlen = csio->cdb_len;</programlisting>
|
||||
|
||||
<para>Now it is time to set up the data. Again, the data storage
|
||||
may be specified in the CCB in many interesting ways,
|
||||
|
@ -693,7 +693,7 @@
|
|||
data transfer. The simplest case is if there is no data to
|
||||
transfer:</para>
|
||||
|
||||
<programlisting> int dir = (ccb_h->flags & CAM_DIR_MASK);
|
||||
<programlisting> int dir = (ccb_h->flags & CAM_DIR_MASK);
|
||||
|
||||
if (dir == CAM_DIR_NONE)
|
||||
goto end_data;</programlisting>
|
||||
|
@ -719,25 +719,25 @@
|
|||
|
||||
initialize_hcb_for_data(hcb);
|
||||
|
||||
if((!(ccb_h->flags & CAM_SCATTER_VALID)) {
|
||||
if((!(ccb_h->flags & CAM_SCATTER_VALID)) {
|
||||
/* single buffer */
|
||||
if(!(ccb_h->flags & CAM_DATA_PHYS)) {
|
||||
rv = add_virtual_chunk(hcb, csio->data_ptr, csio->dxfer_len, dir);
|
||||
if(!(ccb_h->flags & CAM_DATA_PHYS)) {
|
||||
rv = add_virtual_chunk(hcb, csio->data_ptr, csio->dxfer_len, dir);
|
||||
}
|
||||
} else {
|
||||
rv = add_physical_chunk(hcb, csio->data_ptr, csio->dxfer_len, dir);
|
||||
rv = add_physical_chunk(hcb, csio->data_ptr, csio->dxfer_len, dir);
|
||||
}
|
||||
} else {
|
||||
int i;
|
||||
struct bus_dma_segment *segs;
|
||||
segs = (struct bus_dma_segment *)csio->data_ptr;
|
||||
segs = (struct bus_dma_segment *)csio->data_ptr;
|
||||
|
||||
if ((ccb_h->flags & CAM_SG_LIST_PHYS) != 0) {
|
||||
if ((ccb_h->flags & CAM_SG_LIST_PHYS) != 0) {
|
||||
/* The SG list pointer is physical */
|
||||
rv = setup_hcb_for_physical_sg_list(hcb, segs, csio->sglist_cnt);
|
||||
} else if (!(ccb_h->flags & CAM_DATA_PHYS)) {
|
||||
rv = setup_hcb_for_physical_sg_list(hcb, segs, csio->sglist_cnt);
|
||||
} else if (!(ccb_h->flags & CAM_DATA_PHYS)) {
|
||||
/* SG buffer pointers are virtual */
|
||||
for (i = 0; i < csio->sglist_cnt; i++) {
|
||||
for (i = 0; i < csio->sglist_cnt; i++) {
|
||||
rv = add_virtual_chunk(hcb, segs[i].ds_addr,
|
||||
segs[i].ds_len, dir);
|
||||
if (rv != CAM_REQ_CMP)
|
||||
|
@ -745,7 +745,7 @@
|
|||
}
|
||||
} else {
|
||||
/* SG buffer pointers are physical */
|
||||
for (i = 0; i < csio->sglist_cnt; i++) {
|
||||
for (i = 0; i < csio->sglist_cnt; i++) {
|
||||
rv = add_physical_chunk(hcb, segs[i].ds_addr,
|
||||
segs[i].ds_len, dir);
|
||||
if (rv != CAM_REQ_CMP)
|
||||
|
@ -767,7 +767,7 @@
|
|||
<para>If disconnection is disabled for this CCB we pass this
|
||||
information to the hcb:</para>
|
||||
|
||||
<programlisting> if(ccb_h->flags & CAM_DIS_DISCONNECT)
|
||||
<programlisting> if(ccb_h->flags & CAM_DIS_DISCONNECT)
|
||||
hcb_disable_disconnect(hcb);</programlisting>
|
||||
|
||||
<para>If the controller is able to run REQUEST SENSE command all
|
||||
|
@ -779,8 +779,8 @@
|
|||
to the hardware and return, the rest will be done by the
|
||||
interrupt handler (or timeout handler).</para>
|
||||
|
||||
<programlisting> ccb_h->timeout_ch = timeout(xxx_timeout, (caddr_t) hcb,
|
||||
(ccb_h->timeout * hz) / 1000); /* convert milliseconds to ticks */
|
||||
<programlisting> ccb_h->timeout_ch = timeout(xxx_timeout, (caddr_t) hcb,
|
||||
(ccb_h->timeout * hz) / 1000); /* convert milliseconds to ticks */
|
||||
put_hcb_into_hardware_queue(hcb);
|
||||
return;</programlisting>
|
||||
|
||||
|
@ -790,20 +790,20 @@
|
|||
<programlisting> static void
|
||||
free_hcb_and_ccb_done(struct xxx_hcb *hcb, union ccb *ccb, u_int32_t status)
|
||||
{
|
||||
struct xxx_softc *softc = hcb->softc;
|
||||
struct xxx_softc *softc = hcb->softc;
|
||||
|
||||
ccb->ccb_h.ccb_hcb = 0;
|
||||
ccb->ccb_h.ccb_hcb = 0;
|
||||
if(hcb != NULL) {
|
||||
untimeout(xxx_timeout, (caddr_t) hcb, ccb->ccb_h.timeout_ch);
|
||||
untimeout(xxx_timeout, (caddr_t) hcb, ccb->ccb_h.timeout_ch);
|
||||
/* we're about to free a hcb, so the shortage has ended */
|
||||
if(softc->flags & RESOURCE_SHORTAGE) {
|
||||
softc->flags &= ~RESOURCE_SHORTAGE;
|
||||
if(softc->flags & RESOURCE_SHORTAGE) {
|
||||
softc->flags &= ~RESOURCE_SHORTAGE;
|
||||
status |= CAM_RELEASE_SIMQ;
|
||||
}
|
||||
free_hcb(hcb); /* also removes hcb from any internal lists */
|
||||
}
|
||||
ccb->ccb_h.status = status |
|
||||
(ccb->ccb_h.status & ~(CAM_STATUS_MASK|CAM_SIM_QUEUED));
|
||||
ccb->ccb_h.status = status |
|
||||
(ccb->ccb_h.status & ~(CAM_STATUS_MASK|CAM_SIM_QUEUED));
|
||||
xpt_done(ccb);
|
||||
}</programlisting>
|
||||
</listitem>
|
||||
|
@ -856,9 +856,9 @@
|
|||
reset_scsi_bus(softc);
|
||||
|
||||
/* drop all enqueued CCBs */
|
||||
for(h = softc->first_queued_hcb; h != NULL; h = hh) {
|
||||
hh = h->next;
|
||||
free_hcb_and_ccb_done(h, h->ccb, CAM_SCSI_BUS_RESET);
|
||||
for(h = softc->first_queued_hcb; h != NULL; h = hh) {
|
||||
hh = h->next;
|
||||
free_hcb_and_ccb_done(h, h->ccb, CAM_SCSI_BUS_RESET);
|
||||
}
|
||||
|
||||
/* the clean values of negotiations to report */
|
||||
|
@ -868,7 +868,7 @@
|
|||
| CCB_TRANS_SYNC_RATE_VALID | CCB_TRANS_SYNC_OFFSET_VALID);
|
||||
|
||||
/* drop all disconnected CCBs and clean negotiations */
|
||||
for(targ=0; targ <= OUR_MAX_SUPPORTED_TARGET; targ++) {
|
||||
for(targ=0; targ <= OUR_MAX_SUPPORTED_TARGET; targ++) {
|
||||
clean_negotiations(softc, targ);
|
||||
|
||||
/* report the event if possible */
|
||||
|
@ -879,18 +879,18 @@
|
|||
xpt_free_path(path);
|
||||
}
|
||||
|
||||
for(lun=0; lun <= OUR_MAX_SUPPORTED_LUN; lun++)
|
||||
for(h = softc->first_discon_hcb[targ][lun]; h != NULL; h = hh) {
|
||||
hh=h->next;
|
||||
free_hcb_and_ccb_done(h, h->ccb, CAM_SCSI_BUS_RESET);
|
||||
for(lun=0; lun <= OUR_MAX_SUPPORTED_LUN; lun++)
|
||||
for(h = softc->first_discon_hcb[targ][lun]; h != NULL; h = hh) {
|
||||
hh=h->next;
|
||||
free_hcb_and_ccb_done(h, h->ccb, CAM_SCSI_BUS_RESET);
|
||||
}
|
||||
}
|
||||
|
||||
ccb->ccb_h.status = CAM_REQ_CMP;
|
||||
ccb->ccb_h.status = CAM_REQ_CMP;
|
||||
xpt_done(ccb);
|
||||
|
||||
/* report the event */
|
||||
xpt_async(AC_BUS_RESET, softc->wpath, NULL);
|
||||
xpt_async(AC_BUS_RESET, softc->wpath, NULL);
|
||||
return;</programlisting>
|
||||
|
||||
<para>Implementing the SCSI bus reset as a function may be a good
|
||||
|
@ -915,10 +915,10 @@
|
|||
check that abort applies to a SCSI transaction:</para>
|
||||
|
||||
<programlisting> struct ccb *abort_ccb;
|
||||
abort_ccb = ccb->cab.abort_ccb;
|
||||
abort_ccb = ccb->cab.abort_ccb;
|
||||
|
||||
if(abort_ccb->ccb_h.func_code != XPT_SCSI_IO) {
|
||||
ccb->ccb_h.status = CAM_UA_ABORT;
|
||||
if(abort_ccb->ccb_h.func_code != XPT_SCSI_IO) {
|
||||
ccb->ccb_h.status = CAM_UA_ABORT;
|
||||
xpt_done(ccb);
|
||||
return;
|
||||
}</programlisting>
|
||||
|
@ -931,12 +931,12 @@
|
|||
|
||||
hcb = NULL;
|
||||
|
||||
/* We assume that softc->first_hcb is the head of the list of all
|
||||
/* We assume that softc->first_hcb is the head of the list of all
|
||||
* HCBs associated with this bus, including those enqueued for
|
||||
* processing, being processed by hardware and disconnected ones.
|
||||
*/
|
||||
for(h = softc->first_hcb; h != NULL; h = h->next) {
|
||||
if(h->ccb == abort_ccb) {
|
||||
for(h = softc->first_hcb; h != NULL; h = h->next) {
|
||||
if(h->ccb == abort_ccb) {
|
||||
hcb = h;
|
||||
break;
|
||||
}
|
||||
|
@ -944,7 +944,7 @@
|
|||
|
||||
if(hcb == NULL) {
|
||||
/* no such CCB in our queue */
|
||||
ccb->ccb_h.status = CAM_PATH_INVALID;
|
||||
ccb->ccb_h.status = CAM_PATH_INVALID;
|
||||
xpt_done(ccb);
|
||||
return;
|
||||
}
|
||||
|
@ -994,14 +994,14 @@
|
|||
yet).</para>
|
||||
|
||||
<programlisting> case HCB_BEING_TRANSFERRED:
|
||||
untimeout(xxx_timeout, (caddr_t) hcb, abort_ccb->ccb_h.timeout_ch);
|
||||
abort_ccb->ccb_h.timeout_ch =
|
||||
untimeout(xxx_timeout, (caddr_t) hcb, abort_ccb->ccb_h.timeout_ch);
|
||||
abort_ccb->ccb_h.timeout_ch =
|
||||
timeout(xxx_timeout, (caddr_t) hcb, 10 * hz);
|
||||
abort_ccb->ccb_h.status = CAM_REQ_ABORTED;
|
||||
abort_ccb->ccb_h.status = CAM_REQ_ABORTED;
|
||||
/* ask the controller to abort that HCB, then generate
|
||||
* an interrupt and stop
|
||||
*/
|
||||
if(signal_hardware_to_abort_hcb_and_stop(hcb) < 0) {
|
||||
if(signal_hardware_to_abort_hcb_and_stop(hcb) < 0) {
|
||||
/* oops, we missed the race with hardware, this transaction
|
||||
* got off the bus before we aborted it, try again */
|
||||
goto abort_again;
|
||||
|
@ -1015,14 +1015,14 @@
|
|||
completed.</para>
|
||||
|
||||
<programlisting> case HCB_DISCONNECTED:
|
||||
untimeout(xxx_timeout, (caddr_t) hcb, abort_ccb->ccb_h.timeout_ch);
|
||||
abort_ccb->ccb_h.timeout_ch =
|
||||
untimeout(xxx_timeout, (caddr_t) hcb, abort_ccb->ccb_h.timeout_ch);
|
||||
abort_ccb->ccb_h.timeout_ch =
|
||||
timeout(xxx_timeout, (caddr_t) hcb, 10 * hz);
|
||||
put_abort_message_into_hcb(hcb);
|
||||
put_hcb_at_the_front_of_hardware_queue(hcb);
|
||||
break;
|
||||
}
|
||||
ccb->ccb_h.status = CAM_REQ_CMP;
|
||||
ccb->ccb_h.status = CAM_REQ_CMP;
|
||||
xpt_done(ccb);
|
||||
return;</programlisting>
|
||||
|
||||
|
@ -1041,18 +1041,18 @@
|
|||
|
||||
<programlisting> case XPT_ABORT:
|
||||
struct ccb *abort_ccb;
|
||||
abort_ccb = ccb->cab.abort_ccb;
|
||||
abort_ccb = ccb->cab.abort_ccb;
|
||||
|
||||
if(abort_ccb->ccb_h.func_code != XPT_SCSI_IO) {
|
||||
ccb->ccb_h.status = CAM_UA_ABORT;
|
||||
if(abort_ccb->ccb_h.func_code != XPT_SCSI_IO) {
|
||||
ccb->ccb_h.status = CAM_UA_ABORT;
|
||||
xpt_done(ccb);
|
||||
return;
|
||||
}
|
||||
if(xxx_abort_ccb(abort_ccb, CAM_REQ_ABORTED) < 0)
|
||||
if(xxx_abort_ccb(abort_ccb, CAM_REQ_ABORTED) < 0)
|
||||
/* no such CCB in our queue */
|
||||
ccb->ccb_h.status = CAM_PATH_INVALID;
|
||||
ccb->ccb_h.status = CAM_PATH_INVALID;
|
||||
else
|
||||
ccb->ccb_h.status = CAM_REQ_CMP;
|
||||
ccb->ccb_h.status = CAM_REQ_CMP;
|
||||
xpt_done(ccb);
|
||||
return;</programlisting>
|
||||
</listitem>
|
||||
|
@ -1153,47 +1153,47 @@ of the union ccb:</para>
|
|||
int targ, lun;
|
||||
int flags;
|
||||
|
||||
cts = &ccb->cts;
|
||||
targ = ccb_h->target_id;
|
||||
lun = ccb_h->target_lun;
|
||||
flags = cts->flags;
|
||||
cts = &ccb->cts;
|
||||
targ = ccb_h->target_id;
|
||||
lun = ccb_h->target_lun;
|
||||
flags = cts->flags;
|
||||
if(flags & CCB_TRANS_USER_SETTINGS) {
|
||||
if(flags & CCB_TRANS_SYNC_RATE_VALID)
|
||||
softc->user_sync_period[targ] = cts->sync_period;
|
||||
softc->user_sync_period[targ] = cts->sync_period;
|
||||
if(flags & CCB_TRANS_SYNC_OFFSET_VALID)
|
||||
softc->user_sync_offset[targ] = cts->sync_offset;
|
||||
softc->user_sync_offset[targ] = cts->sync_offset;
|
||||
if(flags & CCB_TRANS_BUS_WIDTH_VALID)
|
||||
softc->user_bus_width[targ] = cts->bus_width;
|
||||
softc->user_bus_width[targ] = cts->bus_width;
|
||||
|
||||
if(flags & CCB_TRANS_DISC_VALID) {
|
||||
softc->user_tflags[targ][lun] &= ~CCB_TRANS_DISC_ENB;
|
||||
softc->user_tflags[targ][lun] |= flags & CCB_TRANS_DISC_ENB;
|
||||
softc->user_tflags[targ][lun] &= ~CCB_TRANS_DISC_ENB;
|
||||
softc->user_tflags[targ][lun] |= flags & CCB_TRANS_DISC_ENB;
|
||||
}
|
||||
if(flags & CCB_TRANS_TQ_VALID) {
|
||||
softc->user_tflags[targ][lun] &= ~CCB_TRANS_TQ_ENB;
|
||||
softc->user_tflags[targ][lun] |= flags & CCB_TRANS_TQ_ENB;
|
||||
softc->user_tflags[targ][lun] &= ~CCB_TRANS_TQ_ENB;
|
||||
softc->user_tflags[targ][lun] |= flags & CCB_TRANS_TQ_ENB;
|
||||
}
|
||||
}
|
||||
if(flags & CCB_TRANS_CURRENT_SETTINGS) {
|
||||
if(flags & CCB_TRANS_SYNC_RATE_VALID)
|
||||
softc->goal_sync_period[targ] =
|
||||
max(cts->sync_period, OUR_MIN_SUPPORTED_PERIOD);
|
||||
softc->goal_sync_period[targ] =
|
||||
max(cts->sync_period, OUR_MIN_SUPPORTED_PERIOD);
|
||||
if(flags & CCB_TRANS_SYNC_OFFSET_VALID)
|
||||
softc->goal_sync_offset[targ] =
|
||||
min(cts->sync_offset, OUR_MAX_SUPPORTED_OFFSET);
|
||||
softc->goal_sync_offset[targ] =
|
||||
min(cts->sync_offset, OUR_MAX_SUPPORTED_OFFSET);
|
||||
if(flags & CCB_TRANS_BUS_WIDTH_VALID)
|
||||
softc->goal_bus_width[targ] = min(cts->bus_width, OUR_BUS_WIDTH);
|
||||
softc->goal_bus_width[targ] = min(cts->bus_width, OUR_BUS_WIDTH);
|
||||
|
||||
if(flags & CCB_TRANS_DISC_VALID) {
|
||||
softc->current_tflags[targ][lun] &= ~CCB_TRANS_DISC_ENB;
|
||||
softc->current_tflags[targ][lun] |= flags & CCB_TRANS_DISC_ENB;
|
||||
softc->current_tflags[targ][lun] &= ~CCB_TRANS_DISC_ENB;
|
||||
softc->current_tflags[targ][lun] |= flags & CCB_TRANS_DISC_ENB;
|
||||
}
|
||||
if(flags & CCB_TRANS_TQ_VALID) {
|
||||
softc->current_tflags[targ][lun] &= ~CCB_TRANS_TQ_ENB;
|
||||
softc->current_tflags[targ][lun] |= flags & CCB_TRANS_TQ_ENB;
|
||||
softc->current_tflags[targ][lun] &= ~CCB_TRANS_TQ_ENB;
|
||||
softc->current_tflags[targ][lun] |= flags & CCB_TRANS_TQ_ENB;
|
||||
}
|
||||
}
|
||||
ccb->ccb_h.status = CAM_REQ_CMP;
|
||||
ccb->ccb_h.status = CAM_REQ_CMP;
|
||||
xpt_done(ccb);
|
||||
return;</programlisting>
|
||||
|
||||
|
@ -1205,12 +1205,12 @@ of the union ccb:</para>
|
|||
<programlisting> int
|
||||
target_negotiated(struct xxx_hcb *hcb)
|
||||
{
|
||||
struct softc *softc = hcb->softc;
|
||||
int targ = hcb->targ;
|
||||
struct softc *softc = hcb->softc;
|
||||
int targ = hcb->targ;
|
||||
|
||||
if( softc->current_sync_period[targ] != softc->goal_sync_period[targ]
|
||||
|| softc->current_sync_offset[targ] != softc->goal_sync_offset[targ]
|
||||
|| softc->current_bus_width[targ] != softc->goal_bus_width[targ] )
|
||||
if( softc->current_sync_period[targ] != softc->goal_sync_period[targ]
|
||||
|| softc->current_sync_offset[targ] != softc->goal_sync_offset[targ]
|
||||
|| softc->current_bus_width[targ] != softc->goal_bus_width[targ] )
|
||||
return 0; /* FALSE */
|
||||
else
|
||||
return 1; /* TRUE */
|
||||
|
@ -1275,21 +1275,21 @@ of the union ccb:</para>
|
|||
u_int32_t secs_per_cylinder;
|
||||
int extended;
|
||||
|
||||
ccg = &ccb->ccg;
|
||||
size_mb = ccg->volume_size
|
||||
/ ((1024L * 1024L) / ccg->block_size);
|
||||
ccg = &ccb->ccg;
|
||||
size_mb = ccg->volume_size
|
||||
/ ((1024L * 1024L) / ccg->block_size);
|
||||
extended = check_cards_EEPROM_for_extended_geometry(softc);
|
||||
|
||||
if (size_mb > 1024 && extended) {
|
||||
ccg->heads = 255;
|
||||
ccg->secs_per_track = 63;
|
||||
if (size_mb > 1024 && extended) {
|
||||
ccg->heads = 255;
|
||||
ccg->secs_per_track = 63;
|
||||
} else {
|
||||
ccg->heads = 64;
|
||||
ccg->secs_per_track = 32;
|
||||
ccg->heads = 64;
|
||||
ccg->secs_per_track = 32;
|
||||
}
|
||||
secs_per_cylinder = ccg->heads * ccg->secs_per_track;
|
||||
ccg->cylinders = ccg->volume_size / secs_per_cylinder;
|
||||
ccb->ccb_h.status = CAM_REQ_CMP;
|
||||
secs_per_cylinder = ccg->heads * ccg->secs_per_track;
|
||||
ccg->cylinders = ccg->volume_size / secs_per_cylinder;
|
||||
ccb->ccb_h.status = CAM_REQ_CMP;
|
||||
xpt_done(ccb);
|
||||
return;</programlisting>
|
||||
|
||||
|
@ -1413,7 +1413,7 @@ ccb_pathinq cpi</quote> of the union ccb:</para>
|
|||
<para>The recommended way of setting the string fields is using
|
||||
strncpy, like:</para>
|
||||
|
||||
<programlisting> strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);</programlisting>
|
||||
<programlisting> strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);</programlisting>
|
||||
|
||||
<para>After setting the values set the status to CAM_REQ_CMP and mark the
|
||||
CCB as done.</para>
|
||||
|
@ -1500,7 +1500,7 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
|
|||
switch (code) {
|
||||
case AC_LOST_DEVICE:
|
||||
targ = xpt_path_target_id(path);
|
||||
if(targ <= OUR_MAX_SUPPORTED_TARGET) {
|
||||
if(targ <= OUR_MAX_SUPPORTED_TARGET) {
|
||||
clean_negotiations(softc, targ);
|
||||
/* send indication to CAM */
|
||||
neg.bus_width = 8;
|
||||
|
@ -1585,9 +1585,9 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
|
|||
struct xxx_hcb *h, *hh;
|
||||
|
||||
/* drop all enqueued CCBs */
|
||||
for(h = softc->first_queued_hcb; h != NULL; h = hh) {
|
||||
hh = h->next;
|
||||
free_hcb_and_ccb_done(h, h->ccb, CAM_SCSI_BUS_RESET);
|
||||
for(h = softc->first_queued_hcb; h != NULL; h = hh) {
|
||||
hh = h->next;
|
||||
free_hcb_and_ccb_done(h, h->ccb, CAM_SCSI_BUS_RESET);
|
||||
}
|
||||
|
||||
/* the clean values of negotiations to report */
|
||||
|
@ -1597,7 +1597,7 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
|
|||
| CCB_TRANS_SYNC_RATE_VALID | CCB_TRANS_SYNC_OFFSET_VALID);
|
||||
|
||||
/* drop all disconnected CCBs and clean negotiations */
|
||||
for(targ=0; targ <= OUR_MAX_SUPPORTED_TARGET; targ++) {
|
||||
for(targ=0; targ <= OUR_MAX_SUPPORTED_TARGET; targ++) {
|
||||
clean_negotiations(softc, targ);
|
||||
|
||||
/* report the event if possible */
|
||||
|
@ -1608,18 +1608,18 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
|
|||
xpt_free_path(path);
|
||||
}
|
||||
|
||||
for(lun=0; lun <= OUR_MAX_SUPPORTED_LUN; lun++)
|
||||
for(h = softc->first_discon_hcb[targ][lun]; h != NULL; h = hh) {
|
||||
hh=h->next;
|
||||
for(lun=0; lun <= OUR_MAX_SUPPORTED_LUN; lun++)
|
||||
for(h = softc->first_discon_hcb[targ][lun]; h != NULL; h = hh) {
|
||||
hh=h->next;
|
||||
if(fatal)
|
||||
free_hcb_and_ccb_done(h, h->ccb, CAM_UNREC_HBA_ERROR);
|
||||
free_hcb_and_ccb_done(h, h->ccb, CAM_UNREC_HBA_ERROR);
|
||||
else
|
||||
free_hcb_and_ccb_done(h, h->ccb, CAM_SCSI_BUS_RESET);
|
||||
free_hcb_and_ccb_done(h, h->ccb, CAM_SCSI_BUS_RESET);
|
||||
}
|
||||
}
|
||||
|
||||
/* report the event */
|
||||
xpt_async(AC_BUS_RESET, softc->wpath, NULL);
|
||||
xpt_async(AC_BUS_RESET, softc->wpath, NULL);
|
||||
|
||||
/* re-initialization may take a lot of time, in such case
|
||||
* its completion should be signaled by another interrupt or
|
||||
|
@ -1656,7 +1656,7 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
|
|||
return;
|
||||
}
|
||||
|
||||
targ = hcb->target;
|
||||
targ = hcb->target;
|
||||
hcb_status = get_status_of_current_hcb(softc);</programlisting>
|
||||
|
||||
<para>First we check if the HCB has completed and if so we check
|
||||
|
@ -1668,13 +1668,13 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
|
|||
<para>Then look if this status is related to the REQUEST SENSE
|
||||
command and if so handle it in a simple way.</para>
|
||||
|
||||
<programlisting> if(hcb->flags & DOING_AUTOSENSE) {
|
||||
<programlisting> if(hcb->flags & DOING_AUTOSENSE) {
|
||||
if(scsi_status == GOOD) { /* autosense was successful */
|
||||
hcb->ccb->ccb_h.status |= CAM_AUTOSNS_VALID;
|
||||
free_hcb_and_ccb_done(hcb, hcb->ccb, CAM_SCSI_STATUS_ERROR);
|
||||
hcb->ccb->ccb_h.status |= CAM_AUTOSNS_VALID;
|
||||
free_hcb_and_ccb_done(hcb, hcb->ccb, CAM_SCSI_STATUS_ERROR);
|
||||
} else {
|
||||
autosense_failed:
|
||||
free_hcb_and_ccb_done(hcb, hcb->ccb, CAM_AUTOSENSE_FAIL);
|
||||
free_hcb_and_ccb_done(hcb, hcb->ccb, CAM_AUTOSENSE_FAIL);
|
||||
}
|
||||
schedule_next_hcb(softc);
|
||||
return;
|
||||
|
@ -1685,22 +1685,22 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
|
|||
command has failed with sense data then run REQUEST SENSE
|
||||
command to receive that data.</para>
|
||||
|
||||
<programlisting> hcb->ccb->csio.scsi_status = scsi_status;
|
||||
<programlisting> hcb->ccb->csio.scsi_status = scsi_status;
|
||||
calculate_residue(hcb);
|
||||
|
||||
if( (hcb->ccb->ccb_h.flags & CAM_DIS_AUTOSENSE)==0
|
||||
if( (hcb->ccb->ccb_h.flags & CAM_DIS_AUTOSENSE)==0
|
||||
&& ( scsi_status == CHECK_CONDITION
|
||||
|| scsi_status == COMMAND_TERMINATED) ) {
|
||||
/* start auto-SENSE */
|
||||
hcb->flags |= DOING_AUTOSENSE;
|
||||
hcb->flags |= DOING_AUTOSENSE;
|
||||
setup_autosense_command_in_hcb(hcb);
|
||||
restart_current_hcb(softc);
|
||||
return;
|
||||
}
|
||||
if(scsi_status == GOOD)
|
||||
free_hcb_and_ccb_done(hcb, hcb->ccb, CAM_REQ_CMP);
|
||||
free_hcb_and_ccb_done(hcb, hcb->ccb, CAM_REQ_CMP);
|
||||
else
|
||||
free_hcb_and_ccb_done(hcb, hcb->ccb, CAM_SCSI_STATUS_ERROR);
|
||||
free_hcb_and_ccb_done(hcb, hcb->ccb, CAM_SCSI_STATUS_ERROR);
|
||||
schedule_next_hcb(softc);
|
||||
return;
|
||||
}</programlisting>
|
||||
|
@ -1714,11 +1714,11 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
|
|||
<programlisting> switch(hcb_status) {
|
||||
case TARGET_REJECTED_WIDE_NEG:
|
||||
/* revert to 8-bit bus */
|
||||
softc->current_bus_width[targ] = softc->goal_bus_width[targ] = 8;
|
||||
softc->current_bus_width[targ] = softc->goal_bus_width[targ] = 8;
|
||||
/* report the event */
|
||||
neg.bus_width = 8;
|
||||
neg.valid = CCB_TRANS_BUS_WIDTH_VALID;
|
||||
xpt_async(AC_TRANSFER_NEG, hcb->ccb.ccb_h.path_id, &neg);
|
||||
xpt_async(AC_TRANSFER_NEG, hcb->ccb.ccb_h.path_id, &neg);
|
||||
continue_current_hcb(softc);
|
||||
return;
|
||||
case TARGET_ANSWERED_WIDE_NEG:
|
||||
|
@ -1726,14 +1726,14 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
|
|||
int wd;
|
||||
|
||||
wd = get_target_bus_width_request(softc);
|
||||
if(wd <= softc->goal_bus_width[targ]) {
|
||||
if(wd <= softc->goal_bus_width[targ]) {
|
||||
/* answer is acceptable */
|
||||
softc->current_bus_width[targ] =
|
||||
softc->goal_bus_width[targ] = neg.bus_width = wd;
|
||||
softc->current_bus_width[targ] =
|
||||
softc->goal_bus_width[targ] = neg.bus_width = wd;
|
||||
|
||||
/* report the event */
|
||||
neg.valid = CCB_TRANS_BUS_WIDTH_VALID;
|
||||
xpt_async(AC_TRANSFER_NEG, hcb->ccb.ccb_h.path_id, &neg);
|
||||
xpt_async(AC_TRANSFER_NEG, hcb->ccb.ccb_h.path_id, &neg);
|
||||
} else {
|
||||
prepare_reject_message(hcb);
|
||||
}
|
||||
|
@ -1746,16 +1746,16 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
|
|||
|
||||
wd = get_target_bus_width_request(softc);
|
||||
wd = min (wd, OUR_BUS_WIDTH);
|
||||
wd = min (wd, softc->user_bus_width[targ]);
|
||||
wd = min (wd, softc->user_bus_width[targ]);
|
||||
|
||||
if(wd != softc->current_bus_width[targ]) {
|
||||
if(wd != softc->current_bus_width[targ]) {
|
||||
/* the bus width has changed */
|
||||
softc->current_bus_width[targ] =
|
||||
softc->goal_bus_width[targ] = neg.bus_width = wd;
|
||||
softc->current_bus_width[targ] =
|
||||
softc->goal_bus_width[targ] = neg.bus_width = wd;
|
||||
|
||||
/* report the event */
|
||||
neg.valid = CCB_TRANS_BUS_WIDTH_VALID;
|
||||
xpt_async(AC_TRANSFER_NEG, hcb->ccb.ccb_h.path_id, &neg);
|
||||
xpt_async(AC_TRANSFER_NEG, hcb->ccb.ccb_h.path_id, &neg);
|
||||
}
|
||||
prepare_width_nego_rsponse(hcb, wd);
|
||||
}
|
||||
|
@ -1767,7 +1767,7 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
|
|||
auto-sense in the same simple-minded way as before. Otherwise we
|
||||
look closer at the details again.</para>
|
||||
|
||||
<programlisting> if(hcb->flags & DOING_AUTOSENSE)
|
||||
<programlisting> if(hcb->flags & DOING_AUTOSENSE)
|
||||
goto autosense_failed;
|
||||
|
||||
switch(hcb_status) {</programlisting>
|
||||
|
@ -1781,10 +1781,10 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
|
|||
/* abort affects all commands on that target+LUN, so
|
||||
* mark all disconnected HCBs on that target+LUN as aborted too
|
||||
*/
|
||||
for(h = softc->first_discon_hcb[hcb->target][hcb->lun];
|
||||
for(h = softc->first_discon_hcb[hcb->target][hcb->lun];
|
||||
h != NULL; h = hh) {
|
||||
hh=h->next;
|
||||
free_hcb_and_ccb_done(h, h->ccb, CAM_REQ_ABORTED);
|
||||
hh=h->next;
|
||||
free_hcb_and_ccb_done(h, h->ccb, CAM_REQ_ABORTED);
|
||||
}
|
||||
ccb_status = CAM_REQ_ABORTED;
|
||||
} else if(requested_bus_device_reset(hcb)) {
|
||||
|
@ -1794,15 +1794,15 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
|
|||
* mark all disconnected HCBs on that target+LUN as reset
|
||||
*/
|
||||
|
||||
for(lun=0; lun <= OUR_MAX_SUPPORTED_LUN; lun++)
|
||||
for(h = softc->first_discon_hcb[hcb->target][lun];
|
||||
for(lun=0; lun <= OUR_MAX_SUPPORTED_LUN; lun++)
|
||||
for(h = softc->first_discon_hcb[hcb->target][lun];
|
||||
h != NULL; h = hh) {
|
||||
hh=h->next;
|
||||
free_hcb_and_ccb_done(h, h->ccb, CAM_SCSI_BUS_RESET);
|
||||
hh=h->next;
|
||||
free_hcb_and_ccb_done(h, h->ccb, CAM_SCSI_BUS_RESET);
|
||||
}
|
||||
|
||||
/* send event */
|
||||
xpt_async(AC_SENT_BDR, hcb->ccb->ccb_h.path_id, NULL);
|
||||
xpt_async(AC_SENT_BDR, hcb->ccb->ccb_h.path_id, NULL);
|
||||
|
||||
/* this was the CAM_RESET_DEV request itself, it is completed */
|
||||
ccb_status = CAM_REQ_CMP;
|
||||
|
@ -1810,8 +1810,8 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
|
|||
calculate_residue(hcb);
|
||||
ccb_status = CAM_UNEXP_BUSFREE;
|
||||
/* request the further code to freeze the queue */
|
||||
hcb->ccb->ccb_h.status |= CAM_DEV_QFRZN;
|
||||
lun_to_freeze = hcb->lun;
|
||||
hcb->ccb->ccb_h.status |= CAM_DEV_QFRZN;
|
||||
lun_to_freeze = hcb->lun;
|
||||
}
|
||||
break;</programlisting>
|
||||
|
||||
|
@ -1822,12 +1822,12 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
|
|||
/* report the event */
|
||||
neg.flags = 0 & ~CCB_TRANS_TAG_ENB;
|
||||
neg.valid = CCB_TRANS_TQ_VALID;
|
||||
xpt_async(AC_TRANSFER_NEG, hcb->ccb.ccb_h.path_id, &neg);
|
||||
xpt_async(AC_TRANSFER_NEG, hcb->ccb.ccb_h.path_id, &neg);
|
||||
|
||||
ccb_status = CAM_MSG_REJECT_REC;
|
||||
/* request the further code to freeze the queue */
|
||||
hcb->ccb->ccb_h.status |= CAM_DEV_QFRZN;
|
||||
lun_to_freeze = hcb->lun;
|
||||
hcb->ccb->ccb_h.status |= CAM_DEV_QFRZN;
|
||||
lun_to_freeze = hcb->lun;
|
||||
break;</programlisting>
|
||||
|
||||
<para>Then we check a number of other conditions, with processing
|
||||
|
@ -1836,7 +1836,7 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
|
|||
<programlisting> case SELECTION_TIMEOUT:
|
||||
ccb_status = CAM_SEL_TIMEOUT;
|
||||
/* request the further code to freeze the queue */
|
||||
hcb->ccb->ccb_h.status |= CAM_DEV_QFRZN;
|
||||
hcb->ccb->ccb_h.status |= CAM_DEV_QFRZN;
|
||||
lun_to_freeze = CAM_LUN_WILDCARD;
|
||||
break;
|
||||
case PARITY_ERROR:
|
||||
|
@ -1850,7 +1850,7 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
|
|||
/* all other errors are handled in a generic way */
|
||||
ccb_status = CAM_REQ_CMP_ERR;
|
||||
/* request the further code to freeze the queue */
|
||||
hcb->ccb->ccb_h.status |= CAM_DEV_QFRZN;
|
||||
hcb->ccb->ccb_h.status |= CAM_DEV_QFRZN;
|
||||
lun_to_freeze = CAM_LUN_WILDCARD;
|
||||
break;
|
||||
}</programlisting>
|
||||
|
@ -1858,21 +1858,21 @@ ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)<
|
|||
<para>Then we check if the error was serious enough to freeze the
|
||||
input queue until it gets proceeded and do so if it is:</para>
|
||||
|
||||
<programlisting> if(hcb->ccb->ccb_h.status & CAM_DEV_QFRZN) {
|
||||
<programlisting> if(hcb->ccb->ccb_h.status & CAM_DEV_QFRZN) {
|
||||
/* freeze the queue */
|
||||
xpt_freeze_devq(ccb->ccb_h.path, /*count*/1);
|
||||
xpt_freeze_devq(ccb->ccb_h.path, /*count*/1);
|
||||
|
||||
/* re-queue all commands for this target/LUN back to CAM */
|
||||
|
||||
for(h = softc->first_queued_hcb; h != NULL; h = hh) {
|
||||
hh = h->next;
|
||||
for(h = softc->first_queued_hcb; h != NULL; h = hh) {
|
||||
hh = h->next;
|
||||
|
||||
if(targ == h->targ
|
||||
&& (lun_to_freeze == CAM_LUN_WILDCARD || lun_to_freeze == h->lun) )
|
||||
free_hcb_and_ccb_done(h, h->ccb, CAM_REQUEUE_REQ);
|
||||
if(targ == h->targ
|
||||
&& (lun_to_freeze == CAM_LUN_WILDCARD || lun_to_freeze == h->lun) )
|
||||
free_hcb_and_ccb_done(h, h->ccb, CAM_REQUEUE_REQ);
|
||||
}
|
||||
}
|
||||
free_hcb_and_ccb_done(hcb, hcb->ccb, ccb_status);
|
||||
free_hcb_and_ccb_done(hcb, hcb->ccb, ccb_status);
|
||||
schedule_next_hcb(softc);
|
||||
return;</programlisting>
|
||||
|
||||
|
@ -1989,14 +1989,14 @@ xxx_timeout(void *arg)
|
|||
struct xxx_softc *softc;
|
||||
struct ccb_hdr *ccb_h;
|
||||
|
||||
softc = hcb->softc;
|
||||
ccb_h = &hcb->ccb->ccb_h;
|
||||
softc = hcb->softc;
|
||||
ccb_h = &hcb->ccb->ccb_h;
|
||||
|
||||
if(hcb->flags & HCB_BEING_ABORTED
|
||||
|| ccb_h->func_code == XPT_RESET_DEV) {
|
||||
if(hcb->flags & HCB_BEING_ABORTED
|
||||
|| ccb_h->func_code == XPT_RESET_DEV) {
|
||||
xxx_reset_bus(softc);
|
||||
} else {
|
||||
xxx_abort_ccb(hcb->ccb, CAM_CMD_TIMEOUT);
|
||||
xxx_abort_ccb(hcb->ccb, CAM_CMD_TIMEOUT);
|
||||
}
|
||||
}</programlisting>
|
||||
|
||||
|
|
|
@ -587,7 +587,7 @@
|
|||
{
|
||||
struct sc_info *sc = mix_getdevinfo(m);
|
||||
[set volume level]
|
||||
return left | (right << 8);<co id="co-mxset-return">
|
||||
return left | (right << 8);<co id="co-mxset-return">
|
||||
}</programlisting>
|
||||
|
||||
<calloutlist>
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
|
||||
<para>The complete source code to FreeBSD is available from our
|
||||
public CVS repository. The source code is normally installed in
|
||||
<filename class=directory>/usr/src</filename> which contains the
|
||||
<filename class="directory">/usr/src</filename> which contains the
|
||||
following subdirectories:</para>
|
||||
|
||||
<para>
|
||||
|
@ -108,65 +108,65 @@
|
|||
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><filename class=directory>bin/</filename></entry>
|
||||
<entry><filename class="directory">bin/</filename></entry>
|
||||
<entry>Source for files in
|
||||
<filename>/bin</filename></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><filename class=directory>contrib/</filename></entry>
|
||||
<entry><filename class="directory">contrib/</filename></entry>
|
||||
<entry>Source for files from contributed software.</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><filename class=directory>crypto/</filename></entry>
|
||||
<entry><filename class="directory">crypto/</filename></entry>
|
||||
<entry>Cryptographical sources</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><filename class=directory>etc/</filename></entry>
|
||||
<entry><filename class="directory">etc/</filename></entry>
|
||||
<entry>Source for files in <filename
|
||||
class=directory>/etc</filename></entry>
|
||||
class="directory">/etc</filename></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><filename class=directory>games/</filename></entry>
|
||||
<entry><filename class="directory">games/</filename></entry>
|
||||
<entry>Source for files in <filename
|
||||
class=directory>/usr/games</filename></entry>
|
||||
class="directory">/usr/games</filename></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><filename class=directory>gnu/</filename></entry>
|
||||
<entry><filename class="directory">gnu/</filename></entry>
|
||||
<entry>Utilities covered by the GNU Public License</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><filename class=directory>include/</filename></entry>
|
||||
<entry><filename class="directory">include/</filename></entry>
|
||||
<entry>Source for files in <filename
|
||||
class=directory>/usr/include</filename></entry>
|
||||
class="directory">/usr/include</filename></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><filename
|
||||
class=directory>kerberos5/</filename></entry>
|
||||
class="directory">kerberos5/</filename></entry>
|
||||
<entry>Source for Kerberos version 5</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><filename class=directory>lib/</filename></entry>
|
||||
<entry><filename class="directory">lib/</filename></entry>
|
||||
<entry>Source for files in <filename
|
||||
class=directory>/usr/lib</filename></entry>
|
||||
class="directory">/usr/lib</filename></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><filename class=directory>libexec/</filename></entry>
|
||||
<entry><filename class="directory">libexec/</filename></entry>
|
||||
<entry>Source for files in <filename
|
||||
class=directory>/usr/libexec</filename></entry>
|
||||
class="directory">/usr/libexec</filename></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><filename
|
||||
class=directory>release/</filename></entry>
|
||||
class="directory">release/</filename></entry>
|
||||
<entry>Files required to produce a FreeBSD release</entry>
|
||||
</row>
|
||||
|
||||
|
@ -177,45 +177,45 @@
|
|||
</row>
|
||||
|
||||
<row>
|
||||
<entry><filename class=directory>sbin/</filename></entry>
|
||||
<entry><filename class="directory">sbin/</filename></entry>
|
||||
<entry>Source for files in <filename
|
||||
class=directory>/sbin</filename></entry>
|
||||
class="directory">/sbin</filename></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><filename class=directory>secure/</filename></entry>
|
||||
<entry><filename class="directory">secure/</filename></entry>
|
||||
<entry>FreeSec sources</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><filename class=directory>share/</filename></entry>
|
||||
<entry><filename class="directory">share/</filename></entry>
|
||||
<entry>Source for files in <filename
|
||||
class=directory>/usr/share</filename></entry>
|
||||
class="directory">/usr/share</filename></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><filename class=directory>sys/</filename></entry>
|
||||
<entry><filename class="directory">sys/</filename></entry>
|
||||
<entry>Kernel source files</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><filename class=directory>tools/</filename></entry>
|
||||
<entry><filename class="directory">tools/</filename></entry>
|
||||
<entry>Tools used for maintenance and testing of
|
||||
FreeBSD</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><filename
|
||||
class=directory>usr.bin/</filename></entry>
|
||||
class="directory">usr.bin/</filename></entry>
|
||||
<entry>Source for files in <filename
|
||||
class=directory>/usr/bin</filename></entry>
|
||||
class="directory">/usr/bin</filename></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><filename
|
||||
class=directory>usr.sbin/</filename></entry>
|
||||
class="directory">usr.sbin/</filename></entry>
|
||||
<entry>Source for files in <filename
|
||||
class=directory>/usr/sbin</filename></entry>
|
||||
class="directory">/usr/sbin</filename></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
|
|
|
@ -932,7 +932,7 @@ FreeBSD 4.x configurable supported
|
|||
<screen> int on;
|
||||
|
||||
setsockopt(s, IPPROTO_IPV6, IPV6_BINDV6ONLY,
|
||||
(char *)&on, sizeof (on)) < 0));
|
||||
(char *)&on, sizeof (on)) < 0));
|
||||
</screen>
|
||||
|
||||
<para>When this call succeed, then this socket only receive IPv6
|
||||
|
@ -1026,7 +1026,7 @@ FreeBSD 4.x configurable supported
|
|||
<screen> int on;
|
||||
|
||||
setsockopt(s, IPPROTO_IPV6, IPV6_BINDV6ONLY,
|
||||
(char *)&on, sizeof (on)) < 0));
|
||||
(char *)&on, sizeof (on)) < 0));
|
||||
</screen>
|
||||
|
||||
<para>Wildcard AF_INET6 socket grabs IPv4 connection if and only
|
||||
|
@ -1112,7 +1112,7 @@ FreeBSD 4.x configurable supported
|
|||
like:</para>
|
||||
|
||||
<screen> struct sockaddr_storage ss;
|
||||
family = ((struct sockaddr *)&ss)->sa_family
|
||||
family = ((struct sockaddr *)&ss)->sa_family
|
||||
</screen>
|
||||
|
||||
</listitem>
|
||||
|
@ -1296,7 +1296,7 @@ FreeBSD 4.x configurable supported
|
|||
<listitem>
|
||||
<para>IPsec tunnel is not combined with GIF generic tunneling
|
||||
interface. It needs a great care because we may create an
|
||||
infinite loop between ip_output() and tunnelifp->if_output().
|
||||
infinite loop between ip_output() and tunnelifp->if_output().
|
||||
Opinion varies if it is better to unify them, or not.</para>
|
||||
</listitem>
|
||||
|
||||
|
|
|
@ -330,11 +330,11 @@
|
|||
43:399 tp->t_state |= TS_CARR_ON;
|
||||
44:400 tp->t_cflag |= CLOCAL; /* cannot be a modem (:-) */
|
||||
45:401
|
||||
46:402 #if PCVT_NETBSD || (PCVT_FREEBSD >= 200)
|
||||
46:402 #if PCVT_NETBSD || (PCVT_FREEBSD >= 200)
|
||||
47:403 return ((*linesw[tp->t_line].l_open)(dev, tp));
|
||||
48:404 #else
|
||||
49:405 return ((*linesw[tp->t_line].l_open)(dev, tp, flag));
|
||||
50:406 #endif /* PCVT_NETBSD || (PCVT_FREEBSD >= 200) */
|
||||
50:406 #endif /* PCVT_NETBSD || (PCVT_FREEBSD >= 200) */
|
||||
51:407 }
|
||||
52:<prompt>(kgdb)</prompt> <userinput>print tp</userinput>
|
||||
53:Reading in symbols for ../../i386/i386/cons.c...done.
|
||||
|
@ -778,7 +778,7 @@ Id Refs Address Size Name
|
|||
|
||||
<para>If you are debugging a crash dump, you will need to walk the
|
||||
<literal>linker_files</literal> list, starting at
|
||||
<literal>linker_files->tqh_first</literal> and following the
|
||||
<literal>linker_files->tqh_first</literal> and following the
|
||||
<literal>link.tqe_next</literal> pointers until you find the
|
||||
entry with the <literal>filename</literal> you are looking for.
|
||||
The <literal>address</literal> member of that entry is the load
|
||||
|
|
|
@ -119,7 +119,7 @@
|
|||
handful of very dangerous functions.</para>
|
||||
|
||||
<informaltable frame="none" pgwide="1">
|
||||
<tgroup cols=2>
|
||||
<tgroup cols="2">
|
||||
<tbody>
|
||||
<row><entry><function>strcpy</function>(char *dest, const char
|
||||
*src)</entry>
|
||||
|
@ -430,7 +430,7 @@ int main() {
|
|||
permission, owner, group, size, access time, and modification
|
||||
time.</simpara></listitem>
|
||||
<listitem><simpara>Bind to privileged ports in the Internet
|
||||
domain (ports < 1024)</simpara></listitem>
|
||||
domain (ports < 1024)</simpara></listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para><function>Jail</function> is a very useful tool for
|
||||
|
|
|
@ -658,7 +658,7 @@ struct in_addr {
|
|||
<programlisting>
|
||||
sa.sin_family = AF_INET;
|
||||
sa.sin_port = 13;
|
||||
sa.sin_addr.s_addr = (((((192 << 8) | 43) << 8) | 244) << 8) | 18;
|
||||
sa.sin_addr.s_addr = (((((192 << 8) | 43) << 8) | 244) << 8) | 18;
|
||||
</programlisting>
|
||||
|
||||
<para>What would the result look like?</para>
|
||||
|
@ -846,8 +846,8 @@ struct in_addr {
|
|||
|
||||
<programlisting>
|
||||
sa.sin_family = AF_INET;
|
||||
sa.sin_port = 13 << 8;
|
||||
sa.sin_addr.s_addr = (((((18 << 8) | 244) << 8) | 43) << 8) | 192;
|
||||
sa.sin_port = 13 << 8;
|
||||
sa.sin_addr.s_addr = (((((18 << 8) | 244) << 8) | 43) << 8) | 192;
|
||||
</programlisting>
|
||||
|
||||
<para>This will <emphasis>trick</emphasis> our compiler
|
||||
|
@ -992,7 +992,7 @@ int main() {
|
|||
return 2;
|
||||
}
|
||||
|
||||
while ((bytes = read(s, buffer, BUFSIZ)) > 0)
|
||||
while ((bytes = read(s, buffer, BUFSIZ)) > 0)
|
||||
write(1, buffer, bytes);
|
||||
|
||||
close(s);
|
||||
|
@ -1210,7 +1210,7 @@ int main() {
|
|||
if (INADDR_ANY)
|
||||
sa.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
|
||||
if (bind(s, (struct sockaddr *)&sa, sizeof sa) < 0) {
|
||||
if (bind(s, (struct sockaddr *)&sa, sizeof sa) < 0) {
|
||||
perror("bind");
|
||||
return 2;
|
||||
}
|
||||
|
@ -1251,12 +1251,12 @@ int main() {
|
|||
|
||||
tm = gmtime(&t);
|
||||
fprintf(client, "%.4i-%.2i-%.2iT%.2i:%.2i:%.2iZ\n",
|
||||
tm->tm_year + 1900,
|
||||
tm->tm_mon + 1,
|
||||
tm->tm_mday,
|
||||
tm->tm_hour,
|
||||
tm->tm_min,
|
||||
tm->tm_sec);
|
||||
tm->tm_year + 1900,
|
||||
tm->tm_mon + 1,
|
||||
tm->tm_mday,
|
||||
tm->tm_hour,
|
||||
tm->tm_min,
|
||||
tm->tm_sec);
|
||||
|
||||
fclose(client);
|
||||
}
|
||||
|
@ -1659,7 +1659,7 @@ struct servent * getservbyname(const char *name, const char *proto);
|
|||
fprintf(stderr, "Cannot determine which port to use.\n");
|
||||
return 7;
|
||||
}
|
||||
sa.sin_port = se->s_port;
|
||||
sa.sin_port = se->s_port;
|
||||
</programlisting>
|
||||
|
||||
<para>You usually do know the port. But if you are developing a
|
||||
|
|
|
@ -1649,7 +1649,7 @@ Cannot access memory at address 0x7020796d.
|
|||
<command>gdb</command> info pages):</para>
|
||||
|
||||
<screen><lineannotation>…</lineannotation>
|
||||
if ((pid = fork()) < 0) /* _Always_ check this */
|
||||
if ((pid = fork()) < 0) /* _Always_ check this */
|
||||
error();
|
||||
else if (pid == 0) { /* child */
|
||||
int PauseMode = 1;
|
||||
|
|
|
@ -6378,7 +6378,7 @@ This is NEVER guaranteed under &unix;. It is quite common
|
|||
for a &unix; user to pipe and redirect program input and output:
|
||||
</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>program1 | program2 | program3 > file1</userinput></screen>
|
||||
<screen>&prompt.user; <userinput>program1 | program2 | program3 > file1</userinput></screen>
|
||||
|
||||
<para>
|
||||
If you have written <application>program2</application>, your input
|
||||
|
|
|
@ -387,8 +387,8 @@ PRI_LANG?= en_US.ISO8859-1
|
|||
|
||||
<programlisting>_SUBDIRUSE: .USE
|
||||
.for entry in ${SUBDIR}
|
||||
@${ECHO} "===> ${DIRPRFX}${entry}"
|
||||
@(cd ${.CURDIR}/${entry} && \
|
||||
@${ECHO} "===> ${DIRPRFX}${entry}"
|
||||
@(cd ${.CURDIR}/${entry} && \
|
||||
${MAKE} ${.TARGET:S/realpackage/package/:S/realinstall/install/} DIRPRFX=${DIRPRFX}${entry}/ )
|
||||
.endfor</programlisting>
|
||||
|
||||
|
@ -469,8 +469,8 @@ PRI_LANG?= en_US.ISO8859-1
|
|||
|
||||
<programlisting>_SUBDIRUSE: .USE
|
||||
.for entry in ${SUBDIR}
|
||||
@${ECHO} "===> ${DIRPRFX}${entry}"
|
||||
@(cd ${.CURDIR}/${entry} && \
|
||||
@${ECHO} "===> ${DIRPRFX}${entry}"
|
||||
@(cd ${.CURDIR}/${entry} && \
|
||||
${MAKE} ${.TARGET:S/realpackage/package/:S/realinstall/install/} DIRPRFX=${DIRPRFX}${entry}/ )
|
||||
.endfor</programlisting>
|
||||
|
||||
|
|
|
@ -171,7 +171,7 @@
|
|||
-c /usr/local/share/sgml/docbook/catalog \
|
||||
-c /usr/local/share/sgml/jade/catalog \
|
||||
-d /usr/local/share/sgml/docbook/dsssl/modular/html/docbook.dsl \<co id="examples-co-jade-1-dsssl">
|
||||
-t sgml <co id="examples-co-jade-1-transform"> file.sgml > file.html <co id="examples-co-jade-1-filename"></userinput></screen>
|
||||
-t sgml <co id="examples-co-jade-1-transform"> file.sgml > file.html <co id="examples-co-jade-1-filename"></userinput></screen>
|
||||
|
||||
<calloutlist>
|
||||
<callout arearefs="examples-co-jade-1-nochunks">
|
||||
|
|
|
@ -1077,7 +1077,7 @@ nsgmls:example.sgml:6:8:E: end tag for "HEAD" which is not finished</screen>
|
|||
|
||||
<para>You can use <command>sgmlnorm</command> to do this.</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>sgmlnorm example.sgml > example.html</userinput></screen>
|
||||
<screen>&prompt.user; <userinput>sgmlnorm example.sgml > example.html</userinput></screen>
|
||||
|
||||
<para>You should find a normalized (i.e., entity references
|
||||
expanded) copy of your document in
|
||||
|
@ -1091,7 +1091,7 @@ nsgmls:example.sgml:6:8:E: end tag for "HEAD" which is not finished</screen>
|
|||
the start. To include this you need to use the <option>-d</option>
|
||||
option:</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>sgmlnorm -d example.sgml > example.html</userinput></screen>
|
||||
<screen>&prompt.user; <userinput>sgmlnorm -d example.sgml > example.html</userinput></screen>
|
||||
</step>
|
||||
</procedure>
|
||||
</sect2>
|
||||
|
@ -1249,7 +1249,7 @@ nsgmls:example.sgml:6:8:E: end tag for "HEAD" which is not finished</screen>
|
|||
<para>Produce <filename>example.html</filename> by normalizing
|
||||
<filename>example.sgml</filename>.</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>sgmlnorm -d example.sgml > example.html</userinput></screen>
|
||||
<screen>&prompt.user; <userinput>sgmlnorm -d example.sgml > example.html</userinput></screen>
|
||||
</step>
|
||||
|
||||
<step>
|
||||
|
@ -1306,7 +1306,7 @@ nsgmls:example.sgml:6:8:E: end tag for "HEAD" which is not finished</screen>
|
|||
<para>Produce <filename>example.html</filename> by normalizing
|
||||
<filename>example.sgml</filename>.</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>sgmlnorm -d example.sgml > example.html</userinput></screen>
|
||||
<screen>&prompt.user; <userinput>sgmlnorm -d example.sgml > example.html</userinput></screen>
|
||||
</step>
|
||||
|
||||
<step>
|
||||
|
|
|
@ -1083,7 +1083,7 @@ wi0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
|
|||
</sect4>
|
||||
|
||||
<sect4>
|
||||
<title>802.11a & 802.11g Clients</title>
|
||||
<title>802.11a & 802.11g Clients</title>
|
||||
|
||||
<para>The &man.ath.4; device driver supports 802.11a and 802.11g.
|
||||
If your card is based on an Atheros chipset, you may
|
||||
|
@ -1139,7 +1139,7 @@ linuxemu/chapter.sgml -->
|
|||
wrapper module. As <username>root</username>:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cd /usr/src/sys/modules/ndis</userinput>
|
||||
&prompt.root; <userinput>make && make install</userinput></screen>
|
||||
&prompt.root; <userinput>make && make install</userinput></screen>
|
||||
|
||||
<para>Locate the files for your specific card. Generally, they can
|
||||
be found on the included CDs or at the vendors' websites. In the
|
||||
|
@ -1179,7 +1179,7 @@ linuxemu/chapter.sgml -->
|
|||
|
||||
<para>Finally, we can build and install the driver module:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>make && make install</userinput></screen>
|
||||
<screen>&prompt.root; <userinput>make && make install</userinput></screen>
|
||||
|
||||
<para>To use the driver, you must load the appropriate modules:</para>
|
||||
|
||||
|
@ -2586,7 +2586,7 @@ options BOOTP_NFSROOT # NFS mount root file system using BOOTP info
|
|||
<programlisting>#!/bin/sh
|
||||
export DESTDIR=/data/misc/diskless
|
||||
mkdir -p ${DESTDIR}
|
||||
cd /usr/src; make world && make kernel
|
||||
cd /usr/src; make world && make kernel
|
||||
cd /usr/src/etc; make distribution</programlisting>
|
||||
|
||||
<para>Once done, you may need to customize your
|
||||
|
|
|
@ -805,7 +805,7 @@ total 530
|
|||
|
||||
<row>
|
||||
<entry><filename class="directory">/usr/libexec/</filename></entry>
|
||||
<entry>System daemons & system utilities (executed by other
|
||||
<entry>System daemons & system utilities (executed by other
|
||||
programs).</entry>
|
||||
</row>
|
||||
|
||||
|
@ -839,7 +839,7 @@ total 530
|
|||
|
||||
<row>
|
||||
<entry><filename class="directory">/usr/sbin/</filename></entry>
|
||||
<entry>System daemons & system utilities (executed by users).</entry>
|
||||
<entry>System daemons & system utilities (executed by users).</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
|
@ -1384,25 +1384,25 @@ total 530
|
|||
<literallayout class="monospaced">.-----------------. --.
|
||||
| | |
|
||||
| DOS / Windows | |
|
||||
: : > First slice, ad0s1
|
||||
: : > First slice, ad0s1
|
||||
: : |
|
||||
| | |
|
||||
:=================: ==: --.
|
||||
| | | Partition a, mounted as / |
|
||||
| | > referred to as ad0s2a |
|
||||
| | > referred to as ad0s2a |
|
||||
| | | |
|
||||
:-----------------: ==: |
|
||||
| | | Partition b, used as swap |
|
||||
| | > referred to as ad0s2b |
|
||||
| | > referred to as ad0s2b |
|
||||
| | | |
|
||||
:-----------------: ==: | Partition c, no
|
||||
| | | Partition e, used as /var > file system, all
|
||||
| | > referred to as ad0s2e | of FreeBSD slice,
|
||||
| | | Partition e, used as /var > file system, all
|
||||
| | > referred to as ad0s2e | of FreeBSD slice,
|
||||
| | | | ad0s2c
|
||||
:-----------------: ==: |
|
||||
| | | |
|
||||
: : | Partition f, used as /usr |
|
||||
: : > referred to as ad0s2f |
|
||||
: : > referred to as ad0s2f |
|
||||
: : | |
|
||||
| | | |
|
||||
| | --' |
|
||||
|
|
|
@ -389,7 +389,7 @@ stop)
|
|||
kill -9 `cat /var/run/utility.pid`
|
||||
;;
|
||||
*)
|
||||
echo "Usage: `basename $0` {start|stop}" >&2
|
||||
echo "Usage: `basename $0` {start|stop}" >&2
|
||||
exit 64
|
||||
;;
|
||||
esac
|
||||
|
@ -1623,7 +1623,7 @@ kern.maxproc: 1044</screen>
|
|||
syntax:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>sysctl kern.maxfiles=5000</userinput>
|
||||
kern.maxfiles: 2088 -> 5000</screen>
|
||||
kern.maxfiles: 2088 -> 5000</screen>
|
||||
|
||||
<para>Settings of sysctl variables are usually either strings,
|
||||
numbers, or booleans (a boolean being <literal>1</literal> for yes
|
||||
|
@ -2425,7 +2425,7 @@ kern.maxvnodes: 100000</programlisting>
|
|||
<para>Reboot the machine or to enable the swap file immediately,
|
||||
type:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>mdconfig -a -t vnode -f /usr/swap0 -u 0 && swapon /dev/md0</userinput></screen>
|
||||
<screen>&prompt.root; <userinput>mdconfig -a -t vnode -f /usr/swap0 -u 0 && swapon /dev/md0</userinput></screen>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
|
||||
|
|
|
@ -1377,7 +1377,7 @@ Script done, …</screen>
|
|||
information:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cd /dev</userinput>
|
||||
&prompt.root; <userinput>ls -l | awk '{print $1, $2, $3, $4, $5, $6, $NF}' > /var/tmp/dev.out</userinput></screen>
|
||||
&prompt.root; <userinput>ls -l | awk '{print $1, $2, $3, $4, $5, $6, $NF}' > /var/tmp/dev.out</userinput></screen>
|
||||
</step>
|
||||
|
||||
<step>
|
||||
|
|
|
@ -1846,7 +1846,7 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c
|
|||
<para>Sometimes the entries under <filename>/dev</filename> will
|
||||
have to be (re)created. To do that, issue:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cd /dev && ./MAKEDEV "fd*"</userinput></screen>
|
||||
<screen>&prompt.root; <userinput>cd /dev && ./MAKEDEV "fd*"</userinput></screen>
|
||||
</sect4>
|
||||
|
||||
<sect4>
|
||||
|
@ -2512,9 +2512,9 @@ sa0(ncr1:4:0): Logical unit is in process of becoming ready</screen>
|
|||
to send the data to a remote tape drive.</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>for f in <replaceable>directory_list; do</replaceable></userinput>
|
||||
<userinput>find $f >> backup.list</userinput>
|
||||
<userinput>find $f >> backup.list</userinput>
|
||||
<userinput>done</userinput>
|
||||
&prompt.root; <userinput>cpio -v -o --format=newc < backup.list | ssh <replaceable>user</replaceable>@<replaceable>host</replaceable> "cat > <replaceable>backup_device</replaceable>"</userinput></screen>
|
||||
&prompt.root; <userinput>cpio -v -o --format=newc < backup.list | ssh <replaceable>user</replaceable>@<replaceable>host</replaceable> "cat > <replaceable>backup_device</replaceable>"</userinput></screen>
|
||||
|
||||
<para>Where <replaceable>directory_list</replaceable> is the list of
|
||||
directories you want to back up,
|
||||
|
@ -2728,7 +2728,7 @@ mkdir /mnt/var
|
|||
#
|
||||
if [ ! -x /sys/compile/MINI/kernel ]
|
||||
then
|
||||
cat << EOM
|
||||
cat << EOM
|
||||
The MINI kernel does not exist, please create one.
|
||||
Here is an example config file:
|
||||
#
|
||||
|
@ -2776,14 +2776,14 @@ fi
|
|||
|
||||
cp -f /sys/compile/MINI/kernel /mnt
|
||||
|
||||
gzip -c -best /sbin/init > /mnt/sbin/init
|
||||
gzip -c -best /sbin/fsck > /mnt/sbin/fsck
|
||||
gzip -c -best /sbin/mount > /mnt/sbin/mount
|
||||
gzip -c -best /sbin/halt > /mnt/sbin/halt
|
||||
gzip -c -best /sbin/restore > /mnt/sbin/restore
|
||||
gzip -c -best /sbin/init > /mnt/sbin/init
|
||||
gzip -c -best /sbin/fsck > /mnt/sbin/fsck
|
||||
gzip -c -best /sbin/mount > /mnt/sbin/mount
|
||||
gzip -c -best /sbin/halt > /mnt/sbin/halt
|
||||
gzip -c -best /sbin/restore > /mnt/sbin/restore
|
||||
|
||||
gzip -c -best /bin/sh > /mnt/bin/sh
|
||||
gzip -c -best /bin/sync > /mnt/bin/sync
|
||||
gzip -c -best /bin/sh > /mnt/bin/sh
|
||||
gzip -c -best /bin/sync > /mnt/bin/sync
|
||||
|
||||
cp /root/.profile /mnt/root
|
||||
|
||||
|
@ -2810,18 +2810,18 @@ cd /
|
|||
#
|
||||
# create minimum file system table
|
||||
#
|
||||
cat > /mnt/etc/fstab <<EOM
|
||||
cat > /mnt/etc/fstab <<EOM
|
||||
/dev/fd0a / ufs rw 1 1
|
||||
EOM
|
||||
|
||||
#
|
||||
# create minimum passwd file
|
||||
#
|
||||
cat > /mnt/etc/passwd <<EOM
|
||||
cat > /mnt/etc/passwd <<EOM
|
||||
root:*:0:0:Charlie &:/root:/bin/sh
|
||||
EOM
|
||||
|
||||
cat > /mnt/etc/master.passwd <<EOM
|
||||
cat > /mnt/etc/master.passwd <<EOM
|
||||
root::0:0::0:0:Charlie &:/root:/bin/sh
|
||||
EOM
|
||||
|
||||
|
|
|
@ -577,7 +577,7 @@ ipmon_enable="YES" # Start IP monitor log
|
|||
ipmon_flags="-Ds" # D = start as daemon
|
||||
# s = log to syslog
|
||||
# v = log tcp window, ack, seq
|
||||
# n = map IP & port to names</programlisting>
|
||||
# n = map IP & port to names</programlisting>
|
||||
|
||||
<para>If you have a LAN behind this firewall that uses the
|
||||
reserved private IP address ranges, then you need to add the
|
||||
|
@ -740,7 +740,7 @@ ipnat_rules="/etc/ipnat.rules" # rules definition file for ipnat</programlist
|
|||
<programlisting>ipmon_flags="-Ds" # D = start as daemon
|
||||
# s = log to syslog
|
||||
# v = log tcp window, ack, seq
|
||||
# n = map IP & port to names</programlisting>
|
||||
# n = map IP & port to names</programlisting>
|
||||
|
||||
<para>The benefits of logging are obvious. It provides the
|
||||
ability to review, after the fact, information such as which
|
||||
|
@ -860,9 +860,9 @@ LOG_ERR - packets which have been logged and which can be considered short</scre
|
|||
|
||||
<listitem>
|
||||
<para>The addresses. This is actually three fields: the
|
||||
source address and port (separated by a comma), the ->
|
||||
source address and port (separated by a comma), the ->
|
||||
symbol, and the destination address and port.
|
||||
209.53.17.22,80 -> 198.73.220.17,1722.</para>
|
||||
209.53.17.22,80 -> 198.73.220.17,1722.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
|
@ -1525,7 +1525,7 @@ pass out quick on dc0 proto udp from any to xxx port = 53 keep state
|
|||
# This rule is not needed for 'user ppp' type connection to the
|
||||
# public Internet, so you can delete this whole group.
|
||||
# Use the following rule and check log for IP address.
|
||||
# Then put IP address in commented out rule & delete first rule
|
||||
# Then put IP address in commented out rule & delete first rule
|
||||
pass out log quick on dc0 proto udp from any to any port = 67 keep state
|
||||
#pass out quick on dc0 proto udp from any to z.z.z.z port = 67 keep state
|
||||
|
||||
|
@ -1536,7 +1536,7 @@ pass out quick on dc0 proto tcp from any to any port = 80 flags S keep state
|
|||
# Allow out secure www function https over TLS SSL
|
||||
pass out quick on dc0 proto tcp from any to any port = 443 flags S keep state
|
||||
|
||||
# Allow out send & get email function
|
||||
# Allow out send & get email function
|
||||
pass out quick on dc0 proto tcp from any to any port = 110 flags S keep state
|
||||
pass out quick on dc0 proto tcp from any to any port = 25 flags S keep state
|
||||
|
||||
|
@ -1546,7 +1546,7 @@ pass out quick on dc0 proto tcp from any to any port = 37 flags S keep state
|
|||
# Allow out nntp news
|
||||
pass out quick on dc0 proto tcp from any to any port = 119 flags S keep state
|
||||
|
||||
# Allow out gateway & LAN users non-secure FTP ( both passive & active modes)
|
||||
# Allow out gateway & LAN users non-secure FTP ( both passive & active modes)
|
||||
# This function uses the IP<acronym>NAT</acronym> built in FTP proxy function coded in
|
||||
# the nat rules file to make this single rule function correctly.
|
||||
# If you want to use the pkg_add command to install application packages
|
||||
|
@ -1589,7 +1589,7 @@ block in quick on dc0 from 0.0.0.0/8 to any #loopback
|
|||
block in quick on dc0 from 169.254.0.0/16 to any #DHCP auto-config
|
||||
block in quick on dc0 from 192.0.2.0/24 to any #reserved for docs
|
||||
block in quick on dc0 from 204.152.64.0/23 to any #Sun cluster interconnect
|
||||
block in quick on dc0 from 224.0.0.0/3 to any #Class D & E multicast
|
||||
block in quick on dc0 from 224.0.0.0/3 to any #Class D & E multicast
|
||||
|
||||
##### Block a bunch of different nasty things. ############
|
||||
# That I do not want to see in the log
|
||||
|
@ -1815,7 +1815,7 @@ block in log first quick on dc0 all
|
|||
<para>The syntax for a <acronym>NAT</acronym> rule looks
|
||||
something like this:</para>
|
||||
|
||||
<programlisting>map <replaceable>IF</replaceable> <replaceable>LAN_IP_RANGE</replaceable> -> <replaceable>PUBLIC_ADDRESS</replaceable></programlisting>
|
||||
<programlisting>map <replaceable>IF</replaceable> <replaceable>LAN_IP_RANGE</replaceable> -> <replaceable>PUBLIC_ADDRESS</replaceable></programlisting>
|
||||
|
||||
<para>The keyword <literal>map</literal> starts the rule.</para>
|
||||
|
||||
|
@ -1898,7 +1898,7 @@ block in log first quick on dc0 all
|
|||
|
||||
<para>A normal NAT rule would look like:</para>
|
||||
|
||||
<programlisting>map dc0 192.168.1.0/24 -> 0/32</programlisting>
|
||||
<programlisting>map dc0 192.168.1.0/24 -> 0/32</programlisting>
|
||||
|
||||
<para>In the above rule the packet's source port is unchanged
|
||||
as the packet passes through IP<acronym>NAT</acronym>. By
|
||||
|
@ -1908,14 +1908,14 @@ block in log first quick on dc0 all
|
|||
IP<acronym>NAT</acronym> to modify the source port to be
|
||||
within that range:</para>
|
||||
|
||||
<programlisting>map dc0 192.168.1.0/24 -> 0/32 portmap tcp/udp 20000:60000</programlisting>
|
||||
<programlisting>map dc0 192.168.1.0/24 -> 0/32 portmap tcp/udp 20000:60000</programlisting>
|
||||
|
||||
<para>Additionally we can make things even easier by using the
|
||||
<literal>auto</literal> keyword to tell
|
||||
IP<acronym>NAT</acronym> to determine by itself which ports
|
||||
are available to use:</para>
|
||||
|
||||
<programlisting>map dc0 192.168.1.0/24 -> 0/32 portmap tcp/udp auto</programlisting>
|
||||
<programlisting>map dc0 192.168.1.0/24 -> 0/32 portmap tcp/udp auto</programlisting>
|
||||
</sect3>
|
||||
|
||||
<sect3>
|
||||
|
@ -1925,17 +1925,17 @@ block in log first quick on dc0 all
|
|||
just too many LAN addresses to fit into a single public
|
||||
address. By changing the following rule:</para>
|
||||
|
||||
<programlisting>map dc0 192.168.1.0/24 -> 204.134.75.1</programlisting>
|
||||
<programlisting>map dc0 192.168.1.0/24 -> 204.134.75.1</programlisting>
|
||||
|
||||
<para>Currently this rule maps all connections through <hostid
|
||||
role="ipaddr">204.134.75.1</hostid>. This can be changed
|
||||
to specify a range:</para>
|
||||
|
||||
<programlisting>map dc0 192.168.1.0/24 -> 204.134.75.1-10</programlisting>
|
||||
<programlisting>map dc0 192.168.1.0/24 -> 204.134.75.1-10</programlisting>
|
||||
|
||||
<para>Or a subnet using CIDR notation such as:</para>
|
||||
|
||||
<programlisting>map dc0 192.168.1.0/24 -> 204.134.75.0/24</programlisting>
|
||||
<programlisting>map dc0 192.168.1.0/24 -> 204.134.75.0/24</programlisting>
|
||||
</sect3>
|
||||
</sect2>
|
||||
|
||||
|
@ -1954,17 +1954,17 @@ block in log first quick on dc0 all
|
|||
address is <hostid role="ipaddr">20.20.20.5</hostid> you would
|
||||
code the rule like this:</para>
|
||||
|
||||
<programlisting>rdr dc0 20.20.20.5/32 port 80 -> 10.0.10.25 port 80</programlisting>
|
||||
<programlisting>rdr dc0 20.20.20.5/32 port 80 -> 10.0.10.25 port 80</programlisting>
|
||||
|
||||
<para>or:</para>
|
||||
|
||||
<programlisting>rdr dc0 0/32 port 80 -> 10.0.10.25 port 80</programlisting>
|
||||
<programlisting>rdr dc0 0/32 port 80 -> 10.0.10.25 port 80</programlisting>
|
||||
|
||||
<para>or for a LAN DNS Server on LAN address of <hostid
|
||||
role="ipaddr">10.0.10.33</hostid> that needs to receive
|
||||
public DNS requests:</para>
|
||||
|
||||
<programlisting>rdr dc0 20.20.20.5/32 port 53 -> 10.0.10.33 port 53 udp</programlisting>
|
||||
<programlisting>rdr dc0 20.20.20.5/32 port 53 -> 10.0.10.33 port 53 udp</programlisting>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
|
@ -2000,17 +2000,17 @@ block in log first quick on dc0 all
|
|||
<para>This rule will handle all the traffic for the internal
|
||||
LAN:</para>
|
||||
|
||||
<programlisting>map dc0 10.0.10.0/29 -> 0/32 proxy port 21 ftp/tcp</programlisting>
|
||||
<programlisting>map dc0 10.0.10.0/29 -> 0/32 proxy port 21 ftp/tcp</programlisting>
|
||||
|
||||
<para>This rule handles the FTP traffic from the
|
||||
gateway:</para>
|
||||
|
||||
<programlisting>map dc0 0.0.0.0/0 -> 0/32 proxy port 21 ftp/tcp</programlisting>
|
||||
<programlisting>map dc0 0.0.0.0/0 -> 0/32 proxy port 21 ftp/tcp</programlisting>
|
||||
|
||||
<para>This rule handles all non-FTP traffic from the internal
|
||||
LAN:</para>
|
||||
|
||||
<programlisting>map dc0 10.0.10.0/29 -> 0/32</programlisting>
|
||||
<programlisting>map dc0 10.0.10.0/29 -> 0/32</programlisting>
|
||||
|
||||
<para>The FTP map rule goes before our regular map rule. All
|
||||
packets are tested against the first rule from the top.
|
||||
|
@ -2039,7 +2039,7 @@ block in log first quick on dc0 all
|
|||
pass out quick on rl0 proto tcp from any to any port = 21 flags S keep state
|
||||
|
||||
# Allow out passive mode data channel high order port numbers
|
||||
pass out quick on rl0 proto tcp from any to any port > 1024 flags S keep state
|
||||
pass out quick on rl0 proto tcp from any to any port > 1024 flags S keep state
|
||||
|
||||
# Active mode let data channel in from FTP server
|
||||
pass in quick on rl0 proto tcp from any to any port = 20 flags S keep state</programlisting>
|
||||
|
@ -2909,7 +2909,7 @@ pif="dc0" # public interface name of NIC
|
|||
# This rule is not needed for .user ppp. connection to the public Internet.
|
||||
# so you can delete this whole group.
|
||||
# Use the following rule and check log for IP address.
|
||||
# Then put IP address in commented out rule & delete first rule
|
||||
# Then put IP address in commented out rule & delete first rule
|
||||
$cmd 00120 allow log udp from any to any 67 out via $pif keep-state
|
||||
#$cmd 00120 allow udp from any to x.x.x.x 67 out via $pif keep-state
|
||||
|
||||
|
@ -2919,11 +2919,11 @@ pif="dc0" # public interface name of NIC
|
|||
# Allow out secure www function https over TLS SSL
|
||||
$cmd 00220 allow tcp from any to any 443 out via $pif setup keep-state
|
||||
|
||||
# Allow out send & get email function
|
||||
# Allow out send & get email function
|
||||
$cmd 00230 allow tcp from any to any 25 out via $pif setup keep-state
|
||||
$cmd 00231 allow tcp from any to any 110 out via $pif setup keep-state
|
||||
|
||||
# Allow out FBSD (make install & CVSUP) functions
|
||||
# Allow out FBSD (make install & CVSUP) functions
|
||||
# Basically give user root "GOD" privileges.
|
||||
$cmd 00240 allow tcp from me to any out via $pif setup keep-state uid root
|
||||
|
||||
|
@ -2962,7 +2962,7 @@ pif="dc0" # public interface name of NIC
|
|||
$cmd 00305 deny all from 169.254.0.0/16 to any in via $pif #DHCP auto-config
|
||||
$cmd 00306 deny all from 192.0.2.0/24 to any in via $pif #reserved for docs
|
||||
$cmd 00307 deny all from 204.152.64.0/23 to any in via $pif #Sun cluster interconnect
|
||||
$cmd 00308 deny all from 224.0.0.0/3 to any in via $pif #Class D & E multicast
|
||||
$cmd 00308 deny all from 224.0.0.0/3 to any in via $pif #Class D & E multicast
|
||||
|
||||
# Deny public pings
|
||||
$cmd 00310 deny icmp from any to any in via $pif
|
||||
|
@ -3000,12 +3000,12 @@ pif="dc0" # public interface name of NIC
|
|||
$cmd 00410 allow tcp from any to me 22 in via $pif setup limit src-addr 2
|
||||
|
||||
# Allow in non-secure Telnet session from public Internet
|
||||
# labeled non-secure because ID & PW are passed over public
|
||||
# labeled non-secure because ID & PW are passed over public
|
||||
# Internet as clear text.
|
||||
# Delete this sample group if you do not have telnet server enabled.
|
||||
$cmd 00420 allow tcp from any to me 23 in via $pif setup limit src-addr 2
|
||||
|
||||
# Reject & Log all incoming connections from the outside
|
||||
# Reject & Log all incoming connections from the outside
|
||||
$cmd 00499 deny log all from any to any in via $pif
|
||||
|
||||
# Everything else is denied by default
|
||||
|
@ -3151,7 +3151,7 @@ ipfw -q -f flush
|
|||
$cmd 305 deny all from 169.254.0.0/16 to any in via $pif #DHCP auto-config
|
||||
$cmd 306 deny all from 192.0.2.0/24 to any in via $pif #reserved for docs
|
||||
$cmd 307 deny all from 204.152.64.0/23 to any in via $pif #Sun cluster
|
||||
$cmd 308 deny all from 224.0.0.0/3 to any in via $pif #Class D & E multicast
|
||||
$cmd 308 deny all from 224.0.0.0/3 to any in via $pif #Class D & E multicast
|
||||
|
||||
# Authorized inbound packets
|
||||
$cmd 400 allow udp from xx.70.207.54 to any 68 in $ks
|
||||
|
@ -3229,11 +3229,11 @@ pif="rl0" # public interface name of NIC
|
|||
# Allow out secure www function https over TLS SSL
|
||||
$cmd 050 $skip tcp from any to any 443 out via $pif setup keep-state
|
||||
|
||||
# Allow out send & get email function
|
||||
# Allow out send & get email function
|
||||
$cmd 060 $skip tcp from any to any 25 out via $pif setup keep-state
|
||||
$cmd 061 $skip tcp from any to any 110 out via $pif setup keep-state
|
||||
|
||||
# Allow out FreeBSD (make install & CVSUP) functions
|
||||
# Allow out FreeBSD (make install & CVSUP) functions
|
||||
# Basically give user root "GOD" privileges.
|
||||
$cmd 070 $skip tcp from me to any out via $pif setup keep-state uid root
|
||||
|
||||
|
@ -3271,7 +3271,7 @@ pif="rl0" # public interface name of NIC
|
|||
$cmd 305 deny all from 169.254.0.0/16 to any in via $pif #DHCP auto-config
|
||||
$cmd 306 deny all from 192.0.2.0/24 to any in via $pif #reserved for docs
|
||||
$cmd 307 deny all from 204.152.64.0/23 to any in via $pif #Sun cluster
|
||||
$cmd 308 deny all from 224.0.0.0/3 to any in via $pif #Class D & E multicast
|
||||
$cmd 308 deny all from 224.0.0.0/3 to any in via $pif #Class D & E multicast
|
||||
|
||||
# Deny ident
|
||||
$cmd 315 deny tcp from any to any 113 in via $pif
|
||||
|
@ -3306,15 +3306,15 @@ pif="rl0" # public interface name of NIC
|
|||
$cmd 380 allow tcp from any to me 22 in via $pif setup limit src-addr 2
|
||||
|
||||
# Allow in non-secure Telnet session from public Internet
|
||||
# labeled non-secure because ID & PW are passed over public
|
||||
# labeled non-secure because ID & PW are passed over public
|
||||
# Internet as clear text.
|
||||
# Delete this sample group if you do not have telnet server enabled.
|
||||
$cmd 390 allow tcp from any to me 23 in via $pif setup limit src-addr 2
|
||||
|
||||
# Reject & Log all unauthorized incoming connections from the public Internet
|
||||
# Reject & Log all unauthorized incoming connections from the public Internet
|
||||
$cmd 400 deny log all from any to any in via $pif
|
||||
|
||||
# Reject & Log all unauthorized out going connections to the public Internet
|
||||
# Reject & Log all unauthorized out going connections to the public Internet
|
||||
$cmd 450 deny log all from any to any out via $pif
|
||||
|
||||
# This is skipto location for outbound stateful rules
|
||||
|
|
|
@ -311,7 +311,7 @@ Done.</screen>
|
|||
commands; however, &man.dd.1; would also work with this
|
||||
scenario.</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>dump -L -0 -f- / |(cd /mnt && restore -r -v -f-)</userinput></screen>
|
||||
<screen>&prompt.root; <userinput>dump -L -0 -f- / |(cd /mnt && restore -r -v -f-)</userinput></screen>
|
||||
|
||||
<para>This must be done for each file system. Simply place the
|
||||
appropriate file system in the correct location when running the
|
||||
|
|
|
@ -2286,7 +2286,7 @@ Mounting root from ufs:/dev/md0c
|
|||
The Ports Collection is a very valuable resource and well worth having
|
||||
on your /usr partition, so it is advisable to say Yes to this option.
|
||||
|
||||
For more information on the Ports Collection & the latest ports,
|
||||
For more information on the Ports Collection & the latest ports,
|
||||
visit:
|
||||
http://www.FreeBSD.org/ports
|
||||
|
||||
|
@ -3782,7 +3782,7 @@ Press enter to continue, or ctrl-c to abort.</screen>
|
|||
<screen>First specify a mouse protocol type. Choose one from the following list:
|
||||
|
||||
1. Microsoft compatible (2-button protocol)
|
||||
2. Mouse Systems (3-button protocol) & FreeBSD moused protocol
|
||||
2. Mouse Systems (3-button protocol) & FreeBSD moused protocol
|
||||
3. Bus Mouse
|
||||
4. PS/2 Mouse
|
||||
5. Logitech Mouse (serial, old type, Logitech protocol)
|
||||
|
@ -5092,7 +5092,7 @@ Please press any key to reboot.</screen>
|
|||
<literal>/boot/loader -h</literal>. All this does is pass a flag to the bootloader to
|
||||
boot into a serial console.</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>echo "/boot/loader -h" > boot.config</userinput></screen>
|
||||
<screen>&prompt.root; <userinput>echo "/boot/loader -h" > boot.config</userinput></screen>
|
||||
|
||||
<para>Now that you have your floppy configured correctly,
|
||||
you must unmount the floppy using the &man.umount.8;
|
||||
|
|
|
@ -494,7 +494,7 @@
|
|||
<para>In &os; 5.X and later versions you can still generate a buildable
|
||||
<filename>LINT</filename> file by typing:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cd /usr/src/sys/<replaceable>i386</replaceable>/conf && make LINT</userinput></screen>
|
||||
<screen>&prompt.root; <userinput>cd /usr/src/sys/<replaceable>i386</replaceable>/conf && make LINT</userinput></screen>
|
||||
</note>
|
||||
|
||||
<indexterm>
|
||||
|
@ -1165,7 +1165,7 @@ device re # RealTek 8139C+/8169/8169S/8110S
|
|||
device rl # RealTek 8129/8139
|
||||
device sf # Adaptec AIC-6915 (<quote>Starfire</quote>)
|
||||
device sis # Silicon Integrated Systems SiS 900/SiS 7016
|
||||
device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet
|
||||
device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet
|
||||
device ste # Sundance ST201 (D-Link DFE-550TX)
|
||||
device ti # Alteon Networks Tigon I/II gigabit Ethernet
|
||||
device tl # Texas Instruments ThunderLAN
|
||||
|
|
|
@ -604,14 +604,14 @@ LOG=/var/log/lmgrd.log
|
|||
|
||||
case "$1" in
|
||||
start)
|
||||
lmgrd -c ${LICENSE_FILE} 2>> ${LOG} 1>&2
|
||||
lmgrd -c ${LICENSE_FILE} 2>> ${LOG} 1>&2
|
||||
echo -n " lmgrd"
|
||||
;;
|
||||
stop)
|
||||
lmgrd -c ${LICENSE_FILE} -x lmdown 2>> ${LOG} 1>&2
|
||||
lmgrd -c ${LICENSE_FILE} -x lmdown 2>> ${LOG} 1>&2
|
||||
;;
|
||||
*)
|
||||
echo "Usage: `basename $0` {start|stop}" 1>&2
|
||||
echo "Usage: `basename $0` {start|stop}" 1>&2
|
||||
exit 64
|
||||
;;
|
||||
esac
|
||||
|
@ -3105,7 +3105,7 @@ SVRMGR> <userinput>exit</userinput></screen>
|
|||
total 4
|
||||
drwxr-xr-x 3 idsadm sapsys 512 May 5 11:20 D00
|
||||
drwxr-x--x 5 idsadm sapsys 512 May 5 11:35 IDS
|
||||
lrwxr-xr-x 1 root sapsys 7 May 5 11:35 SYS -> IDS/SYS
|
||||
lrwxr-xr-x 1 root sapsys 7 May 5 11:35 SYS -> IDS/SYS
|
||||
drwxrwxr-x 2 idsadm sapsys 512 May 5 13:00 tmp
|
||||
drwxrwxr-x 11 idsadm sapsys 512 May 4 14:20 trans</screen>
|
||||
|
||||
|
|
|
@ -1764,7 +1764,7 @@ mac_partition_load="YES"</programlisting>
|
|||
The following <command>sh</command> script should do the
|
||||
trick:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>for x in `awk -F: '($3 >= 1001) && ($3 != 65534) { print $1 }' \</userinput>
|
||||
<screen>&prompt.root; <userinput>for x in `awk -F: '($3 >= 1001) && ($3 != 65534) { print $1 }' \</userinput>
|
||||
<userinput>/etc/passwd`; do pw usermod $x -L insecure; done;</userinput></screen>
|
||||
|
||||
<para>The <command>cap_mkdb</command> command will need to be
|
||||
|
@ -1947,7 +1947,7 @@ round-trip min/avg/max/stddev = 204.455/204.455/204.455/0.000 ms</screen>
|
|||
test1: biba/equal,mls/equal
|
||||
&prompt.root; <userinput>setfmac biba/low test1 test2; setfmac biba/high test4 test5; \
|
||||
setfmac mls/low test1 test3; setfmac mls/high test2 test4</userinput>
|
||||
&prompt.root; <userinput>setfmac mls/equal,biba/equal test3 && getfmac test?</userinput>
|
||||
&prompt.root; <userinput>setfmac mls/equal,biba/equal test3 && getfmac test?</userinput>
|
||||
test1: biba/low,mls/low
|
||||
test2: biba/low,mls/high
|
||||
test3: biba/equal,mls/equal
|
||||
|
@ -1974,7 +1974,7 @@ test3 test5</screen>
|
|||
read access should be denied. Now for some write
|
||||
tests:</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>for i in `echo test*`; do echo 1 > $i; done</userinput>
|
||||
<screen>&prompt.user; <userinput>for i in `echo test*`; do echo 1 > $i; done</userinput>
|
||||
-su: test1: Permission denied
|
||||
-su: test4: Permission denied
|
||||
-su: test5: Permission denied</screen>
|
||||
|
@ -2036,7 +2036,7 @@ cat: test4: Permission denied</screen>
|
|||
<para>Every user should now be placed in the default class;
|
||||
a command such as:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>for x in `awk -F: '($3 >= 1001) && ($3 != 65534) { print $1 }' \</userinput>
|
||||
<screen>&prompt.root; <userinput>for x in `awk -F: '($3 >= 1001) && ($3 != 65534) { print $1 }' \</userinput>
|
||||
<userinput>/etc/passwd`; do pw usermod $x -L default; done;</userinput></screen>
|
||||
|
||||
<para>will accomplish this task in a few moments.</para>
|
||||
|
|
|
@ -1839,7 +1839,7 @@ define(`confDEF_AUTH_INFO', `/etc/mail/auth-info')dnl</programlisting>
|
|||
that should be displayed. In this example, we will read the
|
||||
first email:</para>
|
||||
|
||||
<screen>& <userinput>t 1</userinput>
|
||||
<screen>& <userinput>t 1</userinput>
|
||||
Message 1:
|
||||
From root@localhost Mon Mar 8 14:05:52 2004
|
||||
X-Original-To: marcs@localhost
|
||||
|
@ -1869,7 +1869,7 @@ This is a test message, please reply if you receive it.</screen>
|
|||
single <keycap>.</keycap> on a new line. An example can be seen
|
||||
below:</para>
|
||||
|
||||
<screen>& <userinput>R 1</userinput>
|
||||
<screen>& <userinput>R 1</userinput>
|
||||
To: root@localhost
|
||||
Subject: Re: test
|
||||
|
||||
|
@ -1886,7 +1886,7 @@ EOT</screen>
|
|||
be specified by putting a single <keycap>.</keycap> on a new
|
||||
line.</para>
|
||||
|
||||
<screen>& <userinput>mail root@localhost</userinput>
|
||||
<screen>& <userinput>mail root@localhost</userinput>
|
||||
Subject: <userinput>I mastered mail
|
||||
|
||||
Now I can send and receive email using mail ... :)
|
||||
|
@ -2280,7 +2280,7 @@ user "john", with password "XXXXX", is "myth" here;</programlisting>
|
|||
address of <email role="nolink">goodmail@example2.com</email>:</para>
|
||||
|
||||
<programlisting>:0
|
||||
* < 1000
|
||||
* < 1000
|
||||
! goodmail@example2.com</programlisting>
|
||||
|
||||
<para>Send all mail sent to <email>alternate@example.com</email>
|
||||
|
|
|
@ -2398,7 +2398,7 @@ doc/zh_*</screen>
|
|||
configuration file is distributed; to copy it into place, run
|
||||
the following command:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cd /usr/local/etc && cp portsnap.conf.sample portsnap.conf</userinput></screen>
|
||||
<screen>&prompt.root; <userinput>cd /usr/local/etc && cp portsnap.conf.sample portsnap.conf</userinput></screen>
|
||||
</note>
|
||||
</sect2>
|
||||
|
||||
|
@ -2490,7 +2490,7 @@ doc/zh_*</screen>
|
|||
<filename>/usr/ports/</filename>, and will send an email if any
|
||||
installed ports are out of date:</para>
|
||||
|
||||
<programlisting>0 3 * * * root portsnap -I cron update && pkg_version -vIL=</programlisting>
|
||||
<programlisting>0 3 * * * root portsnap -I cron update && pkg_version -vIL=</programlisting>
|
||||
|
||||
<note>
|
||||
<para>If the system clock is not set to the local time zone,
|
||||
|
@ -2504,7 +2504,7 @@ doc/zh_*</screen>
|
|||
in the same invocation of <command>portsnap</command>. If
|
||||
the line above fails, try replacing
|
||||
<command>portsnap -I cron update</command> with
|
||||
<command>portsnap cron && portsnap -I update</command>.</para>
|
||||
<command>portsnap cron && portsnap -I update</command>.</para>
|
||||
</note>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
|
|
@ -3723,11 +3723,11 @@ www IN CNAME @</programlisting>
|
|||
<listitem>
|
||||
<para>Rearrange and create basic zone and configuration files:</para>
|
||||
<screen>&prompt.root; <userinput>cp /etc/localtime etc</userinput><co id="localtime">
|
||||
&prompt.root; <userinput>mv named.conf etc && ln -sf etc/named.conf</userinput>
|
||||
&prompt.root; <userinput>mv named.conf etc && ln -sf etc/named.conf</userinput>
|
||||
&prompt.root; <userinput>mv named.root master</userinput>
|
||||
<!-- I don't like this next bit -->
|
||||
&prompt.root; <userinput>sh make-localhost</userinput>
|
||||
&prompt.root; <userinput>cat > master/named.localhost
|
||||
&prompt.root; <userinput>cat > master/named.localhost
|
||||
$ORIGIN localhost.
|
||||
$TTL 6h
|
||||
@ IN SOA localhost. postmaster.localhost. (
|
||||
|
@ -3758,12 +3758,12 @@ $TTL 6h
|
|||
<application>named-xfer</application>, and copy it into the sandbox:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cd /usr/src/lib/libisc</userinput>
|
||||
&prompt.root; <userinput>make cleandir && make cleandir && make depend && make all</userinput>
|
||||
&prompt.root; <userinput>make cleandir && make cleandir && make depend && make all</userinput>
|
||||
&prompt.root; <userinput>cd /usr/src/lib/libbind</userinput>
|
||||
&prompt.root; <userinput>make cleandir && make cleandir && make depend && make all</userinput>
|
||||
&prompt.root; <userinput>make cleandir && make cleandir && make depend && make all</userinput>
|
||||
&prompt.root; <userinput>cd /usr/src/libexec/named-xfer</userinput>
|
||||
&prompt.root; <userinput>make cleandir && make cleandir && make depend && make NOSHARED=yes all</userinput>
|
||||
&prompt.root; <userinput>cp named-xfer /etc/namedb/bin && chmod 555 /etc/namedb/bin/named-xfer</userinput><co id="clean-cruft"></screen>
|
||||
&prompt.root; <userinput>make cleandir && make cleandir && make depend && make NOSHARED=yes all</userinput>
|
||||
&prompt.root; <userinput>cp named-xfer /etc/namedb/bin && chmod 555 /etc/namedb/bin/named-xfer</userinput><co id="clean-cruft"></screen>
|
||||
|
||||
<para>After your statically linked
|
||||
<command>named-xfer</command> is installed some cleaning up
|
||||
|
@ -3782,11 +3782,11 @@ $TTL 6h
|
|||
<para>This step has been reported to fail occasionally. If this
|
||||
happens to you, then issue the command:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cd /usr/src && make cleandir && make cleandir</userinput></screen>
|
||||
<screen>&prompt.root; <userinput>cd /usr/src && make cleandir && make cleandir</userinput></screen>
|
||||
|
||||
<para>and delete your <filename>/usr/obj</filename> tree:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>rm -fr /usr/obj && mkdir /usr/obj</userinput></screen>
|
||||
<screen>&prompt.root; <userinput>rm -fr /usr/obj && mkdir /usr/obj</userinput></screen>
|
||||
|
||||
<para>This will clean out any <quote>cruft</quote> from your
|
||||
source tree, and retrying the steps above should then work.</para>
|
||||
|
@ -3804,7 +3804,7 @@ $TTL 6h
|
|||
<para>Make a <filename>dev/null</filename> that
|
||||
<application>named</application> can see and write to:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cd /etc/namedb/dev && mknod null c 2 2</userinput>
|
||||
<screen>&prompt.root; <userinput>cd /etc/namedb/dev && mknod null c 2 2</userinput>
|
||||
&prompt.root; <userinput>chmod 666 null</userinput></screen>
|
||||
</listitem>
|
||||
|
||||
|
|
|
@ -390,7 +390,7 @@
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>Line 6 & 7:</term>
|
||||
<term>Line 6 & 7:</term>
|
||||
|
||||
<indexterm><primary>PPP</primary><secondary>user PPP</secondary></indexterm>
|
||||
<listitem>
|
||||
|
@ -469,7 +469,7 @@
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>Line 13 & 14:</term>
|
||||
<term>Line 13 & 14:</term>
|
||||
|
||||
<listitem>
|
||||
<para>Identifies the user name and password. When
|
||||
|
@ -1696,7 +1696,7 @@ reinput 1 {\255}
|
|||
if success goto slhup
|
||||
reinput 1 {\127}
|
||||
if success goto slhup
|
||||
if < \%x 60 goto look
|
||||
if < \%x 60 goto look
|
||||
else goto slhup
|
||||
|
||||
:sllogin ; login
|
||||
|
@ -1717,7 +1717,7 @@ reinput 1 {\255}
|
|||
if success goto slhup
|
||||
reinput 1 {\127}
|
||||
if success goto slhup
|
||||
if < \%x 10 goto slloop ; try 10 times to get a login prompt
|
||||
if < \%x 10 goto slloop ; try 10 times to get a login prompt
|
||||
else goto slhup ; hang up and start again if 10 failures
|
||||
|
||||
:sluid
|
||||
|
|
|
@ -4799,7 +4799,7 @@ drwxr-xr-x 2 robert robert 512 Nov 10 11:54 public_html</programlisting>
|
|||
<para>To begin using <application>Portaudit</application>, one
|
||||
must install it from the Ports Collection:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cd /usr/ports/security/portaudit && make install clean</userinput></screen>
|
||||
<screen>&prompt.root; <userinput>cd /usr/ports/security/portaudit && make install clean</userinput></screen>
|
||||
|
||||
<para>During the install process, the configuration files for
|
||||
&man.periodic.8; will be updated, permitting
|
||||
|
|
|
@ -2494,7 +2494,7 @@ Keyboard: no</screen>
|
|||
interrupt the boot process. The boot blocks will then prompt you
|
||||
for further action. You should now see something like:</para>
|
||||
|
||||
<screen>>> FreeBSD/i386 BOOT
|
||||
<screen>>> FreeBSD/i386 BOOT
|
||||
Default: 0:ad(0,a)/boot/loader
|
||||
boot:</screen>
|
||||
|
||||
|
|
|
@ -1421,8 +1421,8 @@ DisplayManager.requestPort: 0</screen>
|
|||
<application>/usr/X11R6/bin/gnome-session</application>:
|
||||
</para></note>
|
||||
|
||||
<screen>&prompt.user; <userinput>echo "#!/bin/sh" > ~/.xsession</userinput>
|
||||
&prompt.user; <userinput>echo "/usr/X11R6/bin/gnome-session" >> ~/.xsession</userinput>
|
||||
<screen>&prompt.user; <userinput>echo "#!/bin/sh" > ~/.xsession</userinput>
|
||||
&prompt.user; <userinput>echo "/usr/X11R6/bin/gnome-session" >> ~/.xsession</userinput>
|
||||
&prompt.user; <userinput>chmod +x ~/.xsession</userinput></screen>
|
||||
|
||||
<para>Yet another option is to configure the display manager to
|
||||
|
|
|
@ -382,7 +382,7 @@ Linking index</screen>
|
|||
variables in the shell and, by tradition, consist of all
|
||||
upper-case letters (you do not have to use all upper-case
|
||||
letters. In fact there is nothing to stop you from calling a
|
||||
variable <literal>@^&$%$</literal>. Just tradition). Variables
|
||||
variable <literal>@^&$%$</literal>. Just tradition). Variables
|
||||
are assigned-to using lines of the form:</para>
|
||||
|
||||
<programlisting>VARIABLE = value</programlisting>
|
||||
|
|
|
@ -271,13 +271,13 @@ still more lines
|
|||
|
||||
<para>Each boolean expression is made up of terms that look
|
||||
like function calls, the standard C boolean operators
|
||||
<literal>&&</literal>, <literal>||</literal>, and
|
||||
<literal>&&</literal>, <literal>||</literal>, and
|
||||
<literal>!</literal>, and the standard relational operators
|
||||
<literal>==</literal>, <literal>!=</literal>, <literal>></literal>,
|
||||
<literal>>=</literal>, <literal><</literal>, and
|
||||
<literal><=</literal>, with <literal>==</literal> and
|
||||
<literal>!=</literal> being overloaded to allow string
|
||||
comparisons as well. <literal>&&</literal> represents logical
|
||||
comparisons as well. <literal>&&</literal> represents logical
|
||||
AND; <literal>||</literal> is logical OR and <literal>!</literal>
|
||||
is logical NOT. The arithmetic and string operators take
|
||||
precedence over all three of these operators, while NOT
|
||||
|
|
|
@ -148,13 +148,13 @@ c.o : c.c
|
|||
|
||||
<screen>Suff_FindDeps (a.out)
|
||||
using existing source a.o
|
||||
applying .o -> .out to "a.o"
|
||||
applying .o -> .out to "a.o"
|
||||
Suff_FindDeps (a.o)
|
||||
trying a.c...got it
|
||||
applying .c -> .o to "a.c"
|
||||
applying .c -> .o to "a.c"
|
||||
Suff_FindDeps (b.o)
|
||||
trying b.c...got it
|
||||
applying .c -> .o to "b.c"
|
||||
applying .c -> .o to "b.c"
|
||||
Suff_FindDeps (a.c)
|
||||
trying a.y...not there
|
||||
trying a.l...not there
|
||||
|
@ -234,9 +234,9 @@ cc a.o b.o</screen>
|
|||
trying jive.c...not there
|
||||
trying jive.y...not there
|
||||
trying jive.l...got it
|
||||
applying .l -> .c to "jive.l"
|
||||
applying .c -> .o to "jive.c"
|
||||
applying .o -> .out to "jive.o"</screen>
|
||||
applying .l -> .c to "jive.l"
|
||||
applying .c -> .o to "jive.c"
|
||||
applying .o -> .out to "jive.o"</screen>
|
||||
|
||||
<para>and this is why: <application>PMake</application> starts with the
|
||||
target <filename>jive.out</filename>, figures out its suffix
|
||||
|
@ -256,7 +256,7 @@ cc a.o b.o</screen>
|
|||
for <filename>jive.l</filename> and, lo and behold, there it is.
|
||||
At this point, it has defined a transformation path as follows:</para>
|
||||
|
||||
<literallayout><filename>.l</filename> -> <filename>.c</filename> -> <filename>.o</filename> -> <filename>.out</filename></literallayout>
|
||||
<literallayout><filename>.l</filename> -> <filename>.c</filename> -> <filename>.o</filename> -> <filename>.out</filename></literallayout>
|
||||
|
||||
<para>and applies the transformation rules accordingly. For completeness,
|
||||
and to give you a better idea of what <application>PMake</application>
|
||||
|
@ -266,10 +266,10 @@ cc a.o b.o</screen>
|
|||
|
||||
<screen>Suff_FindDeps (jive.o)
|
||||
using existing source jive.c
|
||||
applying .c -> .o to "jive.c"
|
||||
applying .c -> .o to "jive.c"
|
||||
Suff_FindDeps (jive.c)
|
||||
using existing source jive.l
|
||||
applying .l -> .c to "jive.l"
|
||||
applying .l -> .c to "jive.l"
|
||||
Suff_FindDeps (jive.l)
|
||||
Examining jive.l...modified 17:16:01 Oct 4, 1987...up-to-date
|
||||
Examining jive.c...non-existent...out-of-date
|
||||
|
@ -485,20 +485,20 @@ lib2.a : $(LIB2OBJS)
|
|||
<programlisting>system : init a.fasl b.fasl c.fasl
|
||||
for i in $(.ALLSRC);
|
||||
do
|
||||
echo -n '(load "' >> input
|
||||
echo -n ${i} >> input
|
||||
echo '")' >> input
|
||||
echo -n '(load "' >> input
|
||||
echo -n ${i} >> input
|
||||
echo '")' >> input
|
||||
done
|
||||
echo '(dump "$(.TARGET)")' >> input
|
||||
lisp < input
|
||||
echo '(dump "$(.TARGET)")' >> input
|
||||
lisp < input
|
||||
|
||||
a.fasl : a.l init COMPILE
|
||||
b.fasl : b.l init COMPILE
|
||||
c.fasl : c.l init COMPILE
|
||||
COMPILE : .USE
|
||||
echo '(compile "$(.ALLSRC)")' >> input
|
||||
echo '(compile "$(.ALLSRC)")' >> input
|
||||
init : .EXEC
|
||||
echo '(load-system)' > input</programlisting>
|
||||
echo '(load-system)' > input</programlisting>
|
||||
|
||||
<literal>.EXEC</literal> sources, do not appear in the
|
||||
local variables of targets that depend on them (nor are
|
||||
|
|
|
@ -2601,12 +2601,12 @@ MASTER_SITES= alpha:DEFAULT,SOME_SITE</programlisting>
|
|||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>Directories within group
|
||||
<literal>DEFAULT</literal> -> old:n</para>
|
||||
<literal>DEFAULT</literal> -> old:n</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Directories within group
|
||||
<literal>NEW</literal> -> new</para>
|
||||
<literal>NEW</literal> -> new</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</example>
|
||||
|
@ -8965,7 +8965,7 @@ Reference: <http://www.freebsd.org/ports/portaudit/74a9541d-5d6c-11d8-80e3-00
|
|||
<filename>bsd.port.pre.mk</filename>:</para>
|
||||
|
||||
<programlisting># no need to compile lang/perl5 if perl5 is already in system
|
||||
.if ${OSVERSION} > 300003
|
||||
.if ${OSVERSION} > 300003
|
||||
BROKEN= perl is in system
|
||||
.endif
|
||||
|
||||
|
@ -9575,9 +9575,9 @@ bacula:*:910:</programlisting>
|
|||
<para>resulting in the following output from
|
||||
<command>make describe</command>:</para>
|
||||
|
||||
<programlisting>===> foobar-0.1 is marked as broken: this port is unsupported on FreeBSD 5.x.</programlisting>
|
||||
<programlisting>===> foobar-0.1 is marked as broken: this port is unsupported on FreeBSD 5.x.</programlisting>
|
||||
|
||||
<programlisting>===> foobar-0.1 is unsupported on FreeBSD 5.x.</programlisting>
|
||||
<programlisting>===> foobar-0.1 is unsupported on FreeBSD 5.x.</programlisting>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
|
@ -9661,7 +9661,7 @@ IGNORE=POINTYHAT is not supported
|
|||
<command>make describe</command> (and thus, the overall
|
||||
ports <command>make index</command>). The workaround is
|
||||
to enclose the conditional comparison in spaces, e.g.:
|
||||
<programlisting>if ( ${OSVERSION} > 500023 )</programlisting>
|
||||
<programlisting>if ( ${OSVERSION} > 500023 )</programlisting>
|
||||
Be aware that test-installing a port on 4.9 or 5.2
|
||||
will <emphasis>not</emphasis> detect this problem.</para>
|
||||
</listitem>
|
||||
|
|
|
@ -189,7 +189,7 @@
|
|||
(renderas (inherited-attribute-string (normalize "renderas") sect))
|
||||
(hlevel ;; the apparent section level;
|
||||
(if renderas ;; if not real section level,
|
||||
(string->number ;; then get the apparent level
|
||||
(string->number ;; then get the apparent level
|
||||
(substring renderas 4 5)) ;; from "renderas",
|
||||
(SECTLEVEL))) ;; else use the real level
|
||||
(hs (HSIZE (- 4 hlevel))))
|
||||
|
|
Loading…
Reference in a new issue