diff --git a/handbook/Makefile b/handbook/Makefile index c8fa84f6af..9906e21f7e 100644 --- a/handbook/Makefile +++ b/handbook/Makefile @@ -1,13 +1,14 @@ -# $Id: Makefile,v 1.4 1995-10-01 04:43:11 jfieber Exp $ +# $Id: Makefile,v 1.5 1995-10-07 04:31:10 jfieber Exp $ SRCS= authors.sgml basics.sgml bibliography.sgml boothelp.sgml SRCS+= booting.sgml contrib.sgml crypt.sgml ctm.sgml current.sgml dialup.sgml SRCS+= diskless.sgml dma.sgml eresources.sgml esdi.sgml glossary.sgml SRCS+= handbook.sgml history.sgml hw.sgml install.sgml kerberos.sgml -SRCS+= kerneldebug.sgml memoryuse.sgml mirrors.sgml nfs.sgml nutshell.sgml +SRCS+= kernelconfig.sgml kerneldebug.sgml memoryuse.sgml +SRCS+= mirrors.sgml nfs.sgml nutshell.sgml SRCS+= porting.sgml ports.sgml ppp.sgml printing.sgml relnotes.sgml -SRCS+= scsi.sgml sections.sgml +SRCS+= routing.sgml scsi.sgml sections.sgml SRCS+= skey.sgml slipc.sgml slips.sgml submitters.sgml sup.sgml SRCS+= troubleshooting.sgml userppp.sgml .include diff --git a/handbook/authors.sgml b/handbook/authors.sgml index b6f5a6b758..6c3227e00a 100644 --- a/handbook/authors.sgml +++ b/handbook/authors.sgml @@ -1,104 +1,112 @@ - + "> "> "> "> "> "> "> "> +"> + +"> + "> "> "> "> "> "> "> "> "> "> "> "> "> "> "> "> diff --git a/handbook/booting.sgml b/handbook/booting.sgml index 74a168ba9c..fba9c2fd1f 100644 --- a/handbook/booting.sgml +++ b/handbook/booting.sgml @@ -1,170 +1,170 @@ The FreeBSD Booting Process

Contributed by &a.phk;. v1.1, April 26th. Booting FreeBSD is essentially a three step: Load the kernel, determine the root filesystem and initialize user-land things. This leads to some interesting possibilities shown below. Loading a kernel

We presently have three basic mechanisms for loading the kernel as described below: They all pass some information to the kernel to help the kernel decide what to do next. Biosboot Biosboot is our ``bootblocks'', it consists of two files, which will be installed in the first 8Kbytes of the floppy or hard-disk slice to be booted from. Biosboot can load a kernel from a FreeBSD filesystem. Dosboot Dosboot was written by DI. Christian Gusenbauer, and is unfortunately at this time one of the few pieces of code that isn't compilable under FreeBSD itself because it is written for MicroSoft compilers. Dosboot will boot the kernel from a MS-DOS file or from a FreeBSD filesystem partition on the disk. It attempts to negotiate with the various and strange kinds of memory manglers that lurk in high memory on MS/DOS systems and usually wins them for it's case. Netboot Netboot will try to find a supported ethernet card, and use BOOTP, TFTP and NFS to find a kernel file to boot. Determine the root filesystem

Once the kernel is loaded and the boot-code jumps to it, the kernel will initialize itself, trying to determine what hardware is present and so on, and then it needs to find a root filesystem. Presently we support the following types of rootfilesystems: UFS This is the most normal type of root filesystem. It can reside on a floppy or on harddisk. MSDOS While this is technically possible, it isn't particular useful, because of ``FAT'' filesystems inability to make links, device nodes and such ``UNIXisms''. MFS This is actually a UFS filesystem which has been compiled into the kernel. That means that the kernel does not really need any disks/floppies or other HW to function. CD9660 This is for using a CD-ROM as root filesystem. NFS This is for using a fileserver as root filesystem, basically making it a diskless machine. Initialize user-land things

To get the user-land going, when the kernel has finished initialization, it will create a with ``/sbin/init''. You can substitute any program for /sbin/init, as long as you keep in mind that: there is no stdin/out/err unless you open it yourself, if you exit, the machine panics signal handling is special for ``Interesting combinations

Boot a kernel with a MFS in it with a special /sbin/init which... mounts your /C: Attaches C:/freebsd.fs on /dev/vn0 mounts /dev/vn0 as /rootfs makes symlinks /rootfs/bin -> /bin /rootfs/etc -> /etc /rootfs/sbin -> /sbin - ... + (etc...) Now you run FreeBSD without repartitioning your hard disk... server:˜you/FreeBSD as /nfs, chroots to /nfs and executes /sbin/init there Now you run FreeBSD diskless, even though you don't control the NFS server... /dev/rwd0 and writes it to a remote tape station or fileserver. Now you finally got that backup you should have made a year ago... E -- Acts as a firewall/web-server/what do I know... This is particular interesting since you can boot from a write- protected floppy, but still write to your root filesystem... diff --git a/handbook/eresources.sgml b/handbook/eresources.sgml index 32684fdcb7..c5bc6429a8 100644 --- a/handbook/eresources.sgml +++ b/handbook/eresources.sgml @@ -1,359 +1,356 @@ - + Resources on the Internet

The rapid pace of FreeBSD progress makes print media impractical as a means for following the latest developments. Electronic resources are the best, if not the only way stay informed of the latest advances. Also, since FreeBSD is a volunteer effort, the user community also serves as the technical support department and invariably, electronic mail and Usenet news are the most effective way of getting technical problems resolved. Below, the most important points of contact with the FreeBSD user community are outlined. If you are aware of other resources not included, please send them to doc@freebsd.org so they may be included. Mailing lists -

Contributed by &a.dufalt;. - 20 Jun 1995. - -Though many of the FreeBSD development members read USENET, we cannot +

Though many of the FreeBSD development members read USENET, we cannot always guarantee that we'll get to your questions in a timely fashion (or at all) if you post them only to one of the comp.unix.bsd.* groups. By addressing your questions to the appropriate mailing list you will reach both us and a concentrated FreeBSD audience, invariably assuring a better (or at least faster) response. There are list charters at the bottom of this document. Please read the list charter before joining a list. We must strive to keep the signal to noise ratio of the lists high, especially in the technical lists. Archives are kept for all of the mailing lists and can be searched using the the . The keyword searchable archive offers an excellent way to find answers to frequently asked questions and should be consulted before posting a question. List summary

General lists: The following are general lists that anyone is free to join: List Purpose ---------------------------------------------------------------------- freebsd-announce Important events / milestones freebsd-bugs Bug reports freebsd-chat Non technical items related to the community freebsd-current Discussions about the use of FreeBSD-current freebsd-isp Issues for ISP's using FreeBSD freebsd-policy Policy issues and suggestions freebsd-questions User questions Technical lists: The following are the technical lists. You should read the charter carefully before joining them, and you should keep your e-mail within the scope of the guidelines. List Purpose ---------------------------------------------------------------------- freebsd-doc Documentation project freebsd-fs Filesystems freebsd-hackers General Technical discussions freebsd-hardware General discussion of FreeBSD hardware freebsd-multimedia Multimedia discussions freebsd-platforms Porting to Non-Intel platforms freebsd-ports Discussion of "ports" freebsd-security Security issues freebsd-scsi SCSI subsystem Limited lists: The following are limited lists that you will need approval to join. Even though access to these lists is controled, anyone is free to send suggestions and comments to them. It is a good idea establish a presence in the technical lists before asking to join one of these limited lists. List Purpose ---------------------------------------------------------------------- freebsd-admin Administrative issues freebsd-arch Architecture and design discussions freebsd-core FreeBSD core team freebsd-install Installation development freebsd-user-groups User group coordination CVS lists: The following lists are for people seeing the log messages for source changes in specific areas: List name Source area Area Description (source for) ---------------------------------------------------------------------- cvs-CVSROOT /usr/src/[A-Z]* Top level /usr/src file changes cvs-all /usr/src All changes to the tree (superset) cvs-bin /usr/src/bin System binaries cvs-etc /usr/src/etc System files cvs-games /usr/src/games Games cvs-gnu /usr/src/gnu GPL'd utilities cvs-include /usr/src/include Include files cvs-kerberosIV /usr/src/kerberosIV Kerberos encryption code cvs-lib /usr/src/lib System libraries cvs-libexec /usr/src/libexec System binaries cvs-ports /usr/ports Ported software cvs-sbin /usr/src/sbin System binaries cvs-share /usr/src/share System shared files cvs-sys /usr/src/sys Kernel cvs-usrbin /usr/src/usr.bin Use binaries cvs-usrsbin /usr/src/usr.sbin System binaries How to subscribe

All mailing lists live on FreeBSD.ORG, so to post to a list you simply mail to listname@FreeBSD.ORG. It will then be redistributed to mailing list members throughout the world. To subscribe to a list, send mail to: majordomo@FreeBSD.ORG And include the keyword subscribe [] In the body of your message. For example, to subscribe yourself to freebsd-announce, you'd do: % mail majordomo@FreeBSD.ORG subscribe freebsd-announce ^D If you want to subscribe yourself under a different name, or submit a subscription request for a local mailing list (note: this is more efficient if you have several interested parties at one site, and highly appreciated by us!), you would do something like: % mail majordomo@FreeBSD.ORG subscribe freebsd-announce local-announce@somesite.com ^D Finally, it is also possible to unsubscribe yourself from a list, get a list of other list members or see the list of mailing lists again by sending other types of control messages to majordomo. For a complete list of available commands, do this: % mail majordomo@FreeBSD.ORG help ^D Finally, we again request that you keep the technical mailing lists on a technical track. If you're only interested in the "high points", then it's suggested that you join freebsd-announce, which will contain only infrequent traffic. List charters

Administrative issues Important events / milestones This is the mailing list for people interested only in occasional announcements of significant freebsd events. This includes announcements about snapshots and other releases. It contains announcements of new FreeBSD capabilities. It may contain calls for volunteers etc. This is a low volume list. Architecture and design discussions This is the mailing list for people discussing FreeBSD architectural issues. It is a closed list, and not for general subscription. Bug reports This is the mailing list for reporting bugs in FreeBSD Whenever possible, bugs should be submitted using "send-pr". Non technical items related to the community This list contains the overflow from the other lists about non-technical, social information. It includes discussion about whether Jordan looks like a tune ferret or not, whether or not to type in capitals, who is drinking too much coffee, where the best beer is brewed, who is brewing beer in their basement, and so on. Occasional announcements of important events (such as upcoming parties, weddings, births, new jobs, etc) can be made to the technical lists, but the follow ups should be directed to this -chat list. FreeBSD core team This is an internal mailing list for use by the core members. Discussions about the use of FreeBSD-current This is the mailing list for users of freebsd-current. It includes warnings about new features coming out in -current that will affect the users, and instructions on steps that must be taken to remain -current. Anyone running "current" must subscribe to this list. Discussions about the use of FreeBSD-current This is the digest version of the freebsd-current mailing list. The digest consists of all messages sent to freebsd-current bundled together and mailed out as a single message. The average digest size is about 40kB. Documentation project This mailing list belongs to the FreeBSD Doc Project and is for the discussion of documentation related issues and projects. Filesystems Discussions concerning FreeBSD filesystems. Technical discussions This is a forum for technical discussions related to FreeBSD. This is the primary technical mailing list. It is for individuals actively working on FreeBSD, to bring up problems or discuss alternative solutions. Individuals interested in following the technical discussion are also welcome. Technical discussions This is the digest version of the freebsd-hackers mailing list. The digest consists of all messages sent to freebsd-hackers bundled together and mailed out as a single message. The average digest size is about 40kB. General discussion of FreeBSD hardware General discussion about the types of hardware that FreeBSD runs on, various problems and suggestions concerning what to buy or avoid. Installation discussion This mailing list is for discussing FreeBSD installation development for the future releases. Issues for Internet Service Providers This mailing list is for discussing topics relevant to Internet Serivce Providers (ISPs) using FreeBSD. Multimedia discussions This is a forum about multimedia applications using FreeBSD. Discussion center around multimedia applications, their installation, their development and their support within FreeBSD Porting to Non-Intel platforms Cross-platform freebsd issues, general discussion and proposals for non-Intel FreeBSD ports. Policy issues and suggestions This is a forum for policy discussions related to FreeBSD. This includes where FreeBSD is going, how to set up a consortium, whether or not and how to make FreeBSD pay for itself, how to attract more users, and so on. When a topic relates directly to FreeBSD but has little or no technical content then it should be sent to this list. Discussion of "ports" Discussions concerning FreeBSD's "ports collection" (/usr/ports), proposed ports, modifications to ports collection infrastructure and general coordination efforts. User questions This is the mailing list for questions about FreeBSD. You should not send "how to" questions to the technical lists unless you consider the question to be pretty technical. User questions This is the digest version of the freebsd-questions mailing list. The digest consists of all messages sent to freebsd-questions bundled together and mailed out as a single message. The average digest size is about 40kB. SCSI subsystem This is the mailing list for people working on the scsi subsystem for FreeBSD. Security issues FreeBSD computer security issues (DES, Kerberos, known security holes and fixes, etc). User Group Coordination List This is the mailing list for the coordinators from each of the local area Users Groups to discuss matters with each other and a designated individual from the Core Team. This mail list should be limited to meeting synopsis and coordination of projects that span User Groups. Usenet newsgroups

In addition to two FreeBSD specific newsgroups, there are many others in which FreeBSD is discussed or are otherwise relevant to FreeBSD users. are available for some of these newsgroups from courtesy of Warren Toomey <wkt@cs.adfa.oz.au>. BSD specific newsgroups

comp.unix.bsd.freebsd.announce comp.unix.bsd.freebsd.misc Other Unix newsgroups of interest

comp.unix comp.unix.questions comp.unix.admin comp.unix.programmer comp.unix.shell comp.unix.user-friendly comp.security.unix comp.sources.unix comp.unix.advocacy comp.unix.misc comp.os.386bsd.announce comp.os.386bsd.apps comp.os.386bsd.bugs comp.os.386bsd.development comp.os.386bsd.misc comp.os.386bsd.questions comp.bugs.4bsd comp.bugs.4bsd.ucb-fixes comp.unix.bsd X-Window system

comp.windows.x.i386unix comp.windows.x comp.windows.x.apps comp.windows.x.announce comp.windows.x.intrinsics comp.windows.x.motif comp.windows.x.pex comp.emulators.ms-windows.wine World Wide Web servers

diff --git a/handbook/esdi.sgml b/handbook/esdi.sgml index e75a19d9f7..5d79f44fd3 100644 --- a/handbook/esdi.sgml +++ b/handbook/esdi.sgml @@ -1,421 +1,421 @@ - + ESDI hard disks and FreeBSD -

© 1995, &a.wilko;.24 September 1995. +

Copyright © 1995, &a.wilko;.24 September 1995. ESDI is an acronym that means Enhanced Small Device Interface. It is loosely based on the good old ST506/412 interface originally devised by Seagate Technology, the makers of the first affordable 5.25" winchester disk. The acronym says Enhanced, and rightly so. In the first place the speed of the interface is higher, 10 or 15 Mbits/second instead of the 5 Mbits/second of ST412 interfaced drives. Secondly some higher level commands are added, making the ESDI interface somewhat 'smarter' to the operating system driver writers. It is by no means as smart as SCSI by the way. ESDI is standardised by ANSI. Capacities of the drives are boosted by putting more sectors on each track. Typical is 35 sectors per track, high capacity drives I've seen were up to 54 sectors/track. Although ESDI has been largely obsoleted by IDE and SCSI interfaces, the availability of free or cheap surplus drives makes them ideal for low (or now) budget systems. Concepts of ESDI

Physical connections

The ESDI interface uses two cables connected to each drive. One cable is a 34 pin flatcable edge connector that carries the command and status signals from the controller to the drive and viceversa. The command cable is daisy chained between all the drives. So, it forms a bus onto which all drives are connected. The second cable is a a 20 pin flatcable edge connector that carries the data to and from the drive. This cable is radially connected, so each drive has it's own direct connection to the controller. To the best of my knowledge PC ESDI controllers are limited to using a maximum of 2 drives per controller. This is compatibility feature(?) left over from the WD1003 standard that reserves only a single bit for device addressing. Device addressing

On each command cable a maximum of 7 devices and 1 controller can be present. To enable the controller to uniquely identify which drive it addresses, each ESDI device is equipped with jumpers or switches to select the devices address. On PC type controllers the first drive is set to address 0, the second disk to address 1. Always make sure you set each disk to an unique address! So, on a PC with it's two drives/controller maximum the first drive is drive 0, the second is drive 1. Termination

The daisy chained command cable (the 34 pin cable remember?) needs to be terminated at the last drive on the chain. For this purpose ESDI drives come with a termination resistor network that can be removed or disabled by a jumper when it is not used. So, one and only one drive, the one at the fartest end of the command cable has it's terminator installed/enabled. The controller automatically terminates the other end of the cable. Please note that this implies that the controller must be at one end of the cable and not in the middle. Using ESDI disks with FreeBSD

Why is ESDI such a pain to get working in the first place? People who tried ESDI disks with FreeBSD are known to have developed a profound sense of frustration. A combination of factors works against you to produce effects that are hard to understand when you have never seen them before. This has also led to the popular legend ESDI and FreeBSD is a plain NO-GO. The following sections try to list all the pitfalls and solutions. ESDI speed variants

As briefly mentioned before, ESDI comes in two speed flavours. The older drives and controllers use a 10 Mbits/second data transfer rate. Newer stuff uses 15 Mbits/second. It is not hard to imagine that 15 Mbits/second drive cause problems on controllers laid out for 10 Mbits/second. As always, consult your controller and drive documentation to see if things match. Stay on track

Mainstream ESDI drives use 34 to 36 sectors per track. Most (older) controllers cannot handle more than this number of sectors. Newer, higher capacity, drives use higher numbers of sectors per track. For instance, I own a 670 Mb drive that has 54 sectors per track. In my case, the controller could not handle this number of sectors. It proved to work well except that it only used 35 sectors on each track. This meant losing a lot of diskspace. Once again, check the documentation of your hardware for more info. Going out-of-spec like in the example might or might not work. Give it a try or get another more capable controller. Hard or soft sectoring

Most ESDI drives allow hard or soft sectoring to be selected using a jumper. Hard sectoring means that the drive will produce a sector pulse on the start of each new sector. The controller uses this pulse to tell when it should start to write or read. Hard sectoring allows a selection of sector size (normally 256, 512 or 1024 bytes per formatted sector). FreeBSD uses 512 byte sectors. The number of sectors per track also varies while still using the same number of bytes per formatted sector. The number of unformatted bytes per sector varies, dependent on your controller it needs more or less overhead bytes to work correctly. Pushing more sectors on a track of course gives you more usable space, but might give problems if your controller needs more bytes than the drive offers. In case of soft sectoring, the controller itself determines where to start/stop reading or writing. For ESDI hard sectoring is the default (at least on everything I came across). I never felt the urge to try soft sectoring. In general, experiment with sector settings before you install FreeBSD because you need to re-run the low-level format after each change. Low level formatting

ESDI drives need to be low level formatted before they are usable. A reformat is needed whenever you figgle with the number of sectors/track jumpers or the physical orientation of the drive (horizontal, vertical). So, first think, then format. The format time must not be underestimated, for big disks it can take hours. After a low level format, a surface scan is done to find and flag bad sectors. Most disks have a manufacturer bad block list listed on a piece of paper or adhesive sticker. In addition, on most disks the list is also written onto the disk. Please use the manufacturer's list. It is much easier to remap a defect now than after FreeBSD is installed. Stay away from low-level formatters that mark all sectors of a track as bad as soon as they find one bad sector. Not only does this waste space, it also and more importantly causes you grief with bad144 (see the section on bad144). Translations

Translations, although not exclusively a ESDI-only problem, might give you real trouble. Translations come in multiple flavours. Most of them have in common that they attempt to work around the limitations posed upon disk geometries by the original IBM PC/AT design (thanks IBM!). First of all there is the (in)famous 1024 cylinder limit. For a system to be able to boot, the stuff (whatever operating system) must be in the first 1024 cylinders of a disk. Only 10 bits are available to encode the cylinder number. For the number of sectors the limit is 64 (0-63). When you combine the 1024 cylinder limit with the 16 head limit (also a design feature) you max out at fairly limited disk sizes. To work around this problem, the manufacturers of ESDI PC controllers added a BIOS prom extension on their boards. This BIOS extension handles disk I/O for booting (and for some operating systems all disk I/O) by using translation. For instance, a big drive might be presented to the system as having 32 heads and 64 sectors/track. The result is that the number of cylinders is reduced to something below 1024 and is therefore usable by the system without problems. It is noteworthy to know that FreeBSD after it's kernel has started no longer uses the BIOS. More on this later. A second reason for translations is the fact that most older system BIOSes could only handle drives with 17 sectors per track (the old ST412 standard). Newer system BIOSes usually have a user-defined drive type (in most cases this is drive type 47). Whatever you do to translations after reading this document, keep in mind that if you have multiple operating systems on the same disk, all must use the same translation While on the subject of translations, I've seen one controller type (but there are probably more like this) offer the option to logically split a drive in multiple partitions as a BIOS option. I had select 1 drive == 1 partition because this controller wrote this info onto the disk. On powerup it read the info and presented itself to the system based on the info from the disk. Spare sectoring

Most ESDI controllers offer the possibility to remap bad sectors. During/after the low-level format of the disk bad sectors are marked as such, and a replacement sector is put in place (logically of course) of the bad one. In most cases the remapping is done by using N-1 sectors on each track for actual datastorage, and sector N itself is the spare sector. N is the total number of sectors physically available on the track. The idea behind this is that the operating system sees a 'perfect' disk without bad sectors. In the case of FreeBSD this concept is not usable. The problem is that the translation from bad to good is performed by the BIOS of the ESDI controller. FreeBSD, being a true 32 bit operating system, does not use the BIOS after it has been booted. Instead, it has device drivers that talk directly to the hardware. So: don't use spare sectoring, bad block remapping or whatever it may be called by the controller manufacturer when you want to use the disk for FreeBSD. Bad block handling

The preceding section leaves us with a problem. The controller's bad block handling is not usable and still FreeBSD's filesystems assume perfect media without any flaws. To solve this problem, FreeBSD use the bad144 tool. Bad144 (named after a Digital Equipment standard for bad block handling) scans a FreeBSD slice for bad blocks. Having found these bad blocks, it writes a table with the offending block numbers to the end of the FreeBSD slice. When the disk is in operation, the diskaccesses are checked against the table read from the disk. Whenever a blocknumber is requested that is in the bad144 list, a replacement block (also from the end of the FreeBSD slice) is used. In this way, the bad144 replacement scheme presents 'perfect' media to the FreeBSD filesystems. There are a number of potential pitfalls associated with the use of bad144. First of all, the slice cannot have more than 126 bad sectors. If your drive has a high number of bad sectors, you might need to divide it into multiple FreeBSD slices each containing less than 126 bad sectors. Stay away from low-level format programs that mark every sector of a track as bad when they find a flaw on the track. As you can imagine, the 126 limit is quickly reached when the low-level format is done this way. Second, if the slice contains the root filesystem, the slice should be within the 1024 cylinder BIOS limit. During the boot process the bad144 list is read using the BIOS and this only succeeds when the list is within the 1024 cylinder limit. Note that the restriction is not that only the root filesystem must be within the 1024 cylinder limit, but rather the entire slice that contains the root filesystem. Kernel configuration

ESDI disks are handled by the same wddriver as IDE and ST412 MFM disks. The wd driver should work for all WD1003 compatible interfaces. Most hardware is jumperable for one of two different I/O address ranges and IRQ lines. This allows you to have two wd type controllers in one system. When your hardware allows non-standard strappings, you can use these with FreeBSD as long as you enter the correct info into the kernel config file. An example from the kernel config file (they live in /sys/i386/conf BTW). # First WD compatible controller controller wdc0 at isa? port "IO_WD1" bio irq 14 vector wdintr disk wd0 at wdc0 drive 0 disk wd1 at wdc0 drive 1 # Second WD compatible controller controller wdc1 at isa? port "IO_WD2" bio irq 15 vector wdintr disk wd2 at wdc1 drive 0 disk wd3 at wdc1 drive 1 Particulars on ESDI hardware

Adaptec 2320 controllers

I succesfully installed FreeBSD onto a ESDI disk controlled by a ACB-2320. No other operating system was present on the disk. To do so I low level formatted the disk using NEFMT.EXE (ftpable from www.adaptec.com) and answered NO to the question whether the disk should be formatted with a spare sector on each track. The BIOS on the ACD-2320 was disabled. I used the 'free configurable' option in the system BIOS to allow the BIOS to boot it. Before using NEFMT.EXE I tried to format the disk using the ACB-2320 BIOS builtin formatter. This proved to be a showstopper, because it didn't give me an option to disable spare sectoring. With spare sectoring enabled the FreeBSD installation process broke down on the bad144 run. Please check carefully which ACB-232xy variant you have. The x is either 0 or 2, indicating a controller without or with a floppy controller on board. The y is more interesting. It can either be a blank, a "A-8" or a "D". A blank indicates a plain 10 Mbits/second controller. An "A-8" indicates a 15 Mbits/second controller capable of handling 52 sectors/track. A "D" means a 15 Mbits/second controller that can also handle drives with > 36 sectors/track (also 52 ?). All variations should be capable of using 1:1 interleaving. Use 1:1, FreeBSD is fast enough to handle it. Western Digital WD1007 controllers

I succesfully installed FreeBSD onto a ESDI disk controlled by a WD1007 controller. To be precise, it was a WD1007-WA2. Other variations of the WD1007 do exist. To get it to work, I had to disable the sector translation and the WD1007's onboard BIOS. This implied I could not use the low-level formatter built into this BIOS. Instead, I grabbed WDFMT.EXE from www.wdc.com Running this formatted my drive just fine. Ultrastor U14F controllers

According to multiple reports from the net, Ultrastor ESDI boards work OK with FreeBSD. I lack any further info on particular settings. Further reading

If you intend to do some serious ESDI hacking, you might want to have the official standard at hand: The latest ANSI X3T10 committee document is: Enhanced Small Device Interface (ESDI) [X3.170-1990/X3.170a-1991] [X3T10/792D Rev 11] On Usenet the newsgroup is a noteworthy place to look for more info. The World Wide Web (WWW) also proves to be a very handy info source: For info on Adaptec ESDI controllers see . For info on Western Digital controllers see . Thanks to...

Andrew Gordon for sending me an Adaptec 2320 controller and ESDI disk for testing. diff --git a/handbook/handbook.sgml b/handbook/handbook.sgml index 8c96a59ec2..96f9812f23 100644 --- a/handbook/handbook.sgml +++ b/handbook/handbook.sgml @@ -1,170 +1,158 @@ - + %authors; %sections; ]> FreeBSD Handbook <author> <name>The FreeBSD Documentation Project</name> </author> - <date>September 30, 1995</date> + <date>October 6, 1995</date> <abstract>Welcome to FreeBSD! This handbook covers the installation and day to day use of <bf>FreeBSD Release 2.0.5</bf>. This manual is a <bf>work in progress</bf> and is the work of many individuals. Many sections do not yet exist and some of those that do exist need to be updated. If you are interested in helping with this project, send -email to &a.jfieber; or to the FreeBSD Documentation +email to the FreeBSD Documentation Project mailing list <tt><htmlurl url="mailto:doc@freebsd.org" name="<doc@freebsd.org>"></tt>. The latest version of this document is always available from the <url url="http://www.freebsd.org/" name="FreeBSD World Wide Web server">. </abstract> <toc> <!-- ************************************************************ --> <part><heading>Basics</heading> <chapt><heading>Introduction</heading> &nutshell; &history; &relnotes; &install; &basics; <chapt><heading>Installing applications</heading> <sect><heading>* Installing packages</heading> &ports; &porting; <!-- ************************************************************ --> <part><heading>System Administration</heading> - <chapt><heading>Reconfiguring the Kernel<label id="kernelconfig"></heading> - <p>This section is in progress. Please contact - Deborah Bennett <htmlurl url="mailto:deborah@gallifrey.microunity.com" - name="<deborah@gallifrey.microunity.com>"> for more information. - In the meantime, please refer to - Kernel Configuration section of the <url url="../FAQ/freebsd-faq.html" - name="FreeBSD FAQ">. - <!-- &kernelconfig; --> - + &kernelconfig; <chapt><heading>Users, groups and security</heading> &crypt; &skey; &kerberos; <sect><heading>* Firewalls</heading> &printing; -<!-- - <chapt><heading>Printing</heading> - <p>This section is in progress. Please contact - Sean Kelly <url url="mailto:kelly@fsl.noaa.gov" - name="kelley@fsl.noaa.gov"> for more information. ---> <chapt><heading>The X-Window System</heading> <p>Pending the completion of this section, please refer to documentation supplied by the <url url="http://www.xfree86.org/" name="The XFree86 Project, Inc">. <chapt><heading>Managing hardware</heading> <sect><heading>* Adding and reconfiguring disks</heading> &scsi; &esdi; <sect><heading>* Tapes and backups</heading> <sect><heading>* Serial ports</heading> <sect><heading>* Sound cards</heading> <!-- ************************************************************ --> <part><heading>Network Communications</heading> <chapt><heading>Basic Networking</heading> <sect><heading>* Ethernet basics</heading> <sect><heading>* Serial basics</heading> <sect><heading>* Hardwired Terminals</heading> &dialup; <chapt><heading>PPP and SLIP</heading> <p>If your connection to the internet is through a modem, or you wish to provide other people with dialup connections to the internet using FreeBSD, you have the option of using PPP or SLIP. Furthermore, two varieties of PPP are provided: <em>user</em> (sometimes referred to as iijppp) and <em>kernel</em>. The procedures for configuring both types of PPP, and for setting up SLIP are described in this chapter. &userppp; &ppp; &slipc; &slips; <chapt><heading>Advanced networking</heading> +<!-- <sect><heading>Gateways and routing</heading> <p>This section is in progress. Please contact Coranth Gryphon <htmlurl url="mailto:gryphon@healer.com" name="<gryphon@healer.com>"> for more information. - +--> + &routing; &nfs; &diskless; <sect><heading>* Yellow Pages/NIS</heading> <sect><heading>* ISDN</heading> <chapt><heading>* Mail</heading> <!-- ************************************************************ --> <part><heading>Advanced topics</heading> ¤t; &ctm; ⊃ &kerneldebug; &submitters; &troubleshooting; <!-- ************************************************************ --> <part><heading>Appendices</heading> &mirrors; &bibliography; &eresources; &hw; <chapt><heading>Assorted technical topics</heading> &booting; &memoryuse; &dma; &contrib; - &glossary; +<!-- &glossary; --> </book> </linuxdoc> diff --git a/handbook/hw.sgml b/handbook/hw.sgml index 365ddf0348..87f82c2f91 100644 --- a/handbook/hw.sgml +++ b/handbook/hw.sgml @@ -1,319 +1,319 @@ -<!-- $Id: hw.sgml,v 1.7 1995-10-02 15:59:53 wollman Exp $ --> +<!-- $Id: hw.sgml,v 1.8 1995-10-07 04:31:26 jfieber Exp $ --> <!-- The FreeBSD Documentation Project --> <!-- <!DOCTYPE linuxdoc PUBLIC "-//FreeBSD//DTD linuxdoc//EN"> --> <chapt><heading>PC Hardware compatibility<label id="hw"></heading> <p>Issues of hardware compatibility are among the most troublesome in the computer industry today and FreeBSD is by no means immune to trouble. In this respect, FreeBSD's advantage of being able to run on inexpensive commidity PC hardware is also its liability when it comes to support for the amazing variety of components on the market. While it would be impossible to provide a exhaustive listing of hardware that FreeBSD supports, this section serves as a catalog of the device drivers included with FreeBSD and the hardware each drivers supports. Where possible and appropriate, notes about specific products are included. As FreeBSD is a volunteer project without a funded testing department, we depend on you, the user, for much of the information contained in this catalog. If you have direct experience of hardware that does or does not work with FreeBSD, please let us know by sending email to <tt>doc@freebsd.org</tt>. Questions about supported hardware should be directed to <tt>questions@freebsd.org</tt> (see <ref id="eresources:mail" name="Mailing Lists"> for more information). When submitting information or asking a question, please remember to specify exactly what version of FreeBSD you are using and include as many details of your hardware as possible. <sect><heading>Core/Processing<label id="hw:core"></heading> <sect1><heading>Motherboards, busses, and chipsets</heading> <sect2><heading>* ISA</heading> <sect2><heading>* EISA</heading> <sect2><heading>* VLB</heading> <sect2><heading>PCI</heading> <p><em>Contributed by &a.rgrimes;.<newline>25 April 1995.</em></p> <p>Of the Intel PCI chip sets the following is a list of brokenness from worst to best and a short description of brokenness.</p> <p><descrip> <tag>Mercury:</tag> Cache coherency problems, especially if there are ISA bus masters behind the ISA to PCI bridge chip. Hardware flaw, only known work around is to turn the cache off. - <tag>Saturn-I <em>(ie, 82424ZX at rev 0, 1 or - 2)</em>:</tag> write back cache coherency + <tag>Saturn-I <em>(ie, 82424ZX at rev 0, 1 or 2)</em>:</tag> + Write back cache coherency problems. Hardware flaw, only known work around is to set the external cache to write-through mode. Upgrade to Saturn-II. - <tag>Saturn-II <em>(ie, 82424ZX at rev 3 or - 4)</em>:</tag> Works fine, but many MB + <tag>Saturn-II <em>(ie, 82424ZX at rev 3 or 4)</em>:</tag> + Works fine, but many MB manufactures leave out the external dirty bit SRAM needed for write back operation. Work arounds are either run it in write through mode, or get the dirty bit SRAM installed. (I have these for the ASUS PCI/I-486SP3G rev 1.6 and later boards). <tag>Neptune:</tag> Can not run more than 2 bus master devices. Admitted Intel design flaw. Workarounds include do not run more than 2 bus masters, special hardware design to replace the PCI bus arbiter (appears on Intel Altair board and several other Intel server group MB's). And of course Intel's official answer, move to the Triton chip set, we ``fixed it there''. <tag>Triton:</tag> No known cache coherency or bus master problems, chip set does not implement parity checking. Workaround for parity issue. Wait for Triton-II. <tag>Triton-II:</tag> Unknown, not yet shipping. </descrip> </p> <sect1><heading>* CPUs/FPUs</heading> <sect1><heading>* Memory</heading> <sect1><heading>* BIOS</heading> <sect><heading>Input/Output Devices<label id="hw:io"></heading> <sect1><heading>* Video cards</heading> <sect1><heading>* Sound cards</heading> <sect1><heading>Serial ports and multiport cards</heading> <p>The <tt>sio</tt> driver provides support for NS8250-, NS16450-, NS16550 and NS16550A-based EIA RS-232C (CCITT V.24) communications interfaces. Several multiport cards are supported as well. See the <tt>sio(4)</tt> manual page for detailed technical documentation. <sect2><heading>Digiboard PC/8</heading> <p><em>Contributed by &a.awebster;.<newline>26 August 1995.</em> Here is a config snippet from a machine with digiboard PC/8 with 16550. It has 8 modems connected to these 8 lines, and they work just great. Do not forget to add <tt>options "COM_MULTIPORT"</tt> or it will not work very well! <tscreen><verb> device sio4 at isa? port 0x100 tty flags 0xb05 device sio5 at isa? port 0x108 tty flags 0xb05 device sio6 at isa? port 0x110 tty flags 0xb05 device sio7 at isa? port 0x118 tty flags 0xb05 device sio8 at isa? port 0x120 tty flags 0xb05 device sio9 at isa? port 0x128 tty flags 0xb05 device sio10 at isa? port 0x130 tty flags 0xb05 device sio11 at isa? port 0x138 tty flags 0xb05 irq 9 vector siointr </verb></tscreen> The trick in setting this up is that the MSB of the flags represent the last SIO port, in this case 11 so flags are 0xb05. <sect2><heading>Boca 16</heading> <p><em>Contributed by &a.whiteside;.<newline>26 August 1995.</em> The procedures to make a Boca 16 pord board with FreeBSD are pretty straighforward, but you will need a couple things to make it work: <enum> <item>You either need the kernel sources installed so you can recompile the necessary options or you will need someone else to compile it for you. The 2.0.5 default kernel does <bf>not</bf> come with multiport support enabled and you will need to add a device entry for each port anyways. </item> <item>Two, you will need to know the interrupt and IO setting for your Boca Board so you can set these options properly in the kernel.</item> </enum> One important note - the actual UART chips for the Boca 16 are in the connector box, not on the internal board itself. So if you have it unplugged, probes of those ports will fail. I have never tested booting with the box unplugged and plugging it back in, and I suggest you do not either. If you do not already have a custom kernel configuration file set up, refer to <ref id="kernelconfig" name="Kernel Configuration"> for general procedurs. The following are the specifics for the Boca 16 board and assume you are using the kernel name MYKERNEL and editing with vi. <enum> <item>Add the line <tscreen><verb> options "COM_MULTIPORT" </verb></tscreen> to the config file. </item> <item>Where the current <tt>device sio <em>xxx</em></tt> lines are, you will need to add 16 more devices. <em>Only the last device includes the interrupt vector for the board</em>. (See the <tt>sio(4)</tt> manual page for detail as to why.) The following example is for a Boca Board with an interrupt of 3, and a base IO address 100h. The IO address for Each port is +8 hexidecimal from the previous port, thus the 100h, 108h, 110h... addresses. <tscreen><verb> device sio1 at isa? port 0x100 tty flags 0x1005 device sio2 at isa? port 0x108 tty flags 0x1005 device sio3 at isa? port 0x110 tty flags 0x1005 device sio4 at isa? port 0x118 tty flags 0x1005 [...] device sio15 at isa? port 0x170 tty flags 0x1005 device sio16 at isa? port 0x178 tty flags 0x1005 irq 3 vector siointr </verb></tscreen> The flags entry <em>must</em> be changed from this example unless you are using the exact same sio assignments. Flags are set according to 0x<em>MYY</em> where <em>M</em> indicates the minor number of the master port (the last port on a Boca 16) and <em>YY</em> indicates if FIFO is enabled or disabled(enabled), IRQ sharing is used(yes) and if there is an AST/4 compatible IRQ control register(no). In this example, <tscreen><verb> flags 0x1005 </verb></tscreen> indicates that the master port is sio16. If I added another board and assigned sio17 through sio28, the flags for all 16 ports on <em>that</em> board would be 0x1C05, where 1C indicates the minor number of the master port. Do not change the 05 setting.</item> <item>Save and complete the kernel configuration, recompile, install and reboot. Presuming you have successfully installed the recompiled kernel and have it set to the correct address and IRQ, your boot message should indicate the successful probe of the Boca ports as follows: (obviously the sio numbers, IO and IRQ could be different) <tscreen><verb> sio1 at 0x100-0x107 flags 0x1005 on isa sio1: type 16550A (multiport) sio2 at 0x108-0x10f flags 0x1005 on isa sio2: type 16550A (multiport) sio3 at 0x110-0x117 flags 0x1005 on isa sio3: type 16550A (multiport) sio4 at 0x118-0x11f flags 0x1005 on isa sio4: type 16550A (multiport) sio5 at 0x120-0x127 flags 0x1005 on isa sio5: type 16550A (multiport) sio6 at 0x128-0x12f flags 0x1005 on isa sio6: type 16550A (multiport) sio7 at 0x130-0x137 flags 0x1005 on isa sio7: type 16550A (multiport) sio8 at 0x138-0x13f flags 0x1005 on isa sio8: type 16550A (multiport) sio9 at 0x140-0x147 flags 0x1005 on isa sio9: type 16550A (multiport) sio10 at 0x148-0x14f flags 0x1005 on isa sio10: type 16550A (multiport) sio11 at 0x150-0x157 flags 0x1005 on isa sio11: type 16550A (multiport) sio12 at 0x158-0x15f flags 0x1005 on isa sio12: type 16550A (multiport) sio13 at 0x160-0x167 flags 0x1005 on isa sio13: type 16550A (multiport) sio14 at 0x168-0x16f flags 0x1005 on isa sio14: type 16550A (multiport) sio15 at 0x170-0x177 flags 0x1005 on isa sio15: type 16550A (multiport) sio16 at 0x178-0x17f irq 3 flags 0x1005 on isa sio16: type 16550A (multiport master) </verb></tscreen> If the messages go by too fast to see, <tt>dmesg > more</tt> will show you the boot messages.</item> <item>Next, apprepriate entries in <tt>/dev</tt> for the devices must be made using the <tt>/dev/MAKEDEV</tt> script. After becoming root: <tscreen> # cd /dev<newline> # ./MAKEDEV tty1<newline> # ./MAKEDEV cua1<newline> <em>(everything in between)</em><newline> # ./MAKEDEV ttyg<newline> # ./MAKEDEV cuag </tscreen> If you do not want or need callout devices for some reason, you can dispense with making the <tt>cua*</tt> devices.</item> <item>If you want a quick and sloppy way to make sure the devices are working, you can simply plug a modem into each port and (as root) <tt>echo at > ttyd*</tt> for each device you have made. You <em>should</em> see the RX lights flash for each working port.</item> </enum> <sect1><heading>* Parallel ports</heading> <sect1><heading>* Modems</heading> <sect1><heading>* Network cards</heading> <sect1><heading>* Keyboards</heading> <sect1><heading>* Mice</heading> <sect1><heading>* Other</heading> <sect><heading>* Storage Devices<label id="hw:storage"></heading> <sect1><heading>* Disk/tape controllers</heading> <sect2><heading>* SCSI</heading> <sect2><heading>* IDE</heading> <sect2><heading>* Floppy</heading> <sect1><heading>* Hard drives</heading> <sect1><heading>* Tape drives</heading> <sect1><heading>* CD-ROM drives</heading> <sect1><heading>* Other</heading> <sect><heading>* Other<label id="hw:other"></heading> <sect1><heading>* PCMCIA</heading> diff --git a/handbook/install.sgml b/handbook/install.sgml index 0498d02882..d0e2d4b3f9 100644 --- a/handbook/install.sgml +++ b/handbook/install.sgml @@ -1,798 +1,799 @@ -<!-- $Id: install.sgml,v 1.12 1995-09-27 00:46:20 jmz Exp $ --> +<!-- $Id: install.sgml,v 1.13 1995-10-07 04:31:28 jfieber Exp $ --> <!-- The FreeBSD Documentation Project --> <!-- <!DOCTYPE linuxdoc PUBLIC '-//FreeBSD//DTD linuxdoc//EN'> --> <chapt><heading>Installing FreeBSD<label id="install"></heading> <p>So, you would like to try out FreeBSD on your system? This section is a quick-start guide for what you need to do. FreeBSD can be installed from a variety of media including CD-ROM, floppy disk, magnetic tape, an MS-DOS partition, and if you have a network connection, via anonymous ftp or NFS. Regardless of the installation media you choose, you can get started by downleading the <bf>installation disk</bf> as described below. Booting your computer with disk will provide important information about compatibility between FreeBSD and your hardware which could dictate which installation options are possible. It can also provide early clues to compatibilty problems that could prevent FreeBSD running on your system at all. If you plan on installing via anonymous FTP, then this installation disk is all you need to download. For more information on obtaining the FreeBSD distribution itself, please see <ref id="mirrors" name="Obtaining FreeBSD"> in the Appendix. So, to get the show on the road, follow these steps: <enum> <item>Review the <ref id="install:hw" name="supported configurations"> section of this installation guide to be sure that your hardware is supported by FreeBSD. It may be helpful to make a list of any special cards you have installed, such as SCSI controllers, etherernet adapters or sound cards. This list should include relevant configuration parameters such as interrupts (IRQ) and IO port addresses. </item> <item>Download the <url url="ftp://ftp.freebsd.org/pub/FreeBSD/2.0.5-RELEASE/UPDATES/boot.flp" name="installation boot disk image"> file to your hard drive, and be sure to tell your browser to <em>save</em> rather than <em>display</em>. <bf>Note:</bf> This disk image can be used for <em>both</em> 1.44 megabyte 3.5 inch floppy disks and 1.2 megabyte 5.25 inch floppy disks.</item> <item>Make the installation boot disk from the image file: <itemize> <item>If you are using MS-DOS download <url url="ftp://ftp.freebsd.org/pub/FreeBSD/tools/dos-tools/rawrite.exe" name="rawrite.exe"> (tell your browser to <em>save</em> rather than <em>display</em>!), then run it: <tscreen><verb> C:\> rawrite </verb></tscreen> The program will prompt you for the floppy drive containing the disk you want to write to (A: or B:) and the name of the file to put on disk (boot.flp). </item> <item>If you are using a UNIX system: <tscreen> % dd if=boot.flp of=<em>disk_device</em> bs=18k </tscreen> where <em>disk_device</em> is the <tt>/dev</tt> entry for the floppy drive. On FreeBSD systems, this is <tt>/dev/rfd0</tt> for the A: drive and <tt>/dev/rfd1</tt> for the B: drive. </item> </itemize> </item> <item>With the installation disk in the A: drive, reboot your computer. You should get a boot prompt something like this: <tscreen> >> FreeBSD BOOT ...<newline> Use hd(1,a)/kernel to boot sd0 when wd0 is also installed.<newline> Usage: [[hd(1,a)]/kernel][-abcCdhrsv]<newline> Use ? for file list or press Enter for defaults<newline> Boot: </tscreen> If you do <em>not</em> type anything, FreeBSD will automatically boot with its default configuration after a delay of about five seconds. As FreeBSD boots, it probes your computer to determine what hardware is installed. The results of this probing is displayed on the screen. </item> <item>When the booting process is finished, The main FreeBSD installation menu will be displayed.</item> </enum> <p><bf>If something goes wrong...</bf> <p>Due to limitations of the PC architecture, it is impossible for probing to be 100 percent reliable. In the event that your hardware is incorrectly identified, or that the probing causes your computer to lock up, first check the <ref id="install:hw" name="supported configurations"> section of this installation guide to be sure that your hardware is indeed supported by FreeBSD. <p>If your hardware is supported, reset the computer and when the <tt>Boot:</tt> prompt comes up, type <bf>-c</bf>. This puts FreeBSD into a configuration mode where you can supply hints about your hardware. The FreeBSD kernel on the installation disk is configured assuming that most hardware devices are in their factory default configuration in terms of IRQs, IO addresses and DMA channels. If your hardware has been reconfigured, you will most likely need to use the <bf>-c</bf> option at boot to tell FreeBSD where things are. <p>It is also possible that a probe for a device not present will cause a later probe for another device that is present to fail. In that case, the probes for the conflicting driver(s) should be disabled. <p>In the configuration mode, you can: <itemize> <item>List the device drivers installed in the kernel.</item> <item>Disable device drivers for hardware not present in your system.</item> <item>Change the IRQ, DRQ, and IO port addresses used by a device driver.</item> </itemize> <p>While at the <tt>config></tt> prompt, type <tt>help</tt> for more information on the available commands. After adjusting the kernel to match how you have your hardware configured, type <tt>quit</tt> at the <tt>config></tt> prompt to continue booting with the new settings. After FreeBSD has been installed, changes made in the configuration mode will be permanent so you do not have to reconfigure every time you boot. Even so, it is likely that you will want to build a custom kernel to optimize the performance of your system. See <ref id="kernelconfig" name="Kernel configuration"> for more information on creating custom kernels. <sect><heading>MS-DOS user's Questions and Answers</heading> <p>Many FreeBSD users wish to install FreeBSD on PCs inhabited by MS-DOS. Here are some commonly asked questions about installing FreeBSD on such systems. <p><bf>Help! I have no space! Do I need to delete everything first?</bf> If your machine is already running MS-DOS and has little or no free space available for FreeBSD's installation, all is not lost! You may find the FIPS utility, provided in the <tt>tools</tt> directory on the FreeBSD CDROM or on the various FreeBSD ftp sites, to be quite useful. FIPS allows you to split an existing MS-DOS partition into two pieces, preserving the original partition and allowing you to install onto the second free piece. You first defragment your MS-DOS partition, using the DOS 6.xx DEFRAG utility or the Norton Disk tools, then run FIPS. It will prompt you for the rest of the information it needs. Afterwards, you can reboot and install FreeBSD on the new free slice. See the <em>Distributions</em> menu for an estimation of how much free space you'll need for the kind of installation you want. <bf>Can I use compressed MS-DOS filesystems from FreeBSD?</bf> No. If you are using a utility such as Stacker(tm) or DoubleSpace(tm), FreeBSD will only be able to use whatever portion of the filesystem you leave uncompressed. The rest of the filesystem will show up as one large file (the stacked/dblspaced file!). <bf>Do not remove that file!</bf> You will probably regret it greatly! It is probably better to create another uncompressed MS-DOS primary partition and use this for communications between MS-DOS and FreeBSD. <bf>Can I mount my MS-DOS extended partitions?</bf> This feature isn't in FreeBSD 2.0.5 but should be in 2.1. We've laid all the groundwork for making this happen, now we just need to do the last 1 percent of the work involved. <bf>Can I run MS-DOS binaries under FreeBSD?</bf> Not yet! We'd like to add support for this someday, but are still lacking anyone to actually do the work. Ongoing work with Linux's PCEMU utility may bring this much closer to being a reality sometime soon. Send mail to hackers@freebsd.org if you're interested in joining this effort! <sect><heading>Supported Configurations<label id="install:hw"></heading> <p>FreeBSD currently runs on a wide variety of ISA, VLB, EISA and PCI bus based PC's, ranging from 386sx to Pentium class machines (though the 386sx is not recommended). Support for generic IDE or ESDI drive configurations, various SCSI controller, network and serial cards is also provided. A minimum of four megabytes of RAM is required to run FreeBSD. To run the X-window system, eight megabytes of RAM is the recommended minimum. Following is a list of all disk controllers and ethernet cards currently known to work with FreeBSD. Other configurations may very well work, and we have simply not received any indication of this. <sect1><heading>Disk Controllers</heading> <p> <itemize> <item>WD1003 (any generic MFM/RLL) <item>WD1007 (any generic IDE/ESDI) <item>WD7000 <item>IDE <item>ATA <item>Adaptec 152x series ISA SCSI controllers <item>Adaptec 154x series ISA SCSI controllers <item>Adaptec 174x series EISA SCSI controller in standard and enhanced mode. <item>Adaptec 274X/284X/2940 <!-- 3940 (in 2.1) --> (Narrow/Wide/Twin) series EISA/VLB/PCI SCSI controllers <item>Adaptec AIC-6260 and AIC-6360 based boards, which includes the AHA-152x and SoundBlaster SCSI cards. <bf>Note:</bf> You cannot boot from the SoundBlaster cards as they have no on-board BIOS, which is necessary for mapping the boot device into the system BIOS I/O vectors. They are perfectly usable for external tapes, CDROMs, etc, however. The same goes for any other AIC-6x60 based card without a boot ROM. Some systems DO have a boot ROM, which is generally indicated by some sort of message when the system is first powered up or reset. Check your system/board documentation for more details. <item>Buslogic 545S & 545c <bf>Note:</bf> that Buslogic was formerly known as "Bustec". <item>Buslogic 445S/445c VLB SCSI controller <item>Buslogic 742A, 747S, 747c EISA SCSI controller. <item>Buslogic 946c PCI SCSI controller <item>Buslogic 956c PCI SCSI controller <item>NCR 53C810 and 53C825 PCI SCSI controller. <item>NCR5380/NCR53400 ("ProAudio Spectrum") SCSI controller. <item>DTC 3290 EISA SCSI controller in 1542 emulation mode. <item>UltraStor 14F, 24F and 34F SCSI controllers. <item>Seagate ST01/02 SCSI controllers. <item>Future Domain 8xx/950 series SCSI controllers. </itemize> With all supported SCSI controllers, full support is provided for SCSI-I & SCSI-II peripherals, including Disks, tape drives (including DAT) and CD ROM drives. The following CD-ROM type systems are supported at this time: <itemize> <item>SCSI (also includes ProAudio Spectrum and SoundBlaster SCSI) (cd) <item>Mitsumi proprietary interface (mcd) <item>Matsushita/Panasonic (Creative) proprietary interface (matcd) <item>Sony proprietary interface (scd) </itemize> <bf>Note:</bf> CD-Drives with IDE interfaces are not supported at this time. Some controllers have limitations with the way they deal with >16MB of memory, due to the fact that the ISA bus only has a DMA address space of 24 bits. If you do your arithmetic, you'll see that this makes it impossible to do direct DMA to any address >16MB. This limitation is even true of some EISA controllers (which are normally 32 bit) when they're configured to emulate an ISA card, which they then do in *all* respects. This problem is avoided entirely by IDE controllers (which do not use DMA), true EISA controllers (like the UltraStor, Adaptec 1742A or Adaptec 2742) and most VLB (local bus) controllers. In the cases where it's necessary, the system will use "bounce buffers" to talk to the controller so that you can still use more than 16Mb of memory without difficulty. <sect1><heading>Ethernet cards</heading> <p> <itemize> <item>SMC Elite 16 WD8013 ethernet interface, and most other WD8003E, WD8003EBT, WD8003W, WD8013W, WD8003S, WD8003SBT and WD8013EBT based clones. SMC Elite Ultra is also supported. <item>DEC EtherWORKS III NICs (DE203, DE204, and DE205) <item>DEC EtherWORKS II NICs (DE200, DE201, DE202, and DE422) <item>DEC DC21140 based NICs (SMC???? DE???) <item>DEC FDDI (DEFPA/DEFEA) NICs <item>Fujitsu MB86960A family of NICs <item>Intel EtherExpress <item>Isolan AT 4141-0 (16 bit) <item>Isolink 4110 (8 bit) <item>Novell NE1000, NE2000, and NE2100 ethernet interface. <item>3Com 3C501 cards <item>3Com 3C503 Etherlink II <item>3Com 3c505 Etherlink/+ <item>3Com 3C507 Etherlink 16/TP <item>3Com 3C509, 3C579, 3C589 (PCMCIA) Etherlink III <item>Toshiba ethernet cards <item>PCMCIA ethernet cards from IBM and National Semiconductor are also supported. </itemize> <sect1><heading>Miscellaneous devices</heading> <p> <itemize> <item>AST 4 port serial card using shared IRQ. <item>ARNET 8 port serial card using shared IRQ. <item>BOCA IOAT66 6 port serial card using shared IRQ. <item>Cyclades Cyclom-y Serial Board. <item>STB 4 port card using shared IRQ. <item>Mitsumi (all models) CDROM interface and drive. <item>SDL Communications Riscom/8 Serial Board. <item>Soundblaster SCSI and ProAudio Spectrum SCSI CDROM interface and drive. <item>Matsushita/Panasonic (Creative SoundBlaster) CDROM interface and drive. <item>Adlib, SoundBlaster, SoundBlaster Pro, ProAudioSpectrum, Gravis UltraSound and Roland MPU-401 sound cards. </itemize> FreeBSD currently does NOT support IBM's microchannel (MCA) bus, but support is apparently close to materializing. Details will be posted as the situation develops. <sect><heading>Preparing for the installation</heading> <p>There are a number of different methods by which FreeBSD can be installed. The following describes what preparation needs to be done for each type. <sect1><heading>Before installing from CDROM</heading> <p>If your CDROM is of an unsupported type, such as an IDE CDROM, then please skip to section 2.3: MS-DOS Preparation. There is not a lot of preparatory work that needs to be done to successfully install from one of Walnut Creek's FreeBSD CDROMs (other CDROM distributions may work as well, but I can't say for sure as I have no hand or say in their creation). You can either boot into the CD installation directly from MS-DOS using Walnut Creek's supplied "install" batch file or you can make a boot floppy by writing the supplied image (floppies/boot.flp) onto a floppy with the "go" command, which invokes the rawrite.exe command found in the tools/ subdirectory. If you're creating the boot floppy from a UNIX machine, you may find that ``dd if=floppies/boot.flp of=/dev/rfd0'' or ``dd if=floppies/boot.flp of=/dev/floppy'' works well, depending on your hardware and operating system environment. Once you've booted from MS-DOS or floppy, you should be able to select CDROM as the media type in the Media menu and load the entire distribution from CDROM. No other types of installation media should be required. After your system is fully installed and you have rebooted from the hard disk, you should find the CD mounted on the directory /cdrom. A utility called `lndir' comes with the XFree86 distribution which you may also find useful: It allows you to create "link tree" directories to things on Read-Only media like CDROM. One example might be something like this: <tscreen>mkdir /usr/ports<newline>lndir /cdrom/ports /usr/ports</tscreen> Which would allow you to then "cd /usr/ports; make" and get all the sources from the CD, but yet create all the intermediate files in /usr/ports, which is presumably on a more writable media! <sect1><heading>Before installing from Floppy</heading> <p>If you must install from floppy disks, either due to unsupported hardware or just because you enjoy doing things the hard way, you must first prepare some floppies for the install. The first floppy you'll need is ``floppies/root.flp'', which is somewhat special in that it's not a MS-DOS filesystem floppy at all, but rather an "image" floppy (it's actually a gzip'd cpio file). You can use the rawrite.exe program to do this under DOS, or ``dd'' to do it on a UNIX Workstation (see notes in section 2.1 concerning the ``floppies/boot.flp'' image). Once this floppy is made, put it aside. You'll be asked for it later. You will also need, at minimum, as many 1.44MB or 1.2MB floppies as it takes to hold all files in the bin (binary distribution) directory. THESE floppies *must* be formatted using MS-DOS, using with the FORMAT command in MS-DOS or the File Manager format command in Microsoft Windows(tm). Factory preformatted floppies will also work well, provided that they haven't been previously used for something else. Many problems reported by our users in the past have resulted from the use of improperly formatted media, so we simply take special care to mention it here! After you've MS-DOS formatted the floppies, you'll need to copy the files onto them. The distribution files are split into chunks conveniently sized so that 5 of them will fit on a conventional 1.44MB floppy. Go through all your floppies, packing as many files as will fit on each one, until you've got all the distributions you want packed up in this fashion. Select ``Floppy'' from the Media menu at installation time and you will be prompted for everything after that. <sect1><heading>Before installing from a MS-DOS partition</heading> <p>To prepare for installation from an MS-DOS partition, copy the files from the distribution into a directory called <tt>C:\FREEBSD</tt>. The directory tree structure of the CDROM must be partially reproduced within this directory so we suggest using the DOS <tt>xcopy</tt> command. For example, to prepare for a minimal installation of FreeBSD: <tscreen><verb> C> MD C:\FREEBSD C> XCOPY /S E:\FLOPPIES C:\FREEBSD\FLOPPIES\ C> XCOPY /S E:\DISTS\BIN C:\FREEBSD\BIN\ </verb></tscreen> assuming that <tt>C:</tt> is where you have free space and <tt>E:</tt> is where your CDROM is mounted. Note that you need the <tt>FLOPPIES</tt> directory because the <tt>root.flp</tt> image is needed during an MS-DOS installation. For as many `DISTS' you wish to install from MS-DOS (and you have free space for), install each one under <tt>C:\FREEBSD</tt> - the <tt>BIN</tt> dist is only the minimal requirement. If you have room on your MS-DOS partition for all the distributions, you could replace the last line above with: <tscreen><verb> C> XCOPY /S E:\DISTS C:\FREEBSD\ </verb></tscreen> which would copy all the subdirectories of <tt>E:\DISTS</tt> to <tt>C:\FREEBSD</tt>. <sect1><heading>Before installing from QIC/SCSI Tape</heading> <p>Installing from tape is probably the easiest method, short of an on-line install using FTP or a CDROM install. The installation program expects the files to be simply tar'ed onto the tape, so after getting all of the files for distribution you're interested in, simply tar them onto the tape with a command like: <tscreen> cd /freebsd/distdir<newline> tar cvf /dev/rwt0 (or /dev/rst0) dist1 .. dist2 </tscreen> Make sure that the `floppies/' directory is one of the "dists" given above, since the installation will look for `floppies/root.flp' on the tape. When you go to do the installation, you should also make sure that you leave enough room in some temporary directory (which you'll be allowed to choose) to accommodate the FULL contents of the tape you've created. Due to the non-random access nature of tapes, this method of installation requires quite a bit of temporary storage! You should expect to require as much temporary storage as you have stuff written on tape. <sect1><heading>Before installing over a network</heading> <p>You can do network installations over 3 types of communications links: <descrip> - <tag>Serial port</tag> SLIP or PPP <tag>Parallel - port</tag> PLIP (laplink cable) <tag>Ethernet</tag> A + <tag>Serial port</tag> SLIP or PPP + <tag>Parallel port</tag> PLIP (laplink cable) + <tag>Ethernet</tag> A standard ethernet controller (includes some PCMCIA). </descrip> SLIP support is rather primitive, and limited primarily to hard-wired links, such as a serial cable running between a laptop computer and another computer. The link should be hard-wired as the SLIP installation doesn't currently offer a dialing capability; that facility is provided with the PPP utility, which should be used in preference to SLIP whenever possible. If you're using a modem, then PPP is almost certainly your only choice. Make sure that you have your service provider's information handy as you'll need to know it fairly soon in the installation process. You will need to know, at the minimum, your service provider's IP address and possibly your own (though you can also leave it blank and allow PPP to negotiate it with your ISP). You also need to know how to use the various "AT commands" to dial the ISP with your particular modem as the PPP dialer provides only a very simple terminal emulator. If a hard-wired connection to another FreeBSD (2.0R or later) machine is available, you might also consider installing over a "laplink" parallel port cable. The data rate over the parallel port is much higher than is what's typically possible over a serial line (up to 50k/sec), thus resulting in a quicker installation. Finally, for the fastest possible network installation, an ethernet adaptor is always a good choice! FreeBSD supports most common PC ethernet cards, a table of supported cards (and their required settings) provided as part of the FreeBSD Hardware Guide - see the Documentation menu on the boot floppy. If you are using one of the supported PCMCIA ethernet cards, also be sure that it's plugged in _before_ the laptop is powered on! FreeBSD does not, unfortunately, currently support "hot insertion" of PCMCIA cards. You will also need to know your IP address on the network, the "netmask" value for your address class and the name of your machine. Your system administrator can tell you which values to use for your particular network setup. If you will be referring to other hosts by name rather than IP address, you'll also need a name server and possibly the address of a gateway (if you're using PPP, it's your provider's IP address) to use in talking to it. If you do not know the answers to all or most of these questions, then you should really probably talk to your system administrator _first_ before trying this type of installation! Once you have a network link of some sort working, the installation can continue over NFS or FTP. <sect2><heading>Preparing for NFS installation</heading> <p>NFS installation is fairly straight-forward: Simply copy the FreeBSD distribution files you're interested onto a server somewhere and then point the NFS media selection at it. If this server supports only "privileged port" access (as is generally the default for Sun workstations), you will need to set this option in the Options menu before installation can proceed. If you have a poor quality ethernet card which suffers from very slow transfer rates, you may also wish to toggle the appropriate Options flag. In order for NFS installation to work, the server must support "subdir mounts", e.g. if your FreeBSD 2.0.5 distribution directory lives on: ziggy:/usr/archive/stuff/FreeBSD Then ziggy will have to allow the direct mounting of /usr/archive/stuff/FreeBSD, not just /usr or /usr/archive/stuff. In FreeBSD's /etc/exports file, this is controlled by the ``-alldirs'' option. Other NFS servers may have different conventions. If you are getting `Permission Denied' messages from the server then it's likely that you don't have this enabled properly! <sect2><heading>Preparing for FTP Installation</heading> <p>FTP installation may be done from any mirror site containing a reasonably up-to-date version of FreeBSD 2.0.5, a full menu of reasonable choices from almost anywhere in the world being provided by the FTP site menu. If you are installing from some other FTP site not listed in this menu, or you are having troubles getting your name server configured properly, you can also specify your own URL by selecting the ``Other'' choice in that menu. A URL can also be a direct IP address, so the following would work in the absence of a name server: <tscreen> ftp://192.216.222.4/pub/FreeBSD/2.0.5-RELEASE</tscreen> <em><bf>NOTE:</bf> Substitute "ALPHA" for "RELEASE" during the ALPHA test period!</em> If you are installing through a firewall then you should probably select ``Passive mode'' ftp, which is the default. If you are talking to a server which does not support passive mode for some reason, see the Options menu to select Active mode transfers. <sect><heading>Installing FreeBSD</heading> <p>Once you've taken note of the appropriate preinstallation steps, you should be able to install FreeBSD without any further trouble. Should this not be true, then you may wish to go back and re-read the relevant preparation section (section 2.x) for the installation media type you're trying to use - perhaps there's a helpful hint there that you missed the first time? If you're having hardware trouble, or FreeBSD refuses to boot at all, read the Hardware Guide provided on the boot floppy for a list of possible solutions. The FreeBSD boot floppy contains all the on-line documentation you should need to be able to navigate through an installation and if it doesn't then I'd like to know what you found most confusing! It is the objective of the FreeBSD installation program (sysinstall) to be self-documenting enough that painful "step-by-step" guides are no longer necessary. It may take us a little while to reach that objective, but that's the objective! Meanwhile, you may also find the following "typical installation sequence" to be helpful: <enum> <item>Boot the boot floppy. After a boot sequence which can take anywhere from from 30 seconds to 3 minutes, depending on your hardware, you should be presented with a menu of initial choices. If the floppy doesn't boot at all, or the boot hangs at some stage, go read the Q&A section of the Hardware Guide for possible causes. <item>Press F1. You should see some basic usage instructions on the menu system and general navigation. If you haven't used this menu system before then PLEASE read this thoroughly! <item>If English is not your native language, you may wish to proceed directly to the Language option and set your preferred language. This will bring up some of the documentation in that language instead of English. <item>Select the Options item and set any special preferences you may have. <item>Select Proceed, bringing you to the Installation Menu. </enum> <sect1><heading>The installation menu</heading> <p>You can do anything you like in this menu without altering your system <em>except</em> for "Commit", which will perform any requests to alter your system you may have made. If you're confused at any point, the F1 key usually pulls up the right information for the screen you're in. <enum> <item>The first step is generally `Partition', which allows you to chose how your drives will be used for FreeBSD. <item>Next, with the `Label' editor, you can specify how the space in any allocated FreeBSD partitions should be used by FreeBSD, or where to mount a non-FreeBSD partition (such as DOS). <item>Next, the `Distributions' menu allows you to specify which parts of FreeBSD you wish to load. A good choice is "User" for a small system or "Developer" for someone wanting a bit more out of FreeBSD. If none of the existing collections sound applicable, select Custom. <item>Next, the `Media' menu allows you to specify what kind of media you wish to install from. If a desired media choice is found and configured automatically then this menu will simply return, otherwise you'll be asked for additional details on the media device type. <item>Finally, the Commit command will actually perform all the actions at once (nothing has been written to your disk so far, nor will it until you give the final confirmation). All new or changed partition information will be written out, file systems will be created and/or non-destructively labelled (depending on how you set their newfs flags in the Label editor) and all selected distributions will be extracted. <item>The Configure menu choice allows you to further configure your FreeBSD installation by giving you menu-driven access to various system defaults. Some items, like networking, may be especially important if you did a CDROM/Tape/Floppy installation and have not yet configured your network interfaces (assuming you have some). Properly configuring your network here will allow FreeBSD to come up on the network when you first reboot from the hard disk. <item>Exit returns you to the top menu. </enum> At this point, you're generally done with the sysinstall utility and can select the final `Quit'. If you're running it as an installer (e.g. before the system is all the way up) then the system will now reboot. If you selected the boot manager option, you will see a small boot menu with an `F?' prompt. Press the function key for BSD (it will be shown) and you should boot up into FreeBSD off the hard disk. If this fails to happen for some reason, see the Q&A section of the Hardware Guide for possible clues! diff --git a/handbook/kernelconfig.sgml b/handbook/kernelconfig.sgml new file mode 100644 index 0000000000..a565ee4957 --- /dev/null +++ b/handbook/kernelconfig.sgml @@ -0,0 +1,1206 @@ +<!-- $Id: kernelconfig.sgml,v 1.1 1995-10-07 04:31:31 jfieber Exp $ --> +<!-- The FreeBSD Documentation Project --> +<!-- <!DOCTYPE linuxdoc PUBLIC '-//FreeBSD//DTD linuxdoc//EN'> --> + <chapt><heading>Configuring the FreeBSD Kernel<label id="kernelconfig"></heading> + + <p><em>Contributed by &a.jehamby;.<newline>6 October 1995.</em> + + This large section of the handbook discusses the basics of + building your own custom kernel for FreeBSD. This section + is appropriate for both novice system administrators and + those with advanced Unix experience. + + <sect><heading>Why build a custom kernel?</heading> + + <p>Building a custom kernel is one of the most important + rites of passage every Unix system administrator must + learn. This process, while time-consuming, will provide + many benefits to your FreeBSD system. Unlike the GENERIC + kernel, which must support every possible SCSI and + network card, along with tons of other rarely used + hardware support, a custom kernel only contains support + for <em>your</em> PC's hardware. This has a number of + benefits: + + <itemize> + + <item>It will take less time to boot because it does not + have to spend time probing for hardware which you + do not have. + + <item>A custom kernel often uses less memory, which is + important because the kernel is the one process which + must always be present in memory, and so all of that + unused code ties up pages of RAM that your programs + would otherwise be able to use. Therefore, on a + system with limited RAM, building a custom kernel is + of critical importance. + + <item>Finally, there are several kernel options which + you can tune to fit your needs, and device driver + support for things like sound cards which you can + include in your kernel but are <em>not</em> present + in the GENERIC kernel. + + </itemize></p> + + <sect><heading>Building and Installing a Custom Kernel</heading> + + <p>First, let us take a quick tour of the kernel build + directory. All directories mentioned will be relative to + the main <tt>/usr/src/sys</tt> directory, which is also + accessible through <tt>/sys</tt>. There are a number of + subdirectories here representing different parts of the + kernel, but the most important, for our purposes, are + <tt>i386/conf</tt>, where you will edit your custom + kernel configuration, and <tt>compile</tt>, which is the + staging area where your kernel will be built. Notice the + logical organization of the directory tree, with each + supported device, filesystem, and option in its own + subdirectory. Also, anything inside the <tt>i386</tt> + directory deals with PC hardware only, while everything + outside the <tt>i386</tt> directory is common to all + platforms which FreeBSD could potentially be ported to. + + <quote><em/Note:/ If there is <em>not</em> a + <tt>/usr/src/sys</tt> directory on your system, then the + kernel source has not been been installed. Follow the + instructions for installing packages to add this package + to your system.</quote> + + Next, move to the <tt>i386/conf</tt> directory and copy + the GENERIC configuration file to the name you want to + give your kernel. For example: +<tscreen><verb> +# cd /usr/src/sys/i386/conf +# cp GENERIC MYKERNEL +</verb></tscreen> + Traditionally, this name is in all capital letters and, + if you are maintaining multiple FreeBSD machines with + different hardware, it's a good idea to name it after + your machine's hostname. We will call it MYKERNEL for + the purpose of this example. + + <quote><em/Note:/ You must execute these and all of the + following commands under the root account or you will get + ``permission denied'' errors.</quote> + + Now, edit MYKERNEL with your favorite text editor. If + you're just starting out, the only editor available will + probably be <tt>vi</tt>, which is too complex to explain + here, but is covered well in many books in the <ref + id="bibliography" name="bibliography">. Feel free to change the comment + lines at the top to reflect your configuration or the + changes you've made to differentiate it from GENERIC. + + If you've build a kernel under SunOS or some other BSD + operating system, much of this file will be very familiar + to you. If you're coming from some other operating + system such as DOS, on the other hand, the GENERIC + configuration file might seem overwhelming to you, so + follow the descriptions in the <ref + id="kernelconfig:config" name="Configuration File"> + section slowly and carefully. + + When you're finished, type the following to compile and + install your kernel: +<tscreen><verb> +# /usr/sbin/config MYKERNEL +# cd ../../compile/MYKERNEL +# make +# make install +</verb></tscreen> + The new kernel will be copied to the root directory as + <tt>/kernel</tt> and the old kernel will be moved to + <tt>/kernel.old</tt>. Now, shutdown the system and + reboot to use your kernel. In case something goes wrong, + there are some <ref id="kernelconfig:trouble" name= + "troubleshooting"> instructions at the end of this + document. Be sure to read the section which explains how + to recover in case your new kernel <ref + id="kernelconfig:noboot" name="does not boot">. + + <quote><em/Note:/ If you've added any new devices (such + as sound cards) you may have to add some <ref + id="kernelconfig:nodes" name="device nodes"> to your + <tt>/dev</tt> directory before you can use them.</quote> + + <sect><heading>The Configuration File<label id="kernelconfig:config"></heading> + + <p>The general format of a configuration file is quite + simple. Each line contains a keyword and one or more + arguments. For simplicity, most lines only contain one + argument. Anything following a <tt>#</tt> is considered + a comment and ignored. The following sections describe + each keyword, generally in the order they are listed in + GENERIC, although some related keywords have been grouped + together in a single section (such as Networking) even + though they are actually scattered throughout the GENERIC + file. An exhaustive list of options is present in the + LINT configuration file, located in the same directory as + GENERIC. + + <sect1><heading>Mandatory Keywords</heading> + + <p>These keywords are required in every kernel you build. + + <descrip> + + <tag>machine ``i386''</tag> + + <p>The first keyword is <tt>machine</tt>, which, + since FreeBSD only runs on Intel 386 and compatible + chips, is i386. + + <quote><em>Note:</em> that any keyword which + contains numbers used as text must be enclosed in + quotation marks, otherwise <tt>config</tt> gets + confused and thinks you mean the actual number + 386.</quote> + + <tag>cpu ``<em>cpu_type</em>''</tag> + + <p>The next keyword is <tt>cpu</tt>, which includes + support for each CPU supported by FreeBSD. The + possible values of <tt><em>cpu_type</em></tt> + include: + <itemize> + <item>I386_CPU + <item>I486_CPU + <item>I586_CPU + </itemize> + and multiple instances of the <tt>cpu</tt> line may + be present with different values of + <tt><em>cpu_type</em></tt> as are present in the + GENERIC kernel. For a custom kernel, it is best to + specify only the cpu you have. If, for example, + you have an Intel Pentium, use <tt>I586_CPU</tt> + for <tt><em>cpu_type</em></tt>. + + <tag>ident <em>machine_name</em></tag> + + <p>Next, we have <tt>ident</tt>, which is the + identification of the kernel. You should change + this from GENERIC to whatever you named your + kernel, in this example, MYKERNEL. The value you + put in <tt>ident</tt> will print when you boot up + the kernel, so it's useful to give a kernel a + different name if you want to keep it separate from + your usual kernel (if you want to build an + experimental kernel, for example). Note that, as + with <tt>machine</tt> and <tt> cpu</tt>, enclose + your kernel's name in quotation marks if it + contains any numbers. + + <tag>maxusers <em>number</em></tag> + + <p>This file sets the size of a number of important + system tables. This number is supposed to be + roughly equal to the number of simultaneous users + you expect to have on your machine. However, under + normal circumstances, you will want to set + <tt>maxusers</tt> to at least four, especially if + you're using X Windows or compiling software. The + reason is that the most important table set by + <tt>maxusers</tt> is the maximum number of + processes, which is set to <bf><tt>20 + 16 * + maxusers</tt></bf>, so if you set <tt>maxusers</tt> + to one, then you can only have 36 simultaneous + processes, including the 18 or so that the system + starts up at boot time, and the 15 or so you will + probably create when you start X Windows. Even a + simple task like reading a <tt>man</tt> page will + start up nine processes to filter, decompress, and + view it. Setting <tt>maxusers</tt> to 4 will allow + you to have up to 84 simultaneous processes, which + should be enough for anyone. If, however, you see + the dreaded ``proc table full'' error when trying + to start another program, or are running a server + with a large number of simultaneous users (like + Walnut Creek CDROM's FTP site!), you can always + increase this number and rebuild. + + <quote><em/Note:/ <tt>maxuser</tt> does + <em>not</em> limit the number of users which can + log into your machine. It simply sets various + table sizes to reasonable values considering the + maximum number of users you will likely have on + your system and how many processes each of them + will be running. One keyword which + <em>does</em> limit the number of simultaneous + <em>remote logins</em> is <ref + id="kernelconfig:ptys" name="pseudo-device pty + 16">.</quote> + + <tag>config <em>kernel_name</em> root on <em>root_device</em></tag> + + <p>This line specifies the location and name of the + kernel. Traditionally the kernel is called + <tt>vmunix</tt> but in FreeBSD, it is aptly named + <tt>kernel</tt>. You should always use + <tt>kernel</tt> for <em>kernel_name</em> because + changing it will render numerous system utilities + inoperative. The second part of the line specifies + the disk and partition where the root filesystem + and kernel can be found. Typically this will be + <tt>wd0</tt> for systems with non-SCSI drives, or + <tt>sd0</tt> for systems with SCSI drives. + + </descrip> + + <sect1><heading>General Options</heading> + + <p>These lines provide kernel support for various + filesystems and other options. + + <descrip> + + <label id="kernelconfig:mathemu"> + + <tag>options MATH_EMULATE</tag> + + <p>This line allows the kernel to simulate a math + coprocessor if your computer does not have one (386 + or 486SX). If you have a Pentium, a 486DX, or a + 386 or 486SX with a separate 387 or 487 chip, you + can comment this line out. + + <quote><em>Note:</em> The normal math coprocessor + emulation routines that come with FreeBSD are + <em>not</em> very accurate. If you do not have a + math coprocessor, and you need the best accuracy, + I recommend that you change this option to + <tt>GPL_MATH_EMULATE</tt> to use the superior GNU + math support, which is not included by default + for licensing reasons.</quote> + + <tag>options ``COMPAT_43''</tag> + + <p>Compatibility with BSD 4.3. Leave this in; some + programs will act strangely if you comment this + out. + + <tag>options BOUNCE_BUFFERS</tag> + + <p>ISA devices and EISA devices operating in an ISA + compatibilty mode can only perform DMA (Direct + Memory Access) to memory below 16 megabytes. This + option enables such devices to work in systems with + more than 16 megabytes of memory. + + <tag>options UCONSOLE</tag> + + <p>Allow users to grab the console, useful for X + Windows. For example, you can create a console + xterm by typing <tt>xterm -C</tt>, which will + display any `write', `talk', and other messages you + receive. + + <tag>options SYSVSHM</tag> + + <p>This option + provides for System V shared memory. The most + common use of this is the XSHM extension in X + Windows, which many graphics-intensive programs + (such as the movie player XAnim, and Linux DOOM) + will automatically take advantage of for extra + speed. If you use X Windows, you'll definitely + want to include this. + + <tag>options SYSVSEM</tag> + + <p>Support for System V + semaphores. Less commonly used but only adds a few + hundred bytes to the kernel. + + <tag>options SYSVMSG</tag> + + <p>Support for System V + messages. Again, only adds a few hundred bytes to + the kernel. + + <quote><em/Note:/ The <tt>ipcs(1)</tt> command will + tell will list any processes using using each of + these System V facilities.</quote> + + </descrip> + + <sect1><heading>Filesystem Options</heading> + + <p>These options add support for various filesystems. + You must include at least one of these to support the + device you boot from; typically this will be + <tt>FFS</tt> if you boot from a hard drive, or + <tt>NFS</tt> if you are booting a diskless workstation + from Ethernet. You can include other commonly-used + filesystems in the kernel, but feel free to comment out + support for filesystems you use less often (perhaps the + MS-DOS filesystem?), since they will be dynamically + loaded from the Loadable Kernel Module directory + <tt>/lkm</tt> the first time you mount a partition of + that type. + + <descrip> + + <tag>options FFS</tag> + + <p>The basic hard drive + filesystem; leave it in if you boot from the hard + disk. + + <tag>options NFS</tag> + + <p>Network Filesystem. Unless + you plan to mount partitions from a Unix file + server over Ethernet, you can comment this out. + + <tag>options MSDOSFS</tag> + + <p>MS-DOS Filesystem. Unless + you plan to mount a DOS formatted hard drive + partition at boot time, you can safely comment this + out. It will be automatically loaded the first + time you mount a DOS partition, as described above. + Also, the excellent <tt>mtools</tt> software (in + the ports collection) allows you to access DOS + floppies without having to mount and unmount them + (and does not require MSDOSFS at all). + + <tag>options ``CD9660''</tag> + + <p>ISO 9660 filesystem for + CD-ROMs. Comment it out if you do not have a + CD-ROM drive or only mount data CD's occasionally + (since it will be dynamically loaded the first time + you mount a data CD). Audio CD's do not need this + filesystem. + + <tag>options PROCFS</tag> + + <p>Process filesystem. This + is a pretend filesystem mounted on /proc which + allows programs like <tt>ps(1)</tt> to give you + more information on what processes are running. + Leave it in. + + <tag>options MFS</tag> + + <p>Memory-mapped file system. + This is basically a RAM disk for fast storage of + temporary files, useful if you have a lot of swap + space that you want to take advantage of. A + perfect place to mount an MFS partition is on the + <tt>/tmp</tt> directory, since many programs store + temporary data here. To mount an MFS RAM disk on + <tt>/tmp</tt>, add the following line to + <tt>/etc/fstab</tt> and then reboot or type + <tt>mount /tmp</tt>: +<tscreen><verb> +/dev/wd1s2b /tmp mfs rw 0 0 +</verb></tscreen> + + <quote><em/Note:/ Replace the <tt>/dev/wd1s2b</tt> + with the name of your swap partition, which will + be listed in your <tt>/etc/fstab</tt> as follows: +<tscreen><verb> +/dev/wd1s2b none swap sw 0 0 +</verb></tscreen> + </quote> + + <quote><em/Note:/ <!-- MFS is currently a bit + limited (for example, I noticed that two programs + ca not access the <tt>/tmp</tt> device + simultaneously). As such, you may want to avoid + it for now. --> Also, the <tt>MFS</tt> filesystem + can <em>not</em> be dynamically loaded, so you + <em>must</em> compile it into your kernel if you + want to experiment with it.</quote> + + <tag>options QUOTA</tag> + + <p>Enable disk quotas. If you + have a public access system, and do not want users + to be able to overflow the <tt>/home</tt> + partition, you can establish disk quotas for each + user. This code is a little buggy, so do not + enable it unless you have to. View the manual page + for <tt>quota(1)</tt> to learn more about disk + quotas. + + </descrip> + + <sect1><heading>Basic Controllers and Devices</heading> + + <p>These sections describe the basic disk, tape, and + CD-ROM controllers supported by FreeBSD. There are + separate sections for <ref id="kernelconfig:scsi" + name="SCSI"> controllers and <ref + id="kernelconfig:network" name="network"> cards. + + <descrip> + + <tag>controller isa0</tag> + + <p>All PC's supported by + FreeBSD have one of these. If you have an IBM PS/2 + (Micro Channel Architecture), then you cannot run + FreeBSD at this time. + + <tag>controller pci0</tag> + + <p>Include this if you have a + PCI motherboard. This enables auto-detection of + PCI cards and gatewaying from the PCI to the ISA + bus. + + <tag>controller fdc0</tag> + + <p>Floppy drive controller: + <tt>fd0</tt> is the ``A:'' floppy drive, and + <tt>fd1</tt> is the ``B:'' drive. <tt>ft0</tt> is + a QIC-80 tape drive attached to the floppy + controller. Comment out any lines corresponding to + devices you do not have. + + <quote><em/Note:/ QIC-80 tape support requires a + separate filter program called <tt>ft(8)</tt>, see + the manual page for details.</quote> + + <tag>controller wdc0</tag> + + <p>This is the primary IDE + controller. <tt>wd0</tt> and <tt>wd1</tt> are the + master and slave hard drive, respectively. + <tt>wdc1</tt> is a secondary IDE controller where + you might have a third or fourth hard drive, or an + IDE CD-ROM. Comment out the lines which do not + apply (if you have a SCSI hard drive, you'll + probably want to comment out all six lines, for + example). + + <tag>controller wcd0<label id="kernelconfig:atapi"></tag> + + <p>This device + provides IDE CD-ROM support. Be sure to leave + <tt>wdc1</tt> uncommented if your CD-ROM is on + its own controller card. To use this, you must + also include the line <tt>options ATAPI</tt>. + + <tag>device npx0 at isa? port ``IO_NPX'' irq 13 vector npxintr</tag> + + <p><tt>npx0</tt> is the interface to the + math coprocessor. If you have one then make sure + you've commented out <ref id="kernelconfig:mathemu" + name="MATH_EMULATE"> above. If you do not have a + math coprocessor, you can comment this out. + + <tag>device wt0 at isa? port 0x300 bio irq 5 drq 1 vector wtintr</tag> + + <p>Wangtek and Archive + QIC-02/QIC-36 tape drive support + + <tag>Proprietary CD-ROM support</tag> + + <p>The following + drivers are for the so-called <em>proprietary</em> + CD-ROM drives. These drives have their own + controller card or might plug into a sound card + such as the Soundblaster 16. They are <em>not</em> + IDE or SCSI. Most older single-speed and + double-speed CD-ROMs use these interfaces, while + newer quad-speeds are likely to be <ref + id="kernelconfig:atapi" name="IDE"> or <ref + id="kernelconfig:scsi" name="SCSI">. + + <descrip> + + <tag>device mcd0 at isa? port 0x300 bio irq 10 vector mcdintr</tag> + + <p>Mitsumi CD-ROM (LU002, + LU005, FX001D). + + <tag>device scd0 at isa? port 0x230 bio</tag> + + <p>Sony CD-ROM (CDU31, CDU33A). + + <tag>controller matcd0 at isa? port ? bio</tag> + + <p>Matsushita/Panasonic CD-ROM (sold by Creative + Labs for Soundblaster). + + </descrip> + + </descrip> + + <sect1><heading>SCSI Device Support<label id="kernelconfig:scsi"></heading> + + <p>This section describes the various SCSI controllers + and devices supported by FreeBSD. + + <descrip> + + <tag>SCSI Controllers</tag> + + <p>The next ten or so lines include support for + different kinds of SCSI controllers. Comment out + all except for the one(s) you have: + + <descrip> + + <tag>controller bt0 at isa? port ``IO_BT0'' bio irq ? vector btintr</tag> + + <p>Most Buslogic controllers + + <tag>controller uha0 at isa? port ``IO_UHA0'' bio irq ? drq 5 vector uhaintr</tag> + + <p>UltraStor 14F and 34F + + <tag>controller ahc0</tag> + + <p>Adaptec 274x/284x/294x + + <tag>controller ahb0 at isa? bio irq ? vector ahbintr</tag> + + <p>Adaptec 174x + + <tag>controller aha0 at isa? port ``IO_AHA0'' bio irq ? drq 5 vector ahaintr</tag> + + <p>Adaptec 154x + + <tag>controller aic0 at isa? port 0x340 bio irq 11 vector aicintr +</tag> + + <p>Adaptec 152x and sound cards using Adaptec AIC-6360 (slow!) + + <tag>controller nca0 at isa? port 0x1f88 bio irq 10 vector ncaintr +</tag> + + <p>ProAudioSpectrum cards using NCR 5380 or Trantor T130 + + <tag>controller sea0 at isa? bio irq 5 iomem 0xc8000 iosiz 0x2000 vector seaintr</tag> + + <p>Seagate ST01/02 8 bit controller (slow!) + + <tag>controller wds0 at isa? port 0x350 bio irq 15 drq 6 vector wdsintr</tag> + + <p>Western Digital WD7000 controller + + <tag>controller ncr0</tag> + + <p>NCR 53C810 and 53C825 PCI SCSI controller + + </descrip> + + <tag>options ``SCSI_DELAY=15''</tag> + + <p>This causes the + kernel to pause 15 seconds before probing each SCSI + device in your system. If you only have IDE hard + drives, you can ignore this, otherwise you'll + probably want to lower this number, perhaps to 5 + seconds, to speed up booting. Of course if you do + this, and FreeBSD has trouble recognizing your SCSI + devices, you'll have to raise it back up. + + <tag>controller scbus0</tag> + + <p>If you have any SCSI + controllers, this line provides generic SCSI + support. If you do not have SCSI, you can comment + this, and the following three lines, out. + + <tag>device sd0</tag> + + <p>Support for SCSI hard + drives. + + <tag>device st0</tag> + + <p>Support for SCSI tape + drives. + + <tag>device cd0</tag> + + <p>Support for SCSI CD-ROM + drives. + + </descrip> + + <sect1><heading>Console, Bus Mouse, and X Server Support</heading> + + <p>You must choose one of these two console types, and, if you plan + to use X Windows, enable the XSERVER option and optionally, a bus + mouse or PS/2 mouse device. + + <descrip> + + <tag>device sc0 at isa? port ``IO_KBD' tty irq 1 vector scintr</tag> + + <p><tt>sc0</tt> is the default + console driver, which resembles an SCO console. + Since most full-screen programs access the console + through a terminal database library like + <em>termcap</em>, it should not matter much whether + you use this or <tt>vt0</tt>, the VT220 compatible + console driver. When you log in, set your TERM + variable to ``scoansi'' if full-screen programs + have trouble running under this console. + + <tag>device vt0 at isa? port ``IO_KBD'' tty irq 1 vector pcrint</tag> + + <p>This is a VT220-compatible + console driver, backwards compatible to VT100/102. + It works well on some laptops which have hardware + incompatibilities with <tt>sc0</tt>. Also, set + your TERM variable to ``vt220'' when you log in if + full-screen programs do not run correctly on this + console. + + <descrip> + + <tag>options ``PCVT_FREEBSD=210''</tag> + + <p>Required + with the <tt>vt0</tt> console driver. + + <tag>options XSERVER</tag> + + <p>This includes code + required to run the <tt>XFree86</tt> X Window + Server. + + </descrip> + + <tag>device mse0 at isa? port 0x23c tty irq 5 vector ms</tag> + + <p>Use this device if you have a Logitech or + ATI InPort bus mouse card. + + <quote><em/Note:/ If you have a serial mouse, + ignore these two lines, and instead, make sure + the appropriate <ref id="kernelconfig:serial" + name="serial"> port is enabled (probably + COM1).</quote> + + <tag>device psm0 at isa? port ``IO_KBD'' conflicts tty irq 12 vector psmintr</tag> + + <p>Use this device if your + mouse plugs into the PS/2 mouse port. + + </descrip> + + <sect1><heading>Serial and Parallel Ports</heading> + + <p>Nearly all systems have these. If you are attaching a + printer to one of these ports, the <ref id="printing" + name="Printing"> section of the handbook is very + useful. If you are using modem, <ref id="dialup" + name="Dialup access"> provides extensive detail on + serial port configuration for use with such devices. + + <descrip> + + <tag>device sio0 at isa? port ``IO_COM1'' tty irq 4 vector siointr<label id="kernelconfig:serial"></tag> + + <p><tt>sio0</tt> + through <tt>sio3</tt> are the four serial ports + referred to as COM1 through COM4 in the MS-DOS + world. Note that if you have an internal modem on + COM4 and a serial port at COM2 you will have to + change the IRQ of the modem to 2 (for obscure + technical reasons IRQ 2 = IRQ 9) in order to access + it from FreeBSD. If you have a multiport serial + card, check the manual page for <tt>sio(4)</tt> for + more information on the proper values for these + lines. + + <tag>device lpt0 at isa? port? tty irq 7 vector lptintr</tag> + + <p><tt>lpt0</tt> through <tt>lpt2</tt> + are the three printer ports you could conceivably + have. Most people just have one, though, so feel + free to comment out the other two lines if you do + not have them. + + </descrip> + + <sect1><heading>Networking<label id="kernelconfig:network"></heading> + + <p>FreeBSD, as with Unix in general, places a + <em>big</em> emphasis on networking. Therefore, even + if you do not have an Ethernet card, pay attention to + the mandatory options and the dial-up networking + support. + + <descrip> + + <tag>options INET</tag> + Networking support. Leave it in even if you do not plan + to be connected to a network. Most programs require at least + loopback networking (i.e. making network connections within your + PC) so this is essentially mandatory. + + <tag>Ethernet cards</tag> + + <p>The next lines enable support for various Ethernet + cards. If you do not have a network card, you can + comment out all of these lines. Otherwise, you'll + want to leave in support for your particular + Ethernet card(s): + + <descrip> + + <tag>device de0</tag> + + <p>Digital Equipment DC21040 PCI Ethernet adapter + + <tag>device cx0 at isa? port 0x240 net irq 15 drq 7 vector cxintr</tag> + + <p>Cronyx/Sigma multiport + sync/async (with Cisco or PPP framing) + + <tag>device ed0 at isa? port 0x280 net irq 5 iomem 0xd8000 vector edintr</tag> + + <p>Western Digital and SMC 80xx; Novell NE1000 + and NE2000; 3Com 3C503 + + <tag>device el0 at isa? port 0x300 net irq 9 vector elintr</tag> + + <p>3Com 3C501 (slow!) + + <tag>device eg0 at isa? port 0x310 net irq 5 vector egintr</tag> + + <p>3Com 3C505 + + <tag>device ep0 at isa? port 0x300 net irq 10 vector epintr</tag> + + <p>3Com 3C509 (buggy) + + <tag>device fe0 at isa? port 0x240 net irq ? vector feintr</tag> + + <p>Fujitsu MB86960A/MB86965A Ethernet + + <tag>device fea0 at isa? net irq ? vector feaintr</tag> + + <p>DEC DEFEA EISA FDDI adapter + + <tag>device ie0 at isa? port 0x360 net irq 7 iomem 0xd0000 vector ieintr</tag> + + <p>AT&T StarLAN 10 and EN100; 3Com 3C507; + unknown NI5210 + + <tag>device ix0 at isa? port 0x300 net irq 10 iomem 0xd0000 iosiz 32768 vector ixintr</tag> + + <p>Intel EtherExpress 16 + + <tag>device le0 at isa? port 0x300 net irq 5 iomem 0xd0000 vector le_intr</tag> + + <p>Digital Equipment EtherWorks 2 and EtherWorks + 3 (DEPCA, DE100, DE101, DE200, DE201, DE202, + DE203, DE204, DE205, DE422) + + <tag>device lnc0 at isa? port 0x300 net irq 10 drq 0 vector lncintr</tag> + + <p>Lance/PCnet cards (Isolan, Novell NE2100, + NE32-VL) + + <tag>device ze0 at isa? port 0x300 net irq 5 iomem 0xd8000 vector zeintr</tag> + + <p>IBM/National Semiconductor PCMCIA ethernet + controller. + + <tag>device zp0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zpintr</tag> + + <p>3Com PCMCIA Etherlink III + + </descrip> + + <quote><em/Note:/ With certain cards (notably the + NE2000) you'll have to change the port and/or IRQ + since there is no ``standard'' location for these + cards.</quote> + + <tag>pseudo-device loop</tag> + + <p><tt>loop</tt> is the + generic loopback device for TCP/IP. If you telnet + or FTP to <em>localhost</em> + (a.k.a. <tt>127.0.0.1</tt>) it will come back at + you through this pseudo-device. Mandatory. + + <tag>pseudo-device ether</tag> + + <p><tt>ether</tt> is only + needed if you have an Ethernet card and includes + generic Ethernet protocol code. + + <tag>pseudo-device sl <em>number</em></tag> + + <p><tt>sl</tt> is for SLIP (Serial Line Internet + Protocol) support. This has been almost entirely + supplanted by PPP, which is easier to set up, + better suited for modem-to-modem connections, as + well as more powerful. The <em>number</em> after + <tt>sl</tt> specifies how many simultaneous SLIP + sessions to support. This handbook has more + information on setting up a SLIP <ref id="slipc" + name="client"> or <ref id="slips" name="server">. + + <tag>pseudo-device ppp <em>number</em></tag> + + <p><tt>ppp</tt> is for kernel-mode PPP (Point-to-Point + Protocol) support for dial-up Internet connections. + There is also version of PPP implemented as a user + application that uses the <tt>tun</tt> and offers + more flexibility and features such as demand + dialing. If you still want to use this PPP driver, + read the <ref id="ppp" name="kernel-mode PPP"> + section of the handbook. As with the <tt>sl</tt> + device, <em>number</em> specifies how many + simultaneous PPP connections to support. + + <tag>pseudo-device tun <em>number</em></tag> + + <p><tt>tun</tt> is used by the user-mode PPP software. + This program is easy to set up and very fast. It + also has special features such as automatic + dial-on-demand. The number after <tt>tun</tt> + specifies the number of simultaneous PPP sessions + to support. See the <ref id="userppp" + name="user-mode PPP"> section of the handbook for + more information. + + <tag>pseudo-device bpfilter <em>number</em></tag> + + <p>Berkeley packet filter. This pseudo-device allows + network interfaces to be placed in promiscuous + mode, capturing every packet on a broadcast network + (e.g. an ethernet). These packets can be captured + to disk and/or examined with the + <tt>tcpdump(1)</tt> program. Note that + implementation of this capability can seriously + compromise your overall network security. + The <em>number</em> after bpfilter is the number of + interfaces that can be examined + simultaneously. Optional, not recommended except + for those who are fully aware of the potential + pitfalls. Not all network cards support this + capability. + + </descrip> + + <sect1><heading>Sound cards</heading> + + <p>This is the first section containing lines that are + not in the GENERIC kernel. To include sound card + support, you'll have to copy the appropriate lines from + the LINT kernel (which contains support for + <em>every</em> device) as follows: + + <descrip> + + <tag>controller snd0</tag> + + <p>Generic sound driver code. + Required for all of the following sound cards + except <tt>pca</tt>. + + <tag>device pas0 at isa? port 0x388 irq 10 drq 6 vector pasintr</tag> + + <p>ProAudioSpectrum digital audio and MIDI. + + <tag>device sb0 at isa? port 0x220 irq 7 conflicts drq 1 vector sbintr</tag> + + <p>SoundBlaster digital audio. + + <quote><em/Note:/ If your Soundblaster is on a + different IRQ (such as 5), change <tt>irq 7</tt> + to, for example, <tt>irq 5</tt> and remove the + <tt>conflicts</tt> keyword. Also, you must add + the line: <tt>options ``SBC_IRQ=5''</tt></quote> + + <tag>device sbxvi0 at isa? drq 5</tag> + + <p>SoundBlaster 16 digital 16-bit audio. + + <quote><em/Note:/ If your SB16 is on a different + 16-bit DMA channel (such as 6 or 7), change the + <tt>drq 5</tt> keyword appropriately, and then + add the line: <tt>options + "SB16_DMA=6"</tt></quote> + + <tag>device sbmidi0 at isa? port 0x330</tag> + + <p>SoundBlaster 16 MIDI interface. If you have a + SoundBlaster 16, you must include this line, or the + kernel will not compile. + + <tag>device gus0 at isa? port 0x220 irq 10 drq 1 vector gusintr</tag> + + <p>Gravis Ultrasound. + + <tag>device mss0 at isa? port 0x530 irq 10 drq 1 vector adintr</tag> + + <p>Microsoft Sound System. + + <tag>device opl0 at isa? port 0x388 conflicts</tag> + + <p>AdLib FM-synthesis audio. Include this line for + AdLib, SoundBlaster, and ProAudioSpectrum users, if + you want to play MIDI songs with a program such as + <tt>playmidi</tt> (in the ports collection). + + <tag>device mpu0 at isa? port 0x330 irq 6 drq 0</tag> + + <p>Roland MPU-401 stand-alone card. + + <tag>device uart0 at isa? port 0x330 irq 5 vector ``m6850intr''</tag> + + <p>Stand-alone 6850 UART for MIDI. + + <tag>device pca0 at isa? port ``IO_TIMER1'' tty</tag> + + <p>Digital audio through PC speaker. This is going to + be very poor sound quality and quite CPU-intensive, + so you have been warned (but it does not require a + sound card)! + + </descrip> + + <quote><em/Note:/ There is some additional + documentation in + <tt>/usr/src/sys/i386/isa/sound/sound.doc</tt>. + Also, if you add any of these devices, be sure to + create the sound <ref id="kernelconfig:nodes" + name="device nodes">.</quote> + + <sect1><heading>Pseudo-devices</heading> + + <p>Pseudo-device drivers are parts of the kernel that act + like device drivers but do not correspond to any actual + hardware in the machine. The <ref + id="kernelconfig:network" name="network-related"> + pseudo-devices are in that section, while the remainder + are here. + + <descrip> + + <tag>pseudo-device gzip</tag> + + <p><tt>gzip</tt> allows you to run FreeBSD programs + that have been compressed with <tt>gzip</tt>. This + is really only useful when you need to compress + FreeBSD programs to fit on a boot floppy. You will + probably never need to compress programs on your + hard drive in this fashion, so you'll probably want + to comment out this line. + <tag>pseudo-device log</tag> + + <p><tt>log</tt> is used for logging of kernel error + messages. Mandatory. + + + <tag>pseudo-device pty <em>number</em><label id="kernelconfig:ptys"></tag> + + <p><tt>pty</tt> is a ``pseudo-terminal'' or simulated + login port. It's used by incoming <bf>telnet</bf> + and <bf>rlogin</bf> sessions, xterm, and some other + applications such as emacs. The <em>number</em> + indicates the number of <tt>pty</tt>s to create. + If you need more than GENERIC default of 16 + simultaneous xterm windows and/or remote logins, be + sure to increase this number accordingly, up to a + maximum of 64. + + <tag>pseudo-device snp <em>number</em></tag> + + <p>Snoop device. This pseudo-device allows one + terminal session to watch another using the + <tt>watch(8)</tt> command. Note that + implementation of this capability has important + security and privacy implications. The + <em>number</em> after snp is the total number of + simultaneous snoop sessions. Optional. + + <tag>pseudo-device vn</tag> + + <p>Vnode driver. Allows a file to be treated as a + device after being set up with the + <tt>vnconfig(8)</tt> command. This driver can be + useful for manipulating floppy disk images and + using a file as a swap device (e.g. an MS Windows + swap file). Optional. + + </descrip> + + <sect1><heading>Joystick, PC Speaker, Miscellaneous</heading> + + <p>This section describes some miscellaneous hardware + devices supported by FreeBSD. Note that none of these + lines are included in the GENERIC kernel, you'll have + to copy them from this handbook or the LINT kernel + (which contains support for <em>every</em> device): + + <descrip> + + <tag>device joy0 at isa? port ``IO_GAME''</tag> + + <p>PC joystick device. + + <tag>pseudo-device speaker</tag> + + <p>Supports IBM BASIC-style noises through the PC + speaker. Some fun programs which use this are + <tt>/usr/sbin/spkrtest</tt>, which is a shell + script that plays some simple songs, and + <tt>/usr/games/piano</tt> which lets you play songs + using the keyboard as a simple piano (this file + only exists if you've installed the <em>games</em> + package). Also, the excellent text role-playing + game NetHack (in the ports collection) can be + configured to use this device to play songs when + you play musical instruments in the game. + + </descrip> + + <sect><heading>Making Device Nodes<label id="kernelconfig:nodes"></heading> + + <p>Almost every device in the kernel has a corresponding + ``node'' entry in the <tt>/dev</tt> directory. These + nodes look like regular files, but are actually special + entries into the kernel which programs use to access the + device. The shell script <tt>/dev/MAKEDEV</tt>, which is + executed when you first install the operating system, + creates nearly all of the device nodes supported. + However, it does not create <em>all</em> of them, so when + you add support for a new device, it pays to make sure + that the appropriate entries are in this directory, and + if not, add them. Here is a simple example: + + Suppose you add the IDE CD-ROM support to the kernel. + The line to add is: +<tscreen><verb> +controller wcd0 +</verb></tscreen> + This means that you should look for some entries that + start with <tt>wcd0</tt> in the <tt>/dev</tt> directory, + possibly followed by a letter, such as `c', or preceded + by the letter 'r', which means a `raw' device. It turns + out that those files are not there, so I must change to + the <tt>/dev</tt> directory and type: +<tscreen><verb> +# sh MAKEDEV wcd0 +</verb></tscreen> + When this script finishes, you will find that there are + now <tt>wcd0c</tt> and <tt>rwcd0c</tt> entries in + <tt>/dev</tt> so you know that it executed correctly. + + For sound cards, the command: +<tscreen><verb> +# sh MAKEDEV snd0 +</verb></tscreen> + creates the appropriate entries. Follow this simple + procedure for any other non-GENERIC devices which do not + have entries. + + <quote><em/Note:/ All SCSI controllers use the same set + of <tt>/dev</tt> entries, so you do not need to create + these. Also, network cards and SLIP/PPP pseudo-devices + do not have entries in <tt>/dev</tt> at all, so you do + not have to worry about these either.</quote> + +<sect><heading>If Something Goes Wrong<label id="kernelconfig:trouble"></heading> + + <p>There are four categories of trouble that can occur when + building a custom kernel. They are: + + <descrip> + + <tag>Config command fails</tag> + + <p>If the <tt>config</tt> + command fails when you give it your kernel + description, you've probably made a simple error + somewhere. Fortunately, <tt>config</tt> will print + the line number that it had trouble with, so you can + quickly skip to it with <tt>vi</tt>. For example, if + you see: +<tscreen><verb> +config: line 17: syntax error +</verb></tscreen> + you can skip to the problem in <tt>vi</tt> by typing + ``17G'' in command mode. Make sure the keyword is + typed correctly, by comparing it to the GENERIC + kernel or another reference. + + <tag>Make command fails</tag> + + <p>If the <tt>make</tt> + command fails, it usually signals an error in your + kernel description, but not severe enough for + <tt>config</tt> to catch it. Again, look over your + configuration, and if you still cannot resolve the + problem, send mail to <tt><htmlurl + url="mailto:questions@freebsd.org" + name="questions@FreeBSD.ORG"></tt> with your kernel + configuration, and it should be diagnosed very + quickly. + + <tag>Kernel will not boot<label id="kernelconfig:noboot"></tag> + + <p>If your new kernel + does not boot, or fails to recognize your devices, + do not panic! Fortunately, BSD has an excellent + mechanism for recovering from incompatible kernels. + Simply type the name of the kernel you want to boot + from (i.e. ``kernel.old'') at the FreeBSD boot + prompt instead of pressing return. When + reconfiguring a kernel, it is always a good idea to + keep a kernel that is known to work on hand. + + After booting with a good kernel you can check over + your configuration file and try to build it again. + One helpful resource is the + <tt>/var/log/messages</tt> file which records, among + other things, all of the kernel messages from every + successful boot. Also, the <tt>dmesg(8)</tt> command + will print the kernel messages from the current boot. + + <quote><em/Note:/ If you are having trouble building + a kernel, make sure to keep a GENERIC, or some + other kernel that is known to work on hand as a + different name that will not get erased on the next + build. You cannot rely on <tt>kernel.old</tt> + because when installing a new kernel, + <tt>kernel.old</tt> is overwritten with the last + installed kernel which may be non-functional. + Also, as soon as possible, move the working kernel + to the proper ``kernel'' location or commands such + as <tt>ps(1)</tt> will not work properly. The + proper command to ``unlock'' the kernel file that + <tt>make</tt> installs (in order to move another + kernel back permanently) is: +<tscreen><verb> +# chflags noschg /kernel +</verb></tscreen> + And, if you want to ``lock'' your new kernel into place, or any file + for that matter, so that it cannot be moved or tampered with: +<tscreen><verb> +# chflags schg /kernel +</verb></tscreen> + </quote> + + <tag>Kernel works, but <tt>ps</tt> does not work any more!</tag> + + <p>If you've installed a different version + of the kernel from the one that the system utilities + have been built with, for example, an experimental + ``2.2.0'' kernel on a 2.1.0-RELEASE system, many + system-status commands like <tt>ps(1)</tt> and + <tt>vmstat(8)</tt> will not work any more. You must + recompile the <tt>libkvm</tt> library as well as + these utilities. This is one reason it is not + normally a good idea to use a different version of + the kernel from the rest of the operating system. + + </descrip> diff --git a/handbook/porting.sgml b/handbook/porting.sgml index db709a5228..a33b715818 100644 --- a/handbook/porting.sgml +++ b/handbook/porting.sgml @@ -1,1012 +1,1012 @@ -<!-- $Id: porting.sgml,v 1.6 1995-10-03 07:11:51 asami Exp $ --> +<!-- $Id: porting.sgml,v 1.7 1995-10-07 04:31:35 jfieber Exp $ --> <!-- The FreeBSD Documentation Project --> <sect><heading>Porting applications<label id="porting"></heading> <p><em>Contributed by &a.jkh;, &a.gpalmer; and &a.asami;.<newline>19 August 1995.</em> Here are the guidelines one should follow in creating a new port for FreeBSD 2.x . This documentation will change as this process is progressively refined, so watch this space for details. The <tt>${..}</tt> variable names you see in this document all refer to various user-overridable defaults used (and documented) by <tt>/usr/share/mk/bsd.port.mk</tt>. Please refer to that file for more details. <sect1> <heading>Before Starting the Port</heading> <p>Note: Only a fraction of the overridable variables are mentioned in this document. Most (if not all) are documented at the start of the <tt>bsd.port.mk</tt> file which can be found in <tt>/usr/share/mk</tt>. This file uses a non-standard tab setting. <tt>Emacs</tt> should recognize the setting on loading the file. <tt>vi</tt> or <tt>ex</tt> can be set to using the correct value by typing `<tt>:set tabstop=4</tt>' once the file has been loaded. <p>You may come across code that needs modifications or conditional compilation based upon what version of UNIX it's running under. If you need to make such changes to the code for conditional compilation, make sure you make the changes as general as possible so that we can back-port code to FreeBSD 1.x systems and cross-port to other BSD systems such as 4.4BSD from CSRG, BSD/386, 386BSD and NetBSD. <p>The preferred way to tell 4.3BSD/Reno and newer versions of the BSD code apart is by using the `<tt>BSD</tt>' macro defined in <tt><sys/param.h></tt>. Hopefully that file is already included; if not, add the code: <tscreen><verb> #ifdef _HAVE_PARAM_H #include <sys/param.h> #endif </verb></tscreen> to the proper place in the <tt>.c</tt> file and add <tt>-D_HAVE_PARAM_H</tt> to the <tt>CFLAGS</tt> in the Makefile. Then, you may use: <tscreen><verb> #if (defined(BSD) && (BSD >= 199103)) </verb></tscreen> to detect if the code is being compiled on a 4.3 Net2 code base or newer (e.g. FreeBSD 1.x, 4.3/Reno, NetBSD 0.9, 386BSD, BSD/386 1.1 and below). Use: <tscreen><verb> #if (defined(BSD) && (BSD >= 199306)) </verb></tscreen> to detect if the code is being compiled on a 4.4 code base or newer (e.g. FreeBSD 2.x, 4.4, NetBSD 1.0, BSD/386 2.0 or above). <p>Use sparingly: <itemize> <item><tt>__FreeBSD__</tt> is defined in all versions of FreeBSD. Use it if the change you are making ONLY affects FreeBSD. Porting gotchas like the use of <tt>sys_errlist[]</tt> vs <tt>strerror()</tt> are Berkeleyisms, not FreeBSD changes. <item>In FreeBSD 2.x, <tt>__FreeBSD__</tt> is defined to be <tt>2</tt>. In earlier versions, it's <tt>1</tt>. <item>If you need to tell the difference between a FreeBSD 1.x system and a FreeBSD 2.x system, usually the right answer is to use the <tt>BSD</tt> macros described above. If there actually is a FreeBSD specific change (such as special shared library options when using `<tt>ld</tt>') then it's OK to use <tt>__FreeBSD__</tt> and `<tt>#if __FreeBSD_ > 1</tt>' to detect a FreeBSD 2.x system. </itemize> <p>In the dozens of ports that have been done, there have only been one or two cases where <tt>__FreeBSD__</tt> should have been used. Just because an earlier port screwed up and used it in the wrong place doesn't mean you should do so too. <sect1> <heading>Quick Porting</heading> <p>This section tells you how to do a quick port. In many cases, it is not enough, but we'll see. <p>First, get the original tarball and put it into <tt>${DISTDIR}</tt>, which defaults to <tt>/usr/ports/distfiles</tt>. <p>Note: The following assumes that the software compiled out-of-the-box, i.e., there was absolutely no change required for the port to work on your FreeBSD box. If you needed to change something, you'll have to refer to the next section too. <sect2> <heading>Writing the Makefile</heading> <p>The minimal <tt>Makefile</tt> would look something like this: <tscreen><verb> -# New ports collection makefile for: oneko -# Version required: 1.1b -# Date created: 5 December 1994 -# Whom: asami -# -# $Id: porting.sgml,v 1.6 1995-10-03 07:11:51 asami Exp $ -# - -DISTNAME= oneko-1.1b -CATEGORIES+= games -MASTER_SITES= ftp://ftp.cs.columbia.edu/archives/X11R5/contrib/ - -MAINTAINER= asami@FreeBSD.ORG - -USE_IMAKE= yes - -.include <bsd.port.mk> + # New ports collection makefile for: oneko + # Version required: 1.1b + # Date created: 5 December 1994 + # Whom: asami + # + # $Id: porting.sgml,v 1.7 1995-10-07 04:31:35 jfieber Exp $ + # + + DISTNAME= oneko-1.1b + CATEGORIES+= games + MASTER_SITES= ftp://ftp.cs.columbia.edu/archives/X11R5/contrib/ + + MAINTAINER= asami@FreeBSD.ORG + + USE_IMAKE= yes + + .include <bsd.port.mk> </verb></tscreen> <p>See if you can figure it out. Don't worry about the contents of the <tt>$Id$</tt> line, it will be filled in automatically by CVS when the port is imported to our main ports tree. <sect2> <heading>Writing the description files</heading> <p>There are three required description files that are required for any port, whether they actually package or not. They are <tt>COMMENT</tt>, <tt>DESCR</tt>, and <tt>PLIST</tt>, and reside in the <tt>pkg</tt> subdirectory. <sect3> <heading>COMMENT</heading> <p>This is the one-line description of the port. It is recommended to have the name of the package at the beginning, as in: <tscreen><verb> oneko-1.1b, a cat chasing a mouse all over the screen </verb></tscreen> <sect3> <heading>DESCR</heading> <p>This is a longer description of the port. One to a few paragraphs concisely explaining what the port does is sufficient. Note: This is <em>not</em> a manual nor an in-depth description on how to use or compile the port. In particular, please do not just copy the <tt>README</tt> file here, unless, of course, it's a concise description of the port. <p>It is recommended that you sign the name at the end of this file, and also state the version number, as in: <tscreen><verb> This is a port of oneko, in which a cat chases a poor mouse all over the screen. : (etc.) : This is version 1.1b. - Satoshi asami@cs.berkeley.edu </verb></tscreen> <sect3> <heading>PLIST</heading> <p>This file lists all the files installed by the port. It is also called the `packing list' because the package is generated by packing the files listed here. The pathnames are relative to the installation prefix (usually <tt>/usr/local</tt> or <tt>/usr/X11R6</tt>). <p>Here is a small example: <tscreen><verb> bin/oneko man/man1/oneko.1.gz lib/X11/app-defaults/Oneko lib/X11/oneko/cat1.xpm lib/X11/oneko/cat2.xpm lib/X11/oneko/mouse.xpm </verb></tscreen> <sect2> <heading>Creating the checksum file</heading> <p>Just type `<tt>make makesum</tt>'. The ports make rules will automatically generate the file <tt>files/md5</tt>. <sect2> <heading>Testing the port</heading> <p>You should make sure that the port rules do exactly what you want it to do, including packaging up the port. Try doing `<tt>make install</tt>', `<tt>make package</tt>' and then `<tt>pkg_delete -d <pkgname></tt>' and see if all the files are correctly deleted. Then do a `<tt>pkg_add <pkgname>.tgz</tt>' and see if everything re-appears and works correctly. <sect2> <heading>Submitting the port</heading> <p>Now that you're happy with your port, the only thing remaining is to put it in the main FreeBSD ports tree and make everybody else happy about it too. To accomplish this, pack the necessary files (everything described in this section -- in particular do <em>not</em> include the original source tarball or the `<tt>work</tt>' subdirectory) into a <tt>.tar.gz</tt> file, stick it in the directory <tscreen><verb> ftp://ftp.freebsd.org/pub/FreeBSD/incoming/ </verb></tscreen> and send mail to <tt>ports@freebsd.org</tt>. We will take a look, get back to you if necessary, and put it in the tree. Your name will also appear in the list of `Additional FreeBSD contributors' on the FreeBSD Handbook and other files. Isn't that great?!? <tt>:)</tt> <sect1> <heading>Slow Porting</heading> <p>Ok, so it wasn't that simple, and the port required some modifications to get it to work. In this section, we'll explain, step by step, how to modify it to get it to work with the ports paradigm. <sect2> <heading>How things work</heading> <p>First, this is the sequence of events which occurs when the user first types `<tt>make</tt>' in your port's directory, and you may find that having <tt>bsd.port.mk</tt> in another window while you read this really helps to understand it. <p>But don't worry if you don't really understand what <tt>bsd.port.mk</tt> is doing, not many people do... <tt>:></tt> <enum> <item>The fetch target is run. The fetch target is responsible for making sure that the tarball exists locally in <tt>${DISTDIR}</tt>. If fetch cannot find the required files in <tt>${DISTDIR}</tt> it will look up the ftp-URL <tt>${MASTER_SITES}</tt>, which is set in the Makefile. It will then attempt to fetch the named distribution file with <tt>${NCFTP}</tt>, assuming that the requesting site has direct access to the Internet. If that succeeds, it will save the file in <tt>${DISTDIR}</tt> for future use and proceed. <item>The extract target is run. It looks for your ports' distribution file in <tt>${DISTDIR}</tt> (typically a gzip'd tarball) and unpacks it into a temporary subdirectory specified by <tt>${WRKDIR}</tt> (defaults to <tt>work</tt>). <item>The patch target is run. First, any patches defined in <tt>${PATCHFILES}</tt> are applied. Second, if any patches are found in <tt>${PATCHDIR}</tt> (defaults to the <tt>patches</tt> subdirectory), they are applied at this time in alphabetical order. <item>The configure target is run. This can do any one of many different things. <enum> <item>If it exists, <tt>scripts/configure</tt> is run. <item>If <tt>${HAS_CONFIGURE}</tt> or <tt>${GNU_CONFIGURE}</tt> is set, <tt>${WRKSRC}/configure</tt> is run. <item>If <tt>${USE_IMAKE}</tt> is set, <tt>${XMKMF}</tt> (default: `<tt>xmkmf -a</tt>') is run. </enum> <item>The build target is run. This is responsible for descending into the ports' private working directory (<tt>${WRKSRC}</tt>) and building it. If <tt>${USE_GMAKE}</tt> is set, GNU <tt>make</tt> will be used, otherwise the system <tt>make</tt> will be used. </enum> <p>The above are the default actions. In addition, you can define targets `<tt>pre-<something></tt>' or `<tt>post-<something></tt>', or put scripts with those names, in the <tt>scripts</tt> subdirectory, and they will be run before or after the default actions are done. <p>For example, if you have a <tt>post-extract</tt> target defined in your Makefile, and a file <tt>pre-build</tt> in the <tt>scripts</tt> subdirectory, the <tt>post-extract</tt> target will be called after the regular extraction actions, and the <tt>pre-build</tt> script will be executed before the default build rules are done. It is recommended that you use Makefile targets if possible, because it will be easier for someone to figure out what kind of non-default action the port requires. <p>The default actions are done by the <tt>bsd.port.mk</tt> targets `<tt>do-<something></tt>'. For example, the commands to extract a port are in the target `<tt>do-extract</tt>'. If you are not happy with the default target, and you can't fix it by redefining the `<tt>do-<something></tt>' target in your Makefile. <p>Note that the `main' targets (e.g., <tt>extract</tt>, <tt>configure</tt>, etc.) do nothing more than make sure all the stages up to that one is completed and call the real targets or scripts, and they are not intended to be changed. If you want to fix the extraction, fix <tt>do-extract</tt>, but never ever touch <tt>extract</tt>! <p>Now that you understand what goes on when the user types `<tt>make</tt>', let's go through the recommended steps to create the perfect port. <sect2> <heading>Getting the original sources</heading> <p>Get the original sources (normally) as a compressed tarball (<tt><foo>.tar.gz</tt> or <tt><foo>.tar.Z</tt>) and copy it into <tt>${DISTDIR}</tt>. Always use <em>mainstream</em> sources when and where you can. <p>If you can't find a ftp site that is well-connected to the net, or can only find sites that have irritatingly non-standard formats, we can `house' it ourselves by putting it on <tscreen><verb> ftp://freefall.freebsd.org/pub/FreeBSD/LOCAL_PORTS/ </verb></tscreen> as the last resort. Send mail to <tt>ports@freebsd.org</tt> if you are not sure what to do. <p>If your port requires some additional `patches' that are available on the Internet, fetch them too and put them in <tt>${DISTDIR}</tt>. Don't worry if they come from site other than where you got the the main source tarball, we have a way to handle these situations (see the description of <tt>${PATCHFILES}</tt> below). <sect2> <heading>Modifying the port</heading> <p>Unpack a copy of the tarball in a private directory and make whatever changes are necessary to get the port to compile properly under the current version of FreeBSD. Keep <em>careful track</em> of everything you do, as you will be automating the process shortly. Everything, including the deletion, addition or modification of files should be doable using an automated script or patch file when your port is finished. <p>If your port requires significant user interaction/customization to compile or install, you should take a look at one of Larry Wall's classic Configure scripts and perhaps do something similar yourself. The goal of the new ports collection is to make each port as `plug-and-play' as possible for the end-user while using a minimum of disk space. <sect2> <heading>Patching</heading> <p>In the preparation of the port, files that have been added or changed can be picked up with a recursive diff for later feeding to patch. This is the easiest kind of change to make as it doesn't involve any mucking around with configuration files. Each set of patches you wish to apply should be collected into a file named `<tt>patch-<xx></tt>' where <tt><xx></tt> denotes the sequence in which the patches will be applied -- these are done in <em>alphabetical order</em>, thus `<tt>aa</tt>' first, `<tt>ab</tt>' second and so on. These files should be stored in <tt>${PATCHDIR}</tt>, from where they will be automatically applied. All patches should be relative to <tt>${WRKSRC}</tt> (generally the directory your port's tarball unpacks itself into, that being where the make is done). To make fixes and upgrades easier you should avoid having more than one patch fix the same file (e.g., patch-ab and patch-ab both changing <tt>${WRKSRC}</tt>/foobar.c). <sect2> <heading>Configuring</heading> <p>Include any additional customization commands to your <tt>configure</tt> script and save it in the `<tt>scripts</tt>' subdirectory. As mentioned above, you can also do this as Makefile targets and/or scripts with the name <tt>pre-configure</tt> or <tt>post-configure</tt>. <sect2> <heading>Handling user input</heading> <p>If your port requires user input to build, configure or install, then set <tt>IS_INTERACTIVE</tt> in your Makefile. This will allow `overnight builds' to skip your port if the user sets the variable <tt>BATCH</tt> in his environment (and if the user sets the variable <tt>INTERACTIVE</tt>, then <em>only</em> those ports requiring interaction are built). <sect1> <heading>Configuring the Makefile</heading> <p>Configuring the Makefile is pretty simple, and again we suggest that you look at existing examples before starting. Consider the following problems in sequence as you design your new Makefile: <sect2> <heading>The original source</heading> <p>Does it live in <tt>${DISTDIR}</tt> as a standard gzip'd tarball? If so, you can go on to the next step. If not, you should look at overriding any of the <tt>${EXTRACT_CMD}</tt>, <tt>${EXTRACT_BEFORE_ARGS}</tt>, <tt>${EXTRACT_AFTER_ARGS}</tt>, <tt>${EXTRACT_SUFX}</tt>, or <tt>${DISTFILE}</tt> variables, depending on how alien a format your port's distribution file is. (The most common case is `<tt>EXTRACT_SUFX=.tar.Z</tt>', when the tarball is condensed by regular compress, not gzip.) <p>In the worst case, you can simply create your own `<tt>do-extract</tt>' target to override the default, though this should be rarely, if ever, necessary. <sect2> <heading>DISTNAME</heading> <p>You should set <tt>${DISTNAME}</tt> to be the base name of your port. The default rules expect the distribution file list (<tt>${DISTFILES}</tt>) to be named <tt>${DISTFILE}${EXTRACT_SUFX}</tt> by default which, if it's a normal tarball, is going to be something like: <tscreen><verb> foozolix-1.0.tar.gz </verb></tscreen> for a setting of `<tt>DISTNAME=foozolix-1.0</tt>'. The default rules also expect the tarball(s) to extract into a subdirectory called <tt>work/${DISTNAME}</tt>, e.g. <tscreen><verb> work/foozolix-1.0/ </verb></tscreen> All this behavior can be overridden, of course, it simply represents the most common time-saving defaults. For a port requiring multiple distribution files, simply set <tt>${DISTFILES}</tt> explicitly. If only a subset of <tt>${DISTFILES}</tt> are actual extractable archives, then set them up in <tt>${EXTRACT_ONLY}</tt>, which will override the <tt>${DISTFILES}</tt> list when it comes to extraction, and the rest will be just left in <tt>${DISTDIR}</tt> for later use. <sect2> <heading>CATEGORIES and KEYWORDS</heading> <p>When a package is created, it is put under <tt>/usr/ports/packages/All</tt> and links are made from one or more subdirectories of <tt>/usr/ports/packages</tt>. The names of these subdirectories are specified by the variable <tt>${CATEGORIES}</tt>. It is intended to make life easier for the user when he is wading through the pile of packages on the ftp site or the CD-ROM. Please take a look at the existing categories (some of them have different names from subdirectories of <tt>/usr/ports</tt>) and pick the ones that are suitable for your port. If your port truly belongs to something that is different from all the existing ones, you can even create a new category name. <p>If you want to add more information than just the category names, add them to <tt>${KEYWORDS}</tt>. The value of this variable defaults to that of <tt>${CATEGORIES}</tt>. This is currently used only as a field of the <tt>/usr/ports/INDEX</tt> file. <sect2> <heading>MASTER_SITES</heading> <p>If you have a ftp-URL pointing at the the original tarball, record the directory containing the tarball in <tt>${MASTER_SITES}</tt>. This will provide a backup site, as well as a direct pointer to the original source location. Don't forget the trailing slash (<tt>/</tt>)! <p>The make macros will try to use this specification for grabbing the distribution file with <tt>${NCFTP}</tt> if they can't find it already on the system. <p>It is recommended that you put multiple sites on this list, preferably from different continents. This will safeguard against wide-area network problems, and we are even planning to add support for automatically determining the closest master site and fetching from there! <sect2> <heading>PATCHFILES</heading> <p>If your port requires some additional patches that are available by ftp, set <tt>${PATCHFILES}</tt> to the names of the files and <tt>${PATCH_SITES}</tt> to the URL of the directory that contains them (the format is the same as <tt>${MASTER_SITES}</tt>). <p>If the patch is not relative to the top of the source tree (i.e., <tt>${WKRSRC}</tt>) because it contains some extra pathnames, set <tt>${PATCH_DIST_STRIP}</tt> accordingly. For instance, if all the pathnames in the patch has an extra `<tt>foozolix-1.0/</tt>' in front of the filenames, then set `<tt>PATCH_DIST_STRIP=-p1</tt>'. <p>Don't worry if the patches are compressed, they will be decompressed automatically if the filenames end with `<tt>.gz</tt>' or `<tt>.Z</tt>'. <sect2> <heading>MAINTAINER</heading> <p>Set your mail-address here. Please. <tt>:)</tt> <sect2> <heading>Dependencies</heading> <p>Many ports depend on other ports. There are five variables that you can use to ensure that all the required bits will be on the user's machine. <sect3> <heading>LIB_DEPENDS</heading> <p>This variable specifies the shared libraries this port depends on. It is a list of `<tt>lib:dir</tt>' pairs where <tt>lib</tt> is the name of the shared library, and <tt>dir</tt> is the directory in which to find it in case it's not available. For example, <tscreen><verb> LIB_DEPENDS= tcl\\.7\\.:${PORTSDIR}/lang/tcl </verb></tscreen> will check for a shared tcl library with major version 7, and descend into the <tt>lang/tcl</tt> subdirectory of your ports tree to build and install it if it's not found. Note that the <tt>lib</tt> part is just an argument given to `<tt>ldconfig -r | grep</tt>', so periods should be escaped by two backslashes like in the example above. <sect3> <heading>RUN_DEPENDS</heading> <p>This variable specifies executables this port depends on during run-time. It is a list of `<tt>exec:dir</tt>' pairs where <tt>exec</tt> is the name of the executable, and <tt>dir</tt> is the directory in which to find it in case it's not available. For example, <tscreen><verb> RUN_DEPENDS= wish:${PORTSDIR}/x11/tk </verb></tscreen> will check for an executable called `<tt>wish</tt>', and descend into the <tt>x11/tk</tt> subdirectory of your ports tree to build and install it if it's not found. The dependency is checked from within the <tt>install</tt> target. Also, the name of the dependency is put in to the package so that <tt>pkg_add</tt> will automatically install it if it is not on the user's system. <sect3> <heading>BUILD_DEPENDS</heading> <p>This variable specifies executables this port requires to build. Like <tt>RUN_DEPENDS</tt>, it is a list of `<tt>exec:dir</tt>' pairs. For example, <tscreen><verb> BUILD_DEPENDS= unzip:${PORTSDIR}/archivers/unzip </verb></tscreen> will check for an executable called `<tt>unzip</tt>', and descend into the <tt>archivers/unzip</tt> subdirectory of your ports tree to build and install it if it's not found. Note that `build' here means everything from extracting to compilation. The dependency is checked from within the <tt>extract</tt> target. <sect3> <heading>FETCH_DEPENDS</heading> <p>This variable specifies executables this port requires to fetch. Like the previous two, it is a list of `<tt>exec:dir</tt>' pairs. For example, <tscreen><verb> FETCH_DEPENDS= ncftp2:${PORTSDIR}/net/ncftp2 </verb></tscreen> will check for an executable called `<tt>ncftp2</tt>', and descend into the <tt>net/ncftp2</tt> subdirectory of your ports tree to build and install it if it's not found. The dependency is checked from within the <tt>fetch</tt> target. <sect3> <heading>DEPENDS</heading> <p>If there is a dependency that doesn't fall into either of the above four categories, or your port requires to have the source of the other port extracted (i.e., having them installed is not enough), then use this variable. This is just a list of directories, as there is nothing to check, unlike the previous two. <sect2> <heading>Building mechanisms</heading> <p>If your package uses GNU <tt>make</tt>, set `<tt>USE_GMAKE=yes</tt>'. If your package uses GNU <tt>configure</tt>, set `<tt>GNU_CONFIGURE=yes</tt>'. If you want to override the default GNU <tt>configure</tt> arguments from `<tt>--prefix=${PREFIX}</tt>' to something else, set those arguments in <tt>${CONFIGURE_ARGS}</tt>. <p>If your package uses <tt>imake</tt> (e.g. is an X application that has an <tt>Imakefile</tt>), then set `<tt>USE_IMAKE=yes</tt>'. This will cause the configure stage to automatically do an <tt>xmkmf -a</tt>. If the `<tt>-a</tt>' flag is a problem for your port, set `<tt>XMKMF=xmkmf</tt>'. <p>If your port's source Makefile has something else than `<tt>all</tt>' as the main build target, set <tt>${ALL_TARGET}</tt> accordingly. Same goes for `<tt>install</tt>' and <tt>${INSTALL_TARGET}</tt>. <sect2> <heading>NO_INSTALL_MANPAGES</heading> <p>If the port uses imake but doesn't understand the `<tt>install.man</tt>' target, `<tt>NO_INSTALL_MANPAGES=yes</tt>' should be set. In addition, the author of the original port should be shot. <sect1> <heading>Licensing Problems</heading> <p>Some software packages have restrictive licenses or are in violation to the law (PKP's patent on public key crypto, ITAR (export of crypto software) to name just two of them). What we can do with them vary a lot, depending on the exact wordings of the respective licenses. <p>Note that it is your responsibility as a porter to read the licensing terms of the software and make sure that the FreeBSD project won't held accountable of violating them by redistributing the source or compiled binaries either via ftp or CD-ROM. If in doubt, please contact <tt>ports@freebsd.org</tt>. <p>We usually get around this problem by setting <tt>${NO_PACKAGE}</tt> in the Makefile, and not putting the distfile up for ftp. However, for most cases, you should at least be able to make a port, so don't let the license scare you away! <p>Note: The GNU General Public License (GPL), both version 1 and 2, shouldn't be a problem for ports. <p>Note: If you are a committer, make sure you update the <tt>ports/LEGAL</tt> file too. <sect1> <heading>* Upgrading</heading> <p>This section is still under construction, sorry. <sect1> <heading>Do's and Dont's</heading> <p>Here's a list of common do's and dont's that you encounter during the porting process. <sect2> <heading>WRKDIR</heading> <p>Don't leave anything valuable lying around in the `<tt>work</tt>' subdirectory, `<tt>make clean</tt>' will <em>nuke</em> it completely! If you need auxiliary files that aren't scripts or patches, put them in the subdirectory `<tt>files</tt>' and use the <tt>post-extract</tt> target to copy them to the `<tt>work</tt>' subdirectory. <sect2> <heading>Package information</heading> <p>Do install package information, i.e., the three files in <tt>pkg</tt>. Note that these files are not used only for packaging anymore, and are <em>mandatory</em> now, even if <tt>${NO_PACKAGE}</tt> is set. <sect2> <heading>Compress manpages, strip binaries</heading> <p>Do compress manpages and strip binaries. If the original source already does that, fine; otherwise, you can add a <tt>post-install</tt> rule to do it yourself. Make sure that you check the variable <tt>NOMANCOMPRESS</tt> that the user can set in <tt>/etc/make.conf</tt> to disable man page compression. Here's an example: <tscreen><verb> -post-install: - strip ${PREFIX}/bin/xdl -.if !defined(NOMANCOMPRESS) - gzip -9nf ${PREFIX}/man/man1/xdl.1 -.endif + post-install: + strip ${PREFIX}/bin/xdl + .if !defined(NOMANCOMPRESS) + gzip -9nf ${PREFIX}/man/man1/xdl.1 + .endif </verb></tscreen> <p>Use the <tt>file</tt> command on the installed executable to check whether the binary is stripped or not. If it doesn't say `not stripped', it is stripped. <sect2> <heading>Custom utilities</heading> <p>Don't rely on custom utilities in your local configure script or anything -- they may not be there on the user's system! If you really need something else to be installed before you can work, detect this from your configure script, print a helpful message and exit with a non-zero status! At least you'll have given the user some idea of what's needed. If the custom utility or package is actually part of the ports tree, this should be dealt by the dependency mechanism of ports. <p>Actually, if this utility is not part of the ports tree you should probably make a port of this utility (this is how many of the ports made it into the tree!). Depending on something that is not part of the main FreeBSD distribution or the ports tree is a bad idea, and the user should be able to go to any subdirectory of <tt>/usr/ports</tt> and type `<tt>make</tt>' and have that port, as well as everything it requires, built automatically. <sect2> <heading>Feedback</heading> <p>Do send applicable changes/patches to the original author/maintainer for inclusion in next release of the code. This will only make your job that much easier for the next release. <sect2> <heading>RCS strings</heading> <p>Don't put RCS strings in patches. CVS will mangle them when we put the files into the ports tree, and when we check them out again, they will come out different and the patch will fail. RCS strings are surrounded by dollar (`<tt>$</tt>') signs, and typically start with `<tt>$Id</tt>' or `<tt>$RCS</tt>'. <sect2> <heading>Recursive diff</heading> <p>Using the recurse (`<tt>-r</tt>') option to <tt>diff</tt> to generate patches is fine, but please take a look at the resulting patches to make sure you don't have any unnecessary junk in there. In particular, diffs between two backup files, Makefiles when the port uses imake or GNU configure, etc., are unnecessary and should be deleted. Also, if you had to delete a file, then you can do it in the <tt>post-extract</tt> target rather than as part of the patch. <sect2> <heading>PREFIX</heading> <p>Do try to make your port install relative to <tt>${PREFIX}</tt> in your Makefiles. This will normally be set to <tt>/usr/local</tt>, or <tt>/usr/X11R6</tt> if <tt>${USE_IMAKE}</tt> or <tt>${USE_X11}</tt> is set, though it can be reassigned in your Makefile or in the users environment, if need be. <p>Not hard-coding <tt>/usr/local</tt> anywhere in your installation will make the port much more flexible and cater to the needs of other sites. Note that this doesn't count for package `packing list' files since they have their own scheme for relocating themselves and can be left independent of <tt>${PREFIX}</tt> unless the package is one that hard-codes itself to a compiled-in location. <sect2> <heading>Subdirectories</heading> <p>Try to let the port put things in the right subdirectories of <tt>${PREFIX}</tt>. Some ports lump everything and put it in the subdirectory with the port's name, which is incorrect. Also, many ports put everything except binaries, header files and manual pages in the a subdirectory of `<tt>lib</tt>', which does not bode well with the BSD paradigm. Many of the files should me moved to one of the following: `<tt>etc</tt>' (setup/configuration files), `<tt>libexec</tt>' (executables started internally), `<tt>sbin</tt>' (executables for superusers/managers) or `<tt>share</tt>' (architecture independent files). See <tt>hier(7)</tt> for details, the rule governing <tt>/usr</tt> pretty much applies to <tt>/usr/local</tt> too. <sect2> <heading>ldconfig</heading> <p>If your port installs a shared library, add a <tt>post-install</tt> target to your Makefile that runs `<tt>/sbin/ldconfig -m</tt>' on the directory where the new library is installed (usually <tt>${PREFIX}/lib</tt>) to register it into the shared library cache. <p>Also, add an <tt>@exec</tt> line to your <tt>pkg/PLIST</tt> file so that a user who installed the package can start using the shared library immediately. This line should immediately follow the line for the shared library itself, as in: <tscreen><verb> lib/libtcl.so.7.3 @exec /sbin/ldconfig -m %D/lib </verb></tscreen> <p>Note: the `-m' option is new since 2.0.5 and 2.1.0-950726-SNAP, so don't be alarmed if it doesn't work on your machine. <p>Never, ever, <em>ever</em> add a line that says `<tt>ldconfig</tt>' without any arguments to your Makefile or pkg/PLIST. This will reset the shared library cache to the contents of <tt>/usr/lib</tt> only, and will royally screw up the user's machine ("Help, xinit doesn't run anymore after I install this port!"). Anybody who does this will be shot and cut into 65,536 pieces by a rusty knife and have his liver chopped out by a bunch of crows and will eternally rot to death in the deepest bowels of hell (not necessarily in that order).... <sect2> <heading>If you are stuck....</heading> <p>Do look at existing examples and the <tt>bsd.port.mk</tt> file before asking us questions! <tt>;)</tt> <p>Do ask us questions if you have any trouble! Don't just beat your head against a wall! <tt>:)</tt> <sect1> <heading>A Sample Makefile</heading> <p>Here is a sample Makefile that you can use to create a new port. Make sure you remove all the extra comments (ones between brackets)! <p>It is recommended that you follow this format (ordering of variables, etc.). Not all of the existing Makefiles are in this format (mostly old ones), but we are trying to uniformize how they look. This format is designed so that the most important information is easy to locate. <tscreen><verb> -[the header...just to make it easier for us to identify the ports] -# New ports collection makefile for: xdvi -# Version required: 2.2 [things like "1.5alpha" are fine here too] -# Date created: 26 May 1995 -[this is the person who did the original port to FreeBSD, in particular, the - person who wrote this Makefile] -# Whom: Satoshi Asami <asami@FreeBSD.ORG> -# -# $Id: porting.sgml,v 1.6 1995-10-03 07:11:51 asami Exp $ -[ ^^^^ don't worry about this...it will be automatically filled in by CVS when - it is committed to our repository] -# - -[section to describe the package itself and main ftp site - DISTNAME - is always first, followed by PKGNAME (if necessary), CATEGORIES, - KEYWORDs (if necessary) and then MASTER_SITES, and optionally - EXTRACT_SUFX or DISTFILES] -DISTNAME= xdvi -PKGNAME= xdvi-pl18 -CATEGORIES+= printing -[don't forget the trailing slash ("/")!] -MASTER_SITES= ftp://crl.dec.com/pub/X11/contrib/applications/ -[set this if the source is not in the standard ".tar.gz" form] -EXTRACT_SUFX= .tar.Z - -[section for distributed patches -- can be empty] -PATCH_SITES= ftp://ftp.sra.co.jp/pub/X11/japanese/ -PATCHFILES= xdvi-18.patch1.gz xdvi-18.patch2.gz - -[maintainer; *mandatory*! This is the person (preferably with commit - privileges) who a user can contact for questions and bug reports - this - person should be the porter or someone who can forward questions to the - original porter reasonably promptly. If you really don't want to have your - address here, set it to "ports@FreeBSD.ORG".] -MAINTAINER= asami@FreeBSD.ORG - -[dependencies -- can be empty] -RUN_DEPENDS= gs:${PORTSDIR}/print/ghostscript -LIB_DEPENDS= Xpm\\.4\\.:${PORTSDIR}/graphics/xpm - -[this section is for other standard bsd.port.mk variables that don't belong to - any of the above] -[If it extracts to a directory other than ${DISTNAME}...] -WRKSRC= ${WRKDIR}/xdvi-new -[If it asks questions during configure, build, install...] -IS_INTERACTIVE= yes -[If it requires "configure" in the distributed source directory to be run...] -HAS_CONFIGURE= yes -[If it requires GNU make, not /usr/bin/make, to build...] -USE_GMAKE= yes -[If it is an X application and requires "xmkmf -a" to be run...] -USE_IMAKE= yes -[et cetera.] - -[non-standard variables to be used in the rules below] -MY_FAVORITE_RESPONSE= "yeah, right" - -[then the special rules, in the order they are called] -pre-fetch: - i go fetch something, yeah - -post-patch: - i need to do something after patch, great - -pre-install: - and then some more stuff before installing, wow - -[and then the epilogue] -.include <bsd.port.mk> + [the header...just to make it easier for us to identify the ports] + # New ports collection makefile for: xdvi + # Version required: 2.2 [things like "1.5alpha" are fine here too] + # Date created: 26 May 1995 + [this is the person who did the original port to FreeBSD, in particular, the + person who wrote this Makefile] + # Whom: Satoshi Asami <asami@FreeBSD.ORG> + # + # $Id: porting.sgml,v 1.7 1995-10-07 04:31:35 jfieber Exp $ + [ ^^^^ don't worry about this...it will be automatically filled in by CVS when + it is committed to our repository] + # + + [section to describe the package itself and main ftp site - DISTNAME + is always first, followed by PKGNAME (if necessary), CATEGORIES, + KEYWORDs (if necessary) and then MASTER_SITES, and optionally + EXTRACT_SUFX or DISTFILES] + DISTNAME= xdvi + PKGNAME= xdvi-pl18 + CATEGORIES+= printing + [don't forget the trailing slash ("/")!] + MASTER_SITES= ftp://crl.dec.com/pub/X11/contrib/applications/ + [set this if the source is not in the standard ".tar.gz" form] + EXTRACT_SUFX= .tar.Z + + [section for distributed patches -- can be empty] + PATCH_SITES= ftp://ftp.sra.co.jp/pub/X11/japanese/ + PATCHFILES= xdvi-18.patch1.gz xdvi-18.patch2.gz + + [maintainer; *mandatory*! This is the person (preferably with commit + privileges) who a user can contact for questions and bug reports - this + person should be the porter or someone who can forward questions to the + original porter reasonably promptly. If you really don't want to have your + address here, set it to "ports@FreeBSD.ORG".] + MAINTAINER= asami@FreeBSD.ORG + + [dependencies -- can be empty] + RUN_DEPENDS= gs:${PORTSDIR}/print/ghostscript + LIB_DEPENDS= Xpm\\.4\\.:${PORTSDIR}/graphics/xpm + + [this section is for other standard bsd.port.mk variables that don't belong to + any of the above] + [If it extracts to a directory other than ${DISTNAME}...] + WRKSRC= ${WRKDIR}/xdvi-new + [If it asks questions during configure, build, install...] + IS_INTERACTIVE= yes + [If it requires "configure" in the distributed source directory to be run...] + HAS_CONFIGURE= yes + [If it requires GNU make, not /usr/bin/make, to build...] + USE_GMAKE= yes + [If it is an X application and requires "xmkmf -a" to be run...] + USE_IMAKE= yes + [et cetera.] + + [non-standard variables to be used in the rules below] + MY_FAVORITE_RESPONSE= "yeah, right" + + [then the special rules, in the order they are called] + pre-fetch: + i go fetch something, yeah + + post-patch: + i need to do something after patch, great + + pre-install: + and then some more stuff before installing, wow + + [and then the epilogue] + .include <bsd.port.mk> </verb></tscreen> <sect1> <heading>Package Names</heading> <p>The following are the conventions you should follow in naming your packages. This is to have our package directory easy to scan, as there are already lots and lots of packages and users are going to turn away if they hurt their eyes! <p>If your <tt>${DISTNAME}</tt> does not look like `<tt><name>-<version.string.numbers></tt>', set <tt>${PKGNAME}</tt> to something in that format. <enum> <item>The `<tt><name></tt>' part should be all lowercases, except for a really large package (with lots of programs in it). Things like XFree86 (yes there really is a package of it, check it out) and ImageMagick fall into this category. Otherwise, convert the name (or at least the first letter) to lowercase. If the software in question really is called that way, you can have numbers, hyphens and underscores in the name too. <item>The version string should be a period-separated list of integers and single lowercase alphabets. The only exception is the string `pl' (meaning `patchlevel'), which can be used <em>only</em> when there are no major and minor version numbers in the software. </enum> <p>Here are some (real) examples on how to convert a <tt>${DISTNAME}</tt> into a suitable <tt>${PKGNAME}</tt>: <tscreen><verb> DISTNAME PKGNAME Reason mule-2.2.2 mule-2.2.2 no prob at all XFree86-3.1.2 XFree86-3.1.2 ditto EmiClock-1.0.2 emiclock-1.0.2 no uppercase names for single programs gmod1.4 gmod-1.4 need hyphen after `<name>' xmris.4.02 xmris-4.02 ditto rdist-1.3alpha rdist-1.3a no strings like `alpha' allowed es-0.9-beta1 es-0.9b1 ditto v3.3beta021.src jpeg-5a what the heck was that anyway? ;) tvtwm tvtwm-pl11 version string always required piewm piewm-1.0 ditto xvgr-2.10pl1 xvgr-2.10.1 `pl' allowed only when no maj/minor numbers </verb></tscreen> <p>If there is absolutely no trace of version information in the original source and it is unlikely that the original author will ever release another version, just set the version string to `1.0' (like the piewm example above). Otherwise, ask the original author or use the date string (`yy.mm.dd') as the version. <sect1> <heading>That's It, Folks!</heading> <p>Boy, this sure was a long tutorial, wasn't it? Thanks for following us to here, really. <p>Well, now that you know how to do a port, let's go at it and convert everything in the world into ports! That is the easiest way to start contributing to the FreeBSD Project! <tt>:)</tt> diff --git a/handbook/relnotes.sgml b/handbook/relnotes.sgml index cdbf62a324..7ee06b8978 100644 --- a/handbook/relnotes.sgml +++ b/handbook/relnotes.sgml @@ -1,503 +1,503 @@ -<!-- $Id: relnotes.sgml,v 1.4 1995-08-29 01:42:43 jfieber Exp $ --> +<!-- $Id: relnotes.sgml,v 1.5 1995-10-07 04:31:38 jfieber Exp $ --> <!-- The FreeBSD Documentation Project --> <!-- <!DOCTYPE linuxdoc PUBLIC '-//FreeBSD//DTD linuxdoc//EN'> <linuxdoc><book><chapt>foo --> <sect><heading>About this release<label id="relnotes"></heading> <p>Since our first release of FreeBSD 1.0 nearly two years ago, FreeBSD has changed dramatically. Since release 2.0, FreeBSD has been based on the Berkeley BSD 4.4-lite code rather than the Net2 code used for previous versions. In addition to clearing the legal issues that surrounded the Net2 code, the port to 4.4 has also brought in numerous new features, filesystems and enhanced driver support. Since our release of FreeBSD 2.0 in November of 1994, the performance, feature set, and stability of FreeBSD has improved dramatically. The largest change is a revamped Virtual Memory (VM) system with a merged virtual memory and file buffer cache. This increases performance while reducing FreeBSD's memory footprint, making a system with 4 megabytes of RAM a more acceptable minimum. Other enhancements include full NIS client and server support, transaction TCP support, dial on demand PPP, an improved SCSI subsystem, early support for ISDN, support for FDDI and 100Mbit Fast Ethernet adapters, improved support for the Adaptec 2940 and hundreds of bug fixes. We've also taken the comments and suggestions of many of our users to heart and have attempted to provide what we hope is a more sane and easily understood installation process. Your feedback on this constantly evolving process is especially welcome! In addition to the base distributions, FreeBSD offers a new ported software collection with some 270 commonly sought-after programs. The list of ports ranges from World Wide Web (http) servers, to games, languages, editors and almost everything in between. The entire ports collection requires only 10MB of storage because each port contains only the changes required for the source code to compile on FreeBSD and the information necessary to automatically retrieve the original sources. The original distribution for each port you build is automatically retrieved off of CD-ROM or a via anonymous ftp, so you need only enough disk space to build the ports you want. Each port is also provided as a pre-compiled package which can be installed with the <tt>pkg_add(1)</tt> command for those who do not wish to compile their own ports from source. See <ref id="ports" name="The Ports Collection"> for a more complete description. <!-- XXX make xref For a list of contributors and a general project description, please see the file "CONTRIB.FreeBSD" which should be bundled with your binary distribution. Also see the "REGISTER.FreeBSD" file for information on registering with the "Free BSD user counter". This counter is for ALL freely available variants of BSD, not just FreeBSD, and we urge you to register yourself with it. --> The core of FreeBSD does not contain DES code which would inhibit its being exported outside the United States. An add-on package, for use only in the United States, contains the programs that normally use DES. The auxiliary packages provided separately can be used by anyone. A freely exportable European distribution of DES for our non-U.S. users also exists and is described in the <url url="http://www.freebsd.org/How/faq" name="FreeBSD FAQ">. If password security for FreeBSD is all you need, and you have no requirement for copying encrypted passwords from other hosts using DES into FreeBSD password entries, then FreeBSD's MD5 based security may be all you require. We feel that our default security model is more than a match for DES, and without any messy export issues to deal with. FreeBSD 2.0.5 represents the culmination of 2 years of work and many thousands of man hours put in by an international development team. We hope you enjoy it! <sect1><heading>New feature highlights</heading> <p>The following features were added or substantially improved between the release of 2.0 and this 2.0.5 release. In order to facilitate better communication, the person, or persons, responsible for each enhancement is noted. Any questions regarding the new functionality should be directed to them first. <sect2><heading>Kernel</heading> <p> <descrip> <tag>Merged VM-File Buffer Cache</tag> A merged VM/buffer cache design greatly enhances overall system performance and makes it possible to do a number of more optimal memory allocation strategies that were not possible before. Owner: David Greenman (davidg@FreeBSD.org) and John Dyson (dyson@implode.root.com) <tag>Network PCB hash optimization</tag> For systems with a great number of active TCP connections (WEB and ftp servers, for example), this greatly speeds up the lookup time required to match an incoming packet up to its associated connection. Owner: David Greenman (davidg@FreeBSD.org) <tag>Name cache optimization</tag> The name-cache would cache all files of the same name to the same bucket, which would put for instance all ".." entries in the same bucket. We added the parent directory version to frustrate the hash, and improved the management of the cache in various other ways while we were at it. Owner: Poul-Henning Kamp (phk@FreeBSD.org) David Greenman (davidg@FreeBSD.org) <tag>Less restrictive swap-spaces</tag> The need to compile the names of the swap devices into the kernel has been removed. Now <tt>swapon(8)</tt> will accept any block devices, up to the maximum number of swap devices configured in the kernel. Owner: Poul-Henning Kamp (phk@FreeBSD.org) David Greenman (davidg@FreeBSD.org) <tag>Hard Wired SCSI Devices</tag> Prior to 2.0.5, FreeBSD performed dynamic assignment of unit numbers to SCSI devices as they were probed, allowing a SCSI device failure to possibly change unit number assignment. This could cause filesystems other disks in the system to be incorrectly mounted, or not mounted at all. Hard wiring allows static allocation of unit numbers (and hence device names) to scsi devices based on SCSI ID and bus. SCSI configuration occurs in the kernel config file. Samples of the configuration syntax can be found in the <tt>scsi(4)</tt> man page or the LINT kernel config file. Owner: Peter Dufault (dufault@hda.com) Sources involved: <tt>sys/scsi/*</tt> <tt>usr.sbin/config/*</tt> <tag>Slice Support</tag> FreeBSD now supports a <em>slice</em> abstraction which enhances FreeBSD's ability to share disks with other operating systems. This support will allow FreeBSD to inhabit DOS extended partitions. Owner: Bruce Evans (bde@FreeBSD.org) Sources involved: <tt>sys/disklabel.h</tt> <tt>sys/diskslice.h</tt> <tt>sys/dkbad.h</tt> <tt>kern/subr_diskslice.c</tt> <tt>kern/subr_dkbad.c</tt> <tt>i386/isa/diskslice_machdep.c</tt> <tt>i386/isa/wd.c</tt> <tt>scsi/sd.c</tt> <tt>dev/vn/vn.c</tt> - <tag>Support for Ontrack Disk Manager Version - 6.0</tag> Support has been added for disks + <tag>Support for Ontrack Disk Manager Version 6.0</tag> + Support has been added for disks which use Ontrack Disk Manager. The fdisk program does <em>not</em> know about it however, so make all changes using the install program on the boot.flp or the Ontrack Disk Manager tool under MS-DOS. Owner: Poul-Henning Kamp (phk@FreeBSD.org) <tag>Bad144 is back and working</tag> Bad144 works again, though the semantics are slightly different than before in that the bad-spots are kept relative to the slice rather than absolute on the disk. Owner: Bruce Evans (bde@FreeBSD.org) Poul-Henning Kamp (phk@FreeBSD.org) </descrip> <sect2><heading>New device support</heading> <sect3><heading>SCSI and CDROM devices</heading> <p><descrip> - <tag>Matsushita/Panasonic (Creative) CD-ROM - driver</tag> The Matsushita/Panasonic CR-562 and + <tag>Matsushita/Panasonic (Creative) CD-ROM driver</tag> + The Matsushita/Panasonic CR-562 and CR-563 drives are now supported when connected to a Sound Blaster or 100% compatible host adapter. Up to four host adapters are supported for a total of 16 CD-ROM drives. The audio functions are supported with the Karoke variable speed playback. Owner: Frank Durda IV (bsdmail@nemesis.lonestar.org) Sources involved: <tt>isa/matcd</tt> <tag>Adaptec 2742/2842/2940 SCSI driver</tag> The original 274x/284x driver has evolved considerably since the 2.0 release of FreeBSD. We now offer full support for the 2940 series as well as the Wide models of these cards. The arbitration bug that caused problems with fast devices has been corrected and <em>experimental</em> tagged queuing support has been added (kernel option <tt>AHC_TAGENABLE</tt>). John Aycock has also released the sequencer code under a Berkeley style copyright making the driver entirely clean of the GPL. Owner: Justin Gibbs (gibbs@FreeBSD.org) Sources involved: <tt>isa/aic7770.c</tt> <tt>pci/aic7870.c</tt> <tt>i386/scsi/*</tt> <tt>sys/dev/aic7xxx/*</tt> - <tag>NCR5380/NCR53400 SCSI (ProAudio Spectrum) - driver</tag> Owner: core + <tag>NCR5380/NCR53400 SCSI (ProAudio Spectrum) driver</tag> + Owner: core Submitted by: Serge Vakulenko (vak@cronyx.ru) Sources involved: <tt>isa/ncr5380.c</tt> <tag>Sony CDROM driver</tag> Owner: core Submitted by: Mikael Hybsch (micke@dynas.se) Sources involved: <tt>isa/scd.c</tt> </descrip> <sect3><heading>Serial devices</heading> <p><descrip> - <tag>SDL Communications Riscom/8 Serial Board - Driver</tag> Owner: Andrey Chernov + <tag>SDL Communications Riscom/8 Serial Board Driver</tag> + Owner: Andrey Chernov (ache@FreeBSD.org) Sources involved: <tt>isa/rc.c</tt> <tt>isa/rcreg.h</tt> <tag>Cyclades Cyclom-y Serial Board Driver</tag> Owner: Bruce Evans (bde@FreeBSD.org) Submitted by: Andrew Werple (andrew@werple.apana.org.au) and Heikki Suonsivu (hsu@cs.hut.fi) Obtained from: NetBSD Sources involved: <tt>isa/cy.c</tt> <tag>Cronyx/Sigma sync/async serial driver</tag> Owner: core Submitted by: Serge Vakulenko Sources involved: <tt>isa/cronyx.c</tt> </descrip> <sect2><heading>Networking</heading> <p><descrip> <tag>Diskless booting</tag> Diskless booting in 2.0.5 is much improved over previous releases. The boot program is in <tt>src/sys/i386/boot/netboot</tt>, and can be run from an MS-DOS system or burned into an EPROM. WD, SMC, 3COM and Novell ethernet cards are currently supported. Local swapping is also supported. <tag>DEC DC21140 Fast Ethernet driver</tag> This driver supports any of the numerous NICs using the DC21140 chipset including the 100Mb DEC DE-500-XA and SMC 9332. Owner: core Submitted by: Matt Thomas (thomas@lkg.dec.com) Sources involved: <tt>pci/if_de.c</tt> <tt>pci/dc21040.h</tt> <tag>DEC FDDI (DEFPA/DEFEA) driver</tag> Owner: core Submitted by: Matt Thomas (thomas@lkg.dec.com) Sources involved: <tt>pci/if_pdq.c</tt> <tt>pci/pdq.c</tt> <tt>pci/pdq_os.h</tt> <tt>pci/pdqreg.h</tt> <tag>3Com 3c505 (Etherlink/+) NIC driver</tag> Owner: core Submitted by: Dean Huxley (dean@fsa.ca) Obtained from: NetBSD Sources involved: <tt>isa/if_eg.c</tt> <tag>Fujitsu MB86960A family of NICs driver</tag> Owner: core Submitted by: M.S. (seki@sysrap.cs.fujitsu.co.jp) Sources involved: <tt>isa/if_fe.c</tt> <tag>Intel EtherExpress driver</tag> Owner: Rodney W. Grimes (rgrimes@FreeBSD.org) Sources involved: <tt>isa/if_ix.c</tt> <tt>isa/if_ixreg.h</tt> <tag>3Com 3c589 driver</tag> Owner: core Submitted by: "HOSOKAWA Tatsumi" (hosokawa@mt.cs.keio.ac.jp), Seiji Murata (seiji@mt.cs.keio.ac.jp) and Noriyuki Takahashi (hor@aecl.ntt.jp) Sources involved: <tt>isa/if_zp.c</tt> <tag>IBM Credit Card Adapter driver</tag> Owner: core Submitted by: "HOSOKAWA Tatsumi" (hosokawa@mt.cs.keio.ac.jp), Sources involved: <tt>isa/pcic.c</tt> <tt>isa/pcic.h</tt> <tag>EDSS1 and 1TR6 ISDN interface driver</tag> Owner: core Submitted by: Dietmar Friede (dfriede@drnhh.neuhaus.de) and Juergen Krause (jkr@saarlink.de) Sources involved: <tt>gnu/isdn/*</tt> </descrip> <sect2><heading>Miscellaneous drivers</heading> <p><descrip> <tag>Joystick driver</tag> Owner: Jean-Marc Zucconi (jmz@FreeBSD.org) Sources involved: <tt>isa/joy.c</tt> - <tag>National Instruments "LabPC" driver</tag> Owner: + <tag>National Instruments ``LabPC'' driver</tag> Owner: Peter Dufault (dufault@hda.com) Sources involved: <tt>isa/labpc.c</tt> <tag>WD7000 driver</tag> Owner: Olof Johansson (offe@ludd.luth.se) <tag>Pcvt Console driver</tag> Owner: Joerg Wunsch (joerg@FreeBSD.org) Submitted by: Hellmuth Michaelis (hm@altona.hamburg.com) Sources involved: <tt>isa/pcvt/*</tt> <tag>BSD-audio emulator for VAT driver</tag> Owner: Amancio Hasty (ahasty@FreeBSD.org) and Paul Traina (pst@FreeBSD.org) Sources involved: <tt>isa/sound/vat_audio.c</tt> <tt>isa/sound/vat_audioio.h</tt> - <tag>National Instruments AT-GPIB and AT-GPIB/TNT - GPIB driver</tag> Owner: core + <tag>National Instruments AT-GPIB and AT-GPIB/TNT GPIB driver</tag> + Owner: core Submitted by: Fred Cawthorne (fcawth@delphi.umd.edu) Sources involved: <tt>isa/gpib.c</tt> <tt>isa/gpib.h</tt> <tt>isa/gpibreg.h</tt> <tag>Genius GS-4500 hand scanner driver</tag> Owner: core Submitted by: Gunther Schadow (gusw@fub46.zedat.fu-berlin.de) Sources involved: <tt>isa/gsc.c</tt> <tt>isa/gscreg.h</tt> <tag>CORTEX-I Frame Grabber</tag> Owner: core Submitted by: Paul S. LaFollette, Jr. ( Sources involved: <tt>isa/ctx.c</tt> <tt>isa/ctxreg.h</tt> <tag>Video Spigot video capture card</tag> Owner: Jim Lowe </descrip> <sect1><heading>Experimental features</heading> <p><descrip> <tag>UNIONFS and LFS</tag> The unionfs and LFS file systems are known to be severely broken in FreeBSD 2.0.5. This is in part due to old bugs that we haven't had time to resolve yet and the need to update these file systems to deal with the new VM system. We hope to address these issues in a later release of FreeBSD. <tag>iBCS2 Support</tag> FreeBSD now supports running iBCS2 compatible binaries. Currently SCO UNIX 3.2.2 and 3.2.4, and ISC 2.2 COFF are supported. The iBCS2 emulator is in its early stages and has not been extensively tested, but it is functional. Most of SCO's 3.2.2 binaries work, as does an old INFORMIX-2.10 for SCO. Further testing is nessesary to complete this project. There is also work under way for ELF and XOUT loaders, and most of the svr4 syscall wrappers are written. Owner: Soren Schmidt (sos) and Sean Eric Fagan (sef) Sources involved: <tt>sys/i386/ibcs2/*</tt> and misc kernel changes. </descrip> <!-- <sect1><heading>Reporting problems, making suggestions, submitting code</heading> <p>Your suggestions, bug reports and contributions of code are always valued - please do not hesitate to report any problems you may find (preferably with a fix attached if you can!). The preferred method to submit bug reports from a machine with internet mail connectivity is to use the send-pr command. Bug reports will be dutifully filed by our faithful bugfiler program and you can be sure that we'll do our best to respond to all reported bugs as soon as possible. If, for some reason, you are unable to use the send-pr command to submit a bug report, you can try to send it to: <tscreen>bugs@FreeBSD.org</tscreen> Otherwise, for any questions or suggestions, please send mail to: <tscreen>questions@FreeBSD.org</tscreen> Additionally, being a volunteer effort, we are always happy to have extra hands willing to help - there are already far more enhancements to be done than we can ever manage to do by ourselves! To contact us on technical matters, or with offers of help, you may send mail to: <tscreen>hackers@FreeBSD.org</tscreen> Since these mailing lists can experience significant amounts of traffic, if you have slow or expensive mail access and you are only interested in keeping up with significant FreeBSD events, you may find it preferable to subscribe to: <tscreen>announce@FreeBSD.org</tscreen> All but the freebsd-bugs groups can be freely joined by anyone wishing to do so. Send mail to MajorDomo@FreeBSD.org and include the keyword `help' on a line by itself somewhere in the body of the message. This will give you more information on joining the various lists, accessing archives, etc. There are a number of mailing lists targeted at special interest groups not mentioned here, so send mail to majordomo and ask about them! --> diff --git a/handbook/routing.sgml b/handbook/routing.sgml new file mode 100644 index 0000000000..19f6643c2e --- /dev/null +++ b/handbook/routing.sgml @@ -0,0 +1,279 @@ +<!-- $Id: routing.sgml,v 1.1 1995-10-07 04:31:41 jfieber Exp $ --> +<!-- The FreeBSD Documentation Project --> +<!-- <!DOCTYPE linuxdoc PUBLIC '-//FreeBSD//DTD linuxdoc//EN'> --> + + <sect><heading>Gateways and routes<label id="routing"></heading> + + <p><em>Contributed by &a.gryphon;.<newline>6 October 1995.</em> + + For one machine to be able to find another, there must be a + mechanism in place to describe how to get from one to the + other. This is called Routing. A ``route'' is a defined + pair of addresses: a <bf>destination</bf> and a + <bf>gateway</bf>. The pair indicates that if you are + trying to get to this <em>destination</em>, send along + through this <em>gateway</em>. There are three types of + destinations: individual hosts, subnets, and ``default''. The + ``default route'' is used if none of the other routes + apply. We will talk a little bit more about default routes + later on. There are also three types of gateways: + individual hosts, interfaces (also called ``links''), and + ethernet hardware addresses. + + <sect1><heading>An example</heading> + + <p>To illustrate different aspects of routing, we will use + the following example which is the output of the command + <tt>netstat -r</tt>: + +<tscreen><verb> +Destination Gateway Flags Refs Use Netif Expire + +default outside-gw UGSc 37 418 ppp0 +localhost localhost UH 0 181 lo0 +test0 0:e0:b5:36:cf:4f UHLW 5 63288 ed0 77 +10.20.30.255 link#1 UHLW 1 2421 +foobar.com link#1 UC 0 0 +host1 0:e0:a8:37:8:1e UHLW 3 4601 lo0 +host2 0:e0:a8:37:8:1e UHLW 0 5 lo0 => +host2.foobar.com link#1 UC 0 0 +224 link#1 UC 0 0 +</verb></tscreen> + + The first two lines specify the default route (which we + will cover in the next section) and the <tt>localhost</tt> route. + + The interface (<tt>Netif</tt> column) that it specifies to use + for <tt>localhost</tt> is <tt>lo0</tt>, also known as the + loopback device. This says to keep all traffic for this + destination internal, rather than sending it out over the + LAN, since it will only end up back where it started + anyway. + + The next thing that stands out are the + ``<tt>0:e0:...</tt>'' addresses. These are ethernet + hardware addresses. FreeBSD will automatically identify any + hosts (<tt>test0</tt> in the example) on the local ethernet and + add a route for that host, directly to it over the ethernet + interface, <tt>ed0</tt>. There is also a timeout + (<tt>Expire</tt> column) associated with this type of route, + which is used if we fail to hear from the host in a + specific amount of time. In this case the route will be + automatically deleted. These hosts are identified using a + mechanism known as RIP (Routing Information Protocol), + which figures out routes to local hosts based upon a + shortest path determination. + + FreeBSD will also add subnet routes for the local subnet + (<tt>10.20.30.255</tt> is the broadcast address for the subnet + <tt>10.20.30</tt>, and <tt>foobar.com</tt> is the domain name + associated with that subnet). The designation <tt>link#1</tt> + refers to the first ethernet card in the machine. You'll + notice no additional interface is specified for those. + + Both of these groups (local network hosts and local + subnets) have their routes automatically configured by a + daemon called <tt>routed</tt>. If this is not run, then only + routes which are statically defined (ie. entered + explicitly) will exist. + + The <tt>host1</tt> line refers to our host, which it knows by + ethernet address. Since we are the sending host, FreeBSD + knows to use the loopback interface (<tt>lo0</tt>) rather than + sending it out over the ethernet interface. + + The two <tt>host2</tt> lines are an example of what happens + when we use an ifconfig alias (see the section of ethernet + for reasons why we would do this). The <tt>=></tt> + symbol after the <tt>lo0</tt> interface says that not only are + we using the loopback (since this is address also refers to + the local host), but specifically it is an alias. Such + routes only show up on the host that supports the alias; + all other hosts on the local network will simply have a + <tt>link#1</tt> line for such. + + The final line (destination subnet <tt>224</tt>) deals with + MultiCasting, which will be covered in a another section. + + The other column that we should talk about are the + <tt>Flags</tt>. Each route has different attributes that are + described in the column. Below is a short table of some of + these flags and their meanings: + + <descrip> + + <tag/U/ <bf/Up:/ The route is active. + + <tag/H/ <bf/Host:/ The route destination is a single host. + + <tag/G/ <bf/Gateway:/ Send anything for this destination + on to this remote system, which will figure out from + there where to send it. + + <tag/S/ <bf/Static:/ This route was configured manually, + not automatically generated by the system. + + <tag/C/ <bf/Clone:/ Generates a new route based upon this + route for machines we connect to. This type of route is + normally used for local networks. + + <tag/W/ <bf/WasCloned/ Indicated a route that was + auto-configured based upon a local area network (Clone) + route. + + <tag/L/ <bf/Link:/ Route involves references to ethernet + hardware. + + </descrip> + + + <sect1><heading>Default routes</heading> + + <p>When the local system needs to make a connection to + remote host, it checks the routing table to determine if + a known path exists. If the remote host falls into a + subnet that we know how to reach (Cloned routes), then + the system checks to see if it can connect along that + interface. + + If all known paths fail, the system has one last option: + the <bf>default</bf> route. This route is a special type + of gateway route (usually the only one present in the + system), and is always marked with a ``<tt>c</tt>'' in + the flags field. For hosts on a local area network, this + gateway is set to whatever machine has a direct + connection to the outside world (whether via PPP link, or + your hardware device attached to a dedicated data line). + + If you are configuring the default route for a machine + which itself is functioning as the gateway to the outside + world, then the default route will be the gateway machine + at your Internet Service Provider's (ISP) site. + + Let's look at an example of default routes. This is a + common configuration: +<tscreen><verb> +[Local2] <--ether--> [Local1] <--PPP--> [ISP-Serv] <--ether--> [T1-GW] +</verb></tscreen> + + The hosts <tt>Local1</tt> and <tt>Local2</tt> are at your + site, with the formed being your PPP connection to your + ISP's Terminal Server. Your ISP has a local network at + their site, which has, among other things, the server + where you connect and a hardware device (T1-GW) attached + to the ISP's internet feed. + + The default routes for each of your machines will be: + +<tscreen><verb> +host default gateway interface +---- --------------- --------- +Local2 Local1 ethernet +Local1 T1-GW PPP +</verb></tscreen> + + A common question is ``Why (or how) would we set the + T1-GW to be the default gateway for Local1, rather than + the ISP server it is connected to?''. + + Remember, since the PPP interface is using an address on + the ISP's local network for your side of the connection, + routes for any other machines on the ISP's local network + will be automatically generated. Hence, you will already + know how to reach the T1-GW machine, so there is no need + for the intermediate step of sending traffic to the ISP + server. + + As a final note, it is common to use the address ``<tt>...1</tt>'' + as the gateway address for your local network. So (using + the same example), if your local class-C address space + was <tt>10.20.30</tt> and your ISP was using <tt>10.9.9</tt> then the + default routes would be: + +<tscreen><verb> +Local2 (10.20.30.2) --> Local1 (10.20.30.1) +Local1 (10.20.30.1, 10.9.9.30) --> T1-GW (10.9.9.1) +</verb></tscreen> + + <sect1><heading>Dual homed hosts</heading> + + <p>There is one other type of configuration that we should + cover, and that is a host that sits on two different + networks. Technically, any machine functioning as a + gateway (in the example above, using a PPP connection) + counts as a dual-homed host. But the term is really only + used to refer to a machine that sits on two local-area + networks. + + In one case, the machine as two ethernet cards, each + having an address on the seperate subnets. Alternately, + the machine may only have one ethernet card, and be using + ifconfig aliasing. The former is used if two physically + separate ethernet networks are in use, the latter if + there is one physical network segment, but two logically + seperate subnets. + + Either way, routing tables are set up so that each subnet + knows that this machine is the defined gateway (inbound + route) to the other subnet. This configuration, with the + machine acting as a Bridge between the two subnets, is + often used when we need to implement packet filtering or + firewall security in either or both directions. + + <sect1><heading>Routing propogation</heading> + + <p>We have already talked about how we define our routes to + the outside world, but not about how the outside world + finds us. + + We already know that routing tables can be set up so that + all traffic for a particular address space (in our + examples, a class-C subnet) can be sent to a particular + host on that network, which will forward the packets + inbound. + + When you get an address space assigned to your site, your + service provider will set up their routing tables so that + all traffic for your subnet will be sent down your PPP + link to your site. But how do sites across the country + know to send to your ISP? + + There is a system (much like the distributed DNS + information) that keeps track of all assigned + address-spaces, and defines their point of connection to + the Internet Backbone. The ``Backbone'' are the main + trunk lines that carry internet traffic across the + country, and around the world. Each backbone machine has + a copy of a master set of tables, which direct traffic + for a particular network to a specific backbone carrier, + and from there down the chain of service providers until + it reaches your network. + + It is the task of your service provider to advertise to + the backbone sites that they are the point of connection + (and thus the path inward) for your site. This is known + as route propogation. + +<!-- + <sect1><heading>Multicast Routing</heading> +--> + + <sect1><heading>Troubleshooting</heading> + + <p>Sometimes, there is a problem with routing propogation, + and some sites are unable to connect to you. Perhaps the + most useful command for trying to figure out where a + routing is breaking down is the <tt>traceroute(8)</tt> + command. It is equally useful if you cannot seem to make + a connection to a remote machine (ie. <tt>ping(8)</tt> + fails). + + The <tt>traceroute(8)</tt> command is run with the name + of the remote host you are trying to connect to. It will + show the gateway hosts along the path of the attempt, + eventually either reaching the target host, or + terminating because of a lack of connection. + + For more information, see the manual page for + <tt>traceroute(8)</tt>. + diff --git a/handbook/scsi.sgml b/handbook/scsi.sgml index a2b4b57b6d..280483518e 100644 --- a/handbook/scsi.sgml +++ b/handbook/scsi.sgml @@ -1,765 +1,765 @@ -<!-- $Id: scsi.sgml,v 1.5 1995-09-27 00:46:28 jmz Exp $ --> +<!-- $Id: scsi.sgml,v 1.6 1995-10-07 04:31:46 jfieber Exp $ --> <!-- The FreeBSD Documentation Project --> <!-- <title>An introduction to SCSI and its use with FreeBSD (c) 1995, Wilko Bulte, Sun Sep 3 17:14:48 MET DST 1995 Copyright 1995, Wilko C. Bulte, Arnhem, The Netherlands This document attempts to describe the background of SCSI, its (mis)use with FreeBSD and some common pitfalls. --> SCSI -

© 1995, &a.wilko;.3 September 1995. +

Copyright © 1995, &a.wilko;.3 September 1995. SCSI is an acronym for Small Computer Systems Interface. It is an ANSI standard that has become one of the leading I/O buses in the computer industry. The foundation of the SCSI standard was laid by Shugart Associates (the same guys that gave the world the first mini floppy disks) when they introduced the SASI bus (Shugart Associates Standard Interface). After some time an industry effort was started to come to a more strict standard allowing devices from different vendors to work together. This effort was recognized in the ANSI SCSI-1 standard. The SCSI-1 standard (approx 1985) is now more or less obsolete. The current standard is SCSI-2 (see ), with SCSI-3 on the drawing boards. In addition to a physical interconnection standard, SCSI defines a logical (command set) standard to which disk devices must adhere. This standard is called the Common Command Set (CCS) and was developed more or less in parallel with ANSI SCSI-1. SCSI-2 includes the (revised) CCS as part of the standard itself. The commands are dependent on the type of device at hand. It does not make much sense of course to define a Write command for a scanner. The SCSI bus is a parallel bus, which comes in a number of variants. The oldest and most used is an 8 bit wide bus, with single-ended signals, carried on 50 wires. (If you don't know what single-ended means, don't worry, that is what this document is all about.) Modern designs also use 16 bit wide buses, with differential signals. This allows transfer speeds of 20Mbytes/second, on cables lengths of up to 25 meters. SCSI-2 allows a maximum bus width of 32 bits, using an additional cable. Of course the SCSI bus not only has data lines, but also a number of control signals. A very elaborate protocol is part of the standard to allow multiple devices to share the bus in an efficient manner. In SCSI-2, the data is always checked using a separate parity line. In pre-SCSI-2 designs parity was optional. In SCSI-3 even faster bus types are introduced, along with a serial SCSI bus that reduces the cabling overhead and allows a higher maximum bus length. As you could have guessed from the description above, SCSI devices are intelligent. They have to be to adhere to the SCSI standard (which is over 2 inches thick BTW). So, for a hard disk drive for instance you do not specify a head/cylinder/sector to address a particular block, but simply the number of the block you want. Elaborate caching schemes, automatic bad block replacement etc are all made possible by this 'intelligent device' approach. On a SCSI bus, each possible pair of devices can communicate. If their function allows this is another matter, but the standard does not restrict it. To avoid signal contention, the 2 devices have to arbitrate for the bus before using it. The philosophy of SCSI is to have a standard that allows older-standard devices to work with newer-standard ones. So, an old SCSI-1 device should normally work on a SCSI-2 bus. Normally, because it is not absolutely sure that the implementation of an old device follows the (old) standard closely enough to be acceptable on a new bus. Modern devices are usually more well-behaved, because the standardization has become more strict and is better adhered to by the device manufacturers. Generally speaking, the chances of getting a working set of devices on a single bus is better when all the devices are SCSI-2 or newer. This does not imply that you have to dump all your old stuff when you get that shiny 2Gb disk: I own a system on which a pre-SCSI-1 disk, a SCSI-2 QIC tape unit, a SCSI-1 helical scan tape unit and 2 SCSI-1 disks work together quite happily. Components of SCSI

As said before, SCSI devices are smart. The idea is to put the knowledge about intimate hardware details onto the SCSI device itself. In this way, the host system does not have to worry about things like how many heads are hard disks has, or how many tracks there are on a specific tape device. If you are curious, the standard specifies commands with which you can query your devices on their hardware particulars. The advantage of intelligent devices is obvious: the device drivers on the host can be made in a much more generic fashion, there is no longer a need to change (and qualify!) drivers for every odd new device that is introduced. For cabling and connectors there is a golden rule: get good stuff. With bus speeds going up all the time you will save yourself a lot of grief by using good material. So, gold plated connectors, shielded cabling, sturdy connector hoods with strain reliefs etc are the way to go. Second golden rule: don't use cables longer than necessary. I once spent 3 days hunting down a problem with a flaky machine only to discover that shortening the SCSI bus with 1 meter solved the problem. And the original bus length was well within the SCSI specification. SCSI bus types

From an electrical point of view, there are two incompatible bus types: single-ended and differential. This means that there are two different main groups of SCSI devices and controllers, which cannot be mixed on the same bus. It is possible however to use special converter hardware to transform a single-ended bus into a differential one (and vice versa). The differences between the bus types are explained in the next sections. In lots of SCSI related documentation there is a sort of jargon in use to abbreviate the different bus types. A small list: FWD: Fast Wide Differential FND: Fast Narrow Differential SE: Single Ended FN: Fast Narrow etc. With a minor amount of imagination one can usually imagine what is meant. Wide is a bit ambiguous, it can indicate 16 or 32 bit buses. As far as I know, the 32 bit variant is not (yet) in use, so wide normally means 16 bit. Fast means that the timing on the bus is somewhat different, so that on a narrow (8 bit) bus 10 Mbytes/sec are possible instead of 5 Mbytes/sec for 'slow' SCSI. More on this later. It should be noted that the data lines > 8 are only used for data transfers and device addressing. The transfers of commands and status messages etc are only performed on the lowest 8 data lines. The standard allows narrow devices to operate on a wide bus. The usable bus width is negotiated between the devices. You have to watch your device addressing closely when mixing wide and narrow. Single ended buses

A single-ended SCSI bus uses signals that are either 5 Volts or 0 Volts (indeed, TTL levels) and are relative to a COMMON ground reference. A singled ended 8 bit SCSI bus has approximately 25 ground lines, who are all tied to a single - 'rail' on all devices. A standard single ended bus has a + `rail' on all devices. A standard single ended bus has a maximum length of 6 meters. If the same bus is used with fast-SCSI devices, the maximum length allowed drops to 3 meters. Fast-SCSI means that instead of 5Mbytes/sec the bus allows 10Mbytes/sec transfers. Please note that this means that if some devices on your bus use 'fast' to communicate your bus must adhere to the length restrictions for fast buses! It is obvious that with the newer fast-SCSI devices the bus length can become a real bottleneck. This is why the differential SCSI bus was introduced in the SCSI-2 standard. For connector pinning and connector types please refer to the SCSI-2 standard (see ) itself, connectors etc are listed there in painstaking detail. Beware of devices using non-standard cabling. For instance Apple uses a 25pin D-type connecter (like the one on serial ports and parallel printers). Considering that the official SCSI bus needs 50 pins you can imagine the use of this connector needs some 'creative cabling'. The reduction of the number of ground wires they used is a bad idea, you better stick to 50 pins cabling in accordance with the SCSI standard. Differential buses

A differential SCSI bus has a maximum length of 25 meters. Quite a difference from the 3 meters for a single-ended fast-SCSI bus. The idea behind differential signals is that each bus signal has it's own return wire. So, each signal is carried on a (preferably twisted) pair of wires. The voltage difference between these two wires determines whether the signal is asserted or de-asserted. To a certain extent the voltage difference between ground and the signal wire pair is not relevant (don't try 10 kVolts though..). It is beyond the scope of this document to explain why this differential idea is so much better. Just accept that electrically seen the use of differential signals gives a much better noise margin. You will normally find differential buses in use for inter-cabinet connections. Because of the lower cost single ended is mostly used for shorter buses like inside cabinets. There is nothing that stops you from using differential stuff with FreeBSD, as long as you use a controller that has device driver support in FreeBSD. As an example, Adaptec marketed the AH1740 as a single ended board, whereas the AH1744 was differential. The software interface to the host is identical for both. Terminators

Terminators in SCSI terminology are resistor networks that are used to get a correct impedance matching. Impedance matching is important to get clean signals on the bus, without reflections or ringing. If you once made a long distance telephone call on a bad line you probably know what reflections are. With 20Mbytes/sec travelling over your SCSI bus, you don't want signals echoing back. Terminators come in various incarnations, with more or less sophisticated designs. Of course, there are internal and external variants. Almost every SCSI device comes with a number of sockets in which a number of resistor networks can (must be!) installed. If you remove terminators from a device, carefully stock 'm. You will need them when you ever decide to reconfigure your SCSI bus. There is enough variation in even these simple tiny things to make finding the exact replacement a frustrating business. There are also SCSI devices that have a single jumper to enable or disable a built-in terminator. There are special terminators you can stick onto a flat cable bus. Others look like external connectors, so a connector hood without a cable. So, lots of choice as you can see. There is much debate going on if and when you should switch from simple resistor (passive) terminators to active terminators. Active terminators contain more or less elaborate circuits to give more clean bus signals. The general consensus seems to be that the usefulness of active termination increases when you have long buses and/or fast devices. If you ever have problems with your SCSI buses you might consider trying an active terminator. Try to borrow one first, they reputedly are quite expensive. Please keep in mind that terminators for differential and single-ended buses are not identical. You should not mix the two variants. OK, and now where should you install your terminators? This is by far the most misunderstood part of SCSI. And it is by far the simplest.. The rule is: every SCSI bus has 2 (two) terminators, one at each end of the bus. So, two and not one or three or whatever. Do yourself a favour and stick to this rule. It will save you endless grief, because wrong termination has the potential to introduce highly mysterious bugs. A common pitfall is to have an internal (flat)cable in a machine and also an external cable attached to the controller. It seems almost everybody forgets to remove the terminators from the controller. The terminator must now be on the last external device, and not on the controller! In general, every reconfiguration of a SCSI bus must pay attention to this. What I did myself is remove all terminators from my SCSI devices and controllers. I own a couple of external terminators, for both the Centronics-type external cabling and for the internal flat cable connectors. This makes reconfiguration much easier. Terminator power

The terminators discussed in the previous chapter need power to operate properly. On the SCSI bus, a line is dedicated to this purpose. So, simple huh? Not so. Each device can provide it's own terminator power to the terminator sockets it has on-device. But if you have external terminators, or when the device supplying the terminator power to the SCSI bus line is switched off you are in trouble. The idea is that initiators (these are devices that initiate actions on the bus, a discussion follows) must supply terminator power. All SCSI devices are allowed (but not required) to supply terminator power. To allow for switched-off devices on a bus, the terminator power must be supplied to the bus via a diode. This prevents the backflow of current to switched-off devices. To prevent all kinds of nastiness, the terminator power is usually fused. As you can imagine, fuses might blow. This can, but does not have to, lead to a non functional bus. If multiple devices supply terminator power, a single blown fuse will not put you out of business. A single supplier with a blown fuse certainly will. Clever external terminators sometimes have a LED indication that shows whether terminator power is present. In newer designs auto-restoring fuses are used who 'reset' themselves after some time. On modern devices, sometimes integrated terminators are used. These things are special purpose integrated circuits that can be dis/en-abled with a control pin. It is not necessary to physically remove them from a device. You may find them on newer host adapters, sometimes they even are software configurable, using some sort of setup tool. Consult you documentation! Device addressing

Because the SCSI bus is, ehh, a bus there must be a way to distinguish or address the different devices connected to it. This is done by means of the SCSI or target ID. Each device has a unique target ID. You can select the ID to which a device must respond using a set of jumpers, or a dip switch, or something similar. Consult the documentation of your device for more information. Beware of multiple devices configured to use the same ID. Chaos normally reigns in this case. For an 8 bit bus, a maximum of 8 targets is possible. The maximum is 8 because the selection is done bitwise using the 8 data lines on the bus. For wide this increases to the number of data lines. The higher the SCSI target ID, the higher the priority the devices has. When it comes to arbitration between devices that want to use the bus at the same time, the device that has the highest SCSI ID will win. This also means that the SCSI host adapter usually uses target ID 7 (for narrow buses). For a further subdivision, the standard allows for Logical Units or LUNs for short. A single target ID may have multiple LUNs. For example, a tape device including a tape changer may have LUN 0 for the tape device itself, and LUN 1 for the tape changer. In this way, the host system can address each of the parts of the tape unit as desired. Bus layout

SCSI buses are linear. So, not shaped like Y-junctions, star topologies, cobwebs or whatever else people might want to invent. You might notice that the terminator issue discussed earlier becomes rather hairy if your bus is not linear.. The electrical characteristics, it's noise margins and ultimately the reliability of it all are tightly related to linear bus rule. Stick to the linear bus rule! Using SCSI with FreeBSD

About translations, BIOSes and magic...

As stated before, you should first make sure that you have a electrically sound bus. When you want to use a SCSI disk on your PC as boot disk, you must aware of some quirks related to PC BIOSes. The PC BIOS in it's first incarnation used a low level physical interface to the hard disk. So, you had to tell the BIOS (using a setup tool or a BIOS built-in setup) how your disk physically looked like. This involved stating number of heads, number of cylinders, number of sectors per track, obscure things like precompensation and reduced write current cylinder etc. One might be inclined to think that since SCSI disks are smart you can forget about this. Alas, the arcane setup issue is still present today. The system BIOS needs to know how to access your SCSI disk with the head/cyl/sector method. The SCSI host adapter or SCSI controller you have put in your AT/EISA/PCI/whatever bus to connect your disk therefore has it's own on-board BIOS. During system startup, the SCSI BIOS takes over the hard disk interface routines from the system BIOS. To fool the system BIOS, the system setup is normally set to No hard disk present. Obvious, isn't it? The SCSI BIOS itself presents to the system a so called translated drive. This means that a fake drive table is constructed that allows the PC to boot the drive. This translation is often (but not always) done using a pseudo drive with 32 heads and 64 sectors per track. By varying the number of cylinders, the SCSI BIOS adapts to the actual drive size. It is useful to note that 32 * 64 / 2 = the size of your drive in megabytes. The division by 2 is to get from disk blocks that are normally 512 bytes in size to Kbytes. Right.. All is well now?! No, it isn't. The system BIOS has another quirk you might run into. The number of cylinders of a bootable hard disk cannot be greater than 1024. Using the translation above, this is a show-stopper for disks greater than 1 Gb. With disk capacities going up all the time this is causing problems. Fortunately, the solution is simple: just use another translation, e.g. with 128 heads instead of 32. In most cases new SCSI BIOS versions are available to upgrade older SCSI host adapters. Some newer adapters have an option, in the form of a jumper or software setup selection, to switch the translation the SCSI BIOS uses. It is very important that all operating systems on the disk use the same translation to get the right idea about where to find the relevant partitions. So, when installing FreeBSD you must answer any questions about heads/cylinders etc using the translated values your host adapter uses. Failing to observe the translation issue might be un-bootable systems or operating systems overwriting each others partitions. Using fdisk you should be able to see all partitions. As promised earlier: what is this talk about 'lying' devices? As you might already know, the FreeBSD kernel reports the geometry of SCSI disks when booting. An example from one of my systems: Feb 9 19:33:46 yedi /386bsd: aha0 targ 0 lun 0: Feb 9 19:33:46 yedi /386bsd: sd0: 636MB (1303250 total sec), 1632 cyl, 15 head, 53 sec, bytes/sec 512 This info is retrieved from the SCSI disk itself. Newer disks often use a technique called zone bit recording. The idea is that on the outer cylinders of the drive there is more space so more sectors per track can be put on them. This results in disks that have more tracks on outer cylinders than on the inner cylinders and, last but not least, have more capacity. You can imagine that the value reported by the drive when inquiring about the geometry now becomes fake. SCSI subsystem design

FreeBSD uses a layered SCSI subsystem. For each different controller card a device driver is written. This driver knows all the intimate details about the hardware it controls. The driver has a interface to the upper layers of the SCSI subsystem through which it receives it's commands and reports back any status. On top of the card drivers there are a number of more generic drivers for a class of devices. More specific: a driver for tape devices (abbreviation: st), magnetic disks (sd), cdroms (cd) etc. In case you are wondering where you can find this stuff, it all lives in /sys/scsi. See the man pages in section 4 for more details. The multi level design allows a decoupling of low-level bit banging and more high level stuff. Adding support for another piece of hardware is a much more manageable problem. Kernel configuration

Dependent on your hardware, the kernel configuration file must contain one or more lines describing your host adapter(s). This includes I/O addresses, interrupts etc. Consult the man page for your adapter driver to get more info. Apart from that, check out /sys/i386/conf/LINT for an overview of a kernel config file. LINT contains every possible option you can dream of. It does not imply LINT will actually get you to a working kernel at all. Although it is probably stating the obvious: the kernel config file should reflect your actual hardware setup. So, interrupts, I/O addresses etc must match the kernel config file. During system boot messages will be displayed to indicate whether the configured hardware was actually found. An example based on the FreeBSD 2.0.5-Release kernel config file LINT with some added comments (between []): # SCSI host adapters: `aha', `ahb', `aic', `bt', `nca' # # aha: Adaptec 154x # ahb: Adaptec 174x # ahc: Adaptec 274x/284x/294x # aic: Adaptec 152x and sound cards using the Adaptec AIC-6360 (slow!) # bt: Most Buslogic controllers # nca: ProAudioSpectrum cards using the NCR 5380 or Trantor T130 # uha: UltraStore 14F and 34F # sea: Seagate ST01/02 8 bit controller (slow!) # wds: Western Digital WD7000 controller (no scatter/gather!). # # Note that the order is important in order for Buslogic cards to be # probed correctly. # [For a Bustek controller] controller bt0 at isa? port "IO_BT0" bio irq ? vector btintr [For an Adaptec AHA274x, 284x etc controller] controller ahc0 at isa? bio irq ? vector ahcintr # port??? iomem? [For an Adaptec AHA174x controller] controller ahb0 at isa? bio irq ? vector ahbintr [For an Adaptec AHA154x controller] controller aha0 at isa? port "IO_AHA0" bio irq ? drq 5 vector ahaintr [For an Ultrastor adapter] controller uha0 at isa? port "IO_UHA0" bio irq ? drq 5 vector uhaintr controller scbus0 #base SCSI code disk sd0 at scbus0 target 0 unit 0 [SCSI disk 0 is at scbus 0, LUN 0] disk sd1 at scbus0 target 1 [implicit LUN 0 if omitted] disk sd2 at scbus0 target 3 disk sd3 at scbus0 target 4 tape st1 at scbus0 target 6 [SCSI tape at target 6] device cd0 at scbus? [the first ever CDROM found, no wiring] The example above tells the kernel to look for a bt (Bustek) controller, then for an Adaptec 274x, 284x etc board, and so on. The lines following the controller specifications tell the kernel to configure specific devices but only attach them when they match the target ID and LUN specified. So, if you had a SCSI tape at target ID 2 it would not be configured, but it will attach when it is at target ID 6. Below is another example of a kernel config file as used by FreeBSD version < 2.0.5. The difference with the first example is that devices are not 'wired down'. 'Wired down' means that you specify which SCSI target belongs to which device. A kernel built to the config file below will attach the first SCSI disk it finds to sd0, the second disk to sd1 etc. If you ever removed or added a disk, all other devices of the same type (disk in this case) would 'move around'. This implies you have to change /etc/fstab each time. Although the old style still works, you are strongly recommended to use this new feature. It will save you a lot of grief whenever you shift your hardware around on the SCSI buses. So, when you re-use your old trusty config file after upgrading from a pre-FreeBSD2.0.5.R system check this out. controller ahb0 at isa? bio irq 11 vector ahbintr [driver for Adaptec 174x] controller aha0 at isa? port "IO_AHA0" bio irq 11 drq 5 vector ahaintr [for Adaptec 154x] controller sea0 at isa? bio irq 5 iomem 0xc8000 iosiz 0x2000 vector seaintr [for Seagate ST01/02] controller scbus0 device sd0 [support for 4 SCSI harddisks, sd0 up sd3] device sd1 device sd2 device sd3 device st0 [support for 2 SCSI tapes] device st1 device cd0 #Only need one of these, the code dynamically grows [for the cdrom] Both examples support 4 SCSI disks. If during boot more devices of a specific type (e.g. sd disks) are found than are configured in the booting kernel, the system will complain. You will have to build and boot a new kernel (after adapting the kernel configuration file) before you can use all of the devices. It does not hurt to have 'extra' devices in the kernel, the example above will work fine when you have only 2 SCSI disks. Use man 4 scsi to check for the latest info on the SCSI subsystem. For more detailed info on host adapter drivers use eg man 4 aha for info on the Adaptec 154x driver. Tuning your SCSI kernel setup

Experience has shown that some devices are slow to respond to INQUIRY commands after a SCSI bus reset. An INQUIRY command is sent by the kernel on boot to see what kind of device (disk, tape, cdrom etc) is connected to a specific target ID. This process is called device probing by the way. To work around this problem, FreeBSD allows a tunable delay time before the SCSI devices are probed following a SCSI bus reset. You can set this delay time in your kernel configuration file using a line like: options "SCSI_DELAY=15" #Be pessimistic about Joe SCSI device This line sets the delay time to 15 seconds. On my own system I had to use 3 seconds minimum to get my trusty old CDROM drive to be recognized. Start with a high value (say 30 seconds or so) when you have problems with device recognition. If this helps, tune it back until it just stays working. Rogue SCSI devices

Although the SCSI standard tries to be complete and concise, it is a complex standard and implementing things correctly is no easy task. Some vendors do a better job then others. This is exactly where the 'rogue' devices come into view. Rogues are devices that are recognized by the FreeBSD kernel as behaving slightly (...) non-standard. Rogue devices are reported by the kernel when booting. An example for two of my cartridge tape units: Feb 25 21:03:34 yedi /386bsd: ahb0 targ 5 lun 0: Feb 25 21:03:34 yedi /386bsd: st0: Tandberg tdc3600 is a known rogue Mar 29 21:16:37 yedi /386bsd: aha0 targ 5 lun 0: Mar 29 21:16:37 yedi /386bsd: st1: Archive Viper 150 is a known rogue For instance, there are devices that respond to all LUNs on a certain target ID, even if they are actually only one device. It is easy to see that the kernel might be fooled into believing that there are 8 LUNs at that particular target ID. The confusion this causes is left as an exercise to the user. The SCSI subsystem of FreeBSD recognizes devices with bad habits by looking at the INQUIRY response they send when probed. Because the INQUIRY response also includes the version number of the device firmware, it is even possible that for different firmware versions different workarounds are used. This scheme works fine, but keep in mind that it of course only works for devices that are KNOWN to be weird. If you are the first to connect your bogus Mumbletech SCSI cdrom you might be the one that has to define which workaround is needed. Busmaster host adapters

Most, but not all, SCSI host adapters are bus mastering controllers. This means that they can do I/O on their own without putting load onto the host CPU for data movement. This is of course an advantage for a multitasking operating system like FreeBSD. It must be noted however that there might be some rough edges. For instance an Adaptec 1542 controller can be set to use different transfer speeds on the host bus (ISA or AT in this case). The controller is settable to different rates because not all motherboards can handle the higher speeds. Problems like hangups, bad data etc might be the result of using a higher data transfer rate then your motherboard can stomach. The solution is of course obvious: switch to a lower data transfer rate and try if that works better. In the case of a Adaptec 1542, there is an option that can be put into the kernel config file to allow dynamic determination of the right, read: fastest feasible, transfer rate. This option is disabled by default: options "TUNE_1542" #dynamic tune of bus DMA speed Check the man pages for the host adapter that you use. Or better still, use the ultimate documentation (read: driver source). Tracking down problems

The following list is an attempt to give a guideline for the most common SCSI problems and their solutions. It is by no means complete. Check for loose connectors and cables. Check and doublecheck the location and number of your terminators. Check if your bus has at least one supplier of terminator power (especially with external terminators. Check if no double target IDs are used. Check if at least one device provides terminator power to the bus. Check if all devices to be used are powered up. Make a minimal bus config with as little devices as possible. If possible, configure your host adapter to use slow bus speeds. Further reading

If you intend to do some serious SCSI hacking, you might want to have the official standard at hand: Approved American National Standards can be purchased from ANSI at 11 West 42nd Street, 13th Floor, New York, NY 10036, Sales Dept: (212) 642-4900. You can also buy many ANSI standards and most committee draft documents from Global Engineering Documents, 15 Inverness Way East, Englewood, CO 80112-5704, Phone: (800) 854-7179, Outside USA and Canada: (303) 792-2181, FAX: (303) 792- 2192. Many X3T10 draft documents are available electronically on the SCSI BBS (719-574-0424) and on the ncrinfo.ncr.com anonymous ftp site. Latest X3T10 committee documents are: AT Attachment (ATA or IDE) [X3.221-1994] (Approved) ATA Extensions (ATA-2) [X3T10/948D Rev 2i] Enhanced Small Device Interface (ESDI) [X3.170-1990/X3.170a-1991] (Approved) Small Computer System Interface - 2 (SCSI-2) [X3.131-1994] (Approved) SCSI-2 Common Access Method Transport and SCSI Interface Module (CAM) [X3T10/792D Rev 11] Other publications that might provide you with additional information are: "SCSI: Understanding the Small Computer System Interface", written by NCR Corporation. Available from: Prentice Hall, Englewood Cliffs, NJ, 07632 Phone: (201) 767-5937 ISBN 0-13-796855-8 "Basics of SCSI", a SCSI tutorial written by Ancot Corporation Contact Ancot for availability information at: Phone: (415) 322-5322 Fax: (415) 322-0455 "SCSI Interconnection Guide Book", an AMP publication (dated 4/93, Catalog 65237) that lists the various SCSI connectors and suggests cabling schemes. Available from AMP at (800) 522-6752 or (717) 564-0100 "Fast Track to SCSI", A Product Guide written by Fujitsu. Available from: Prentice Hall, Englewood Cliffs, NJ, 07632 Phone: (201) 767-5937 ISBN 0-13-307000-X "The SCSI Bench Reference", "The SCSI Encyclopedia", and the "SCSI Tutor", ENDL Publications, 14426 Black Walnut Court, Saratoga CA, 95070 Phone: (408) 867-6642 "Zadian SCSI Navigator" (quick ref. book) and "Discover the Power of SCSI" (First book along with a one-hour video and tutorial book), Zadian Software, Suite 214, 1210 S. Bascom Ave., San Jose, CA 92128, (408) 293-0800 On Usenet the newsgroups and are noteworthy places to look for more info. You can also find the SCSI-Faq there, which is posted periodically. Most major SCSI device and host adapter suppliers operate ftp sites and/or BBS systems. They may be valuable sources of information about the devices you own. diff --git a/handbook/sections.sgml b/handbook/sections.sgml index 63e5efa85f..84d08b661c 100644 --- a/handbook/sections.sgml +++ b/handbook/sections.sgml @@ -1,43 +1,44 @@ - + + diff --git a/handbook/skey.sgml b/handbook/skey.sgml index d655f1fe3e..4b33dec279 100644 --- a/handbook/skey.sgml +++ b/handbook/skey.sgml @@ -1,302 +1,302 @@ - + S/Key

Contributed by &a.wollman;25 September 1995.

S/Key is a one-time password scheme based on a one-way hash function (in our version, this is MD4 for compatibility; other versions have used MD5 and DES-MAC). S/Key has been a standard part of all FreeBSD distributions since version 1.1.5, and is also implemented on a large and growing number of other systems. S/Key is a registered trademark of Bell Communications Research, Inc.

There are three different sorts of passwords which we will talk about in the discussion below. The first is your usual UNIX-style or Kerberos password; we'll call this a ``UNIX password''. The second sort is the one-time password which is generated by the S/Key `The secret password does not necessarily have anything to do with your UNIX password (while they can be the same, this is not recommended). While UNIX passwords are limited to eight characters in length, your S/Key secret password can be as long as you like; I use seven-word phrases. In general, the S/Key system operates completely independently of the UNIX password system.

There are in addition two other sorts of data involved in the S/Key system; one is called the ``seed'' or (confusingly) ``key'', and consists of two letters and five digits, and the other is the ``iteration count'' and is a number between 100 and 1. S/Key constructs a one-time password from these components by concatenating the seed and the secret password, then applying a one-way hash (the RSA Data Security, Inc., MD4 secure hash function) iteration-count times, and turning the result into six short English words. The `There are four programs involved in the S/Key system which we will discuss below. The `/etc/skeykeys file and prints out the invoking user's current iteration count and seed. Finally, the `There are four different sorts of operations we will cover. The first is using the `Secure connection initialization

To initialize S/Key, change your password, or change your seed while logged in over a secure connection (e.g., on the console of a machine), use the ` $ keyinit Updating wollman: ) these will not appear if you Old key: ha73895 ) have not used S/Key before Reminder - Only use this method if you are directly connected. If you are using telnet or rlogin exit with no password and use keyinit -s. Enter secret password: ) I typed my pass phrase here Again secret password: ) I typed it again ID wollman s/key is 99 ha73896 ) discussed below SAG HAS FONT GOUT FATE BOOM )

There is a lot of information here. At the `Enter secret password:' prompt, you should enter some password or phrase (I use phrases of minimum seven words) which will be needed to generate login keys. The line starting `ID' gives the parameters of your particular S/Key instance: your login name, the iteration count, and seed. When logging in with S/Key, the system will remember these parameters and present them back to you so you don't have to remember them. The last line gives the particular one-time password which corresponds to those parameters and your secret password; if you were to re-login immediately, this one-time password is the one you would use. Insecure connection initialization

To initialize S/Key or change your password or seed over an insecure connection, you will need to already have a secure connection to some place where you can run the ` $ keyinit -s Updating wollman: Old key: kh94741 Reminder you need the 6 english words from the skey command. Enter sequence count from 1 to 9999: 100 ) I typed this Enter new key [default kh94742]: s/key 100 kh94742 To accept the default seed (which the `keyinit' program confusingly calls a `key'), press return. Then move over to your secure connection or S/Key desk accessory, and give it the same parameters: $ key 100 kh94742 Reminder - Do not use this program while logged in via telnet or rlogin. Enter secret password: ) I typed my secret password HULL NAY YANG TREE TOUT VETO Now switch back over to the insecure connection, and copy the one-time password generated by ` s/key access password: HULL NAY YANG TREE TOUT VETO ID wollman s/key is 100 kh94742 HULL NAY YANG TREE TOUT VETO The rest of the description from the previous section applies here as well. Diversion: a login prompt

Before explaining how to generate one-time passwords, we should go over an S/Key login prompt: $ telnet himalia Trying 18.26.0.186... Connected to himalia.lcs.mit.edu. Escape character is '^]'. s/key 92 hi52030 Password: ->Note that, before prompting for a password, the login program +Note that, before prompting for a password, the login program prints out the iteration number and seed which you will need in order to generate the appropriate key. You will also find a useful feature (not shown here): if you press return at the password prompt, the login program will turn echo on, so you can see what you are typing. This can be extremely useful if you are attempting to type in an S/Key by hand, such as from a printout.

If this machine were configured to disallow UNIX passwords over a connection from my machine, the prompt would have also included the annotation `(s/key required)', indicating that only S/Key one-time passwords will be accepted. Generating a single one-time password

Now, to generate the one-time password needed to answer this login prompt, we use a trusted machine and the ` $ key 92 hi52030 ) pasted from previous section Reminder - Do not use this program while logged in via telnet or rlogin. Enter secret password: ) I typed my secret password ADEN BED WOLF HAW HOT STUN And in the other window: s/key 92 hi52030 ) from previous section Password: (turning echo on) Password:ADEN BED WOLF HAW HOT STUN Last login: Wed Jun 28 15:31:00 from halloran-eldar.l [etc.] This is the easiest mechanism Generating multiple one-time passwords

Sometimes we have to go places where no trusted machines or connections are available. In this case, it is possible to use the ` $ key -n 25 57 zz99999 Reminder - Do not use this program while logged in via telnet or rlogin. Enter secret password: 33: WALT THY MALI DARN NIT HEAD 34: ASK RICE BEAU GINA DOUR STAG [...] 56: AMOS BOWL LUG FAT CAIN INCH 57: GROW HAYS TUN DISH CAR BALM The `Restricting use of UNIX passwords

The configuration file /etc/skey.access can be used to configure restrictions on the use of UNIX passwords based on the host name, user name, terminal port, or IP address of a login session. The complete format of the file is documented in the If there is no /etc/skey.access file (which is the default state as FreeBSD is shipped), then all users will be allowed to use UNIX passwords. If the file exists, however, then all users will be required to use S/Key unless explicitly permitted to do otherwise by configuration statements in the Here is a sample configuration file which illustrates the three most common sorts of configuration statements: permit internet 18.26.0.0 255.255.0.0 permit user jrl permit port ttyd0 The first line (`The second line (`The third line (` + Setting up a SLIP client

Contributed by &a.asami;8 Aug 1995. The following is one way to set up a FreeBSD machine for SLIP on a static host network. For dynamic hostname assignments (i.e., your address changes each time you dial up), you probably need to do something much fancier. First, determine which serial port your modem is connected to. I have -a symbolic link /dev/modem -> cuaa1, and only use the modem name in my +a symbolic link /dev/modem -> cuaa1, and only use the modem name in my configuration files. It can become quite cumbersome when you need to -fix a bunch of files in /etc and .kermrc's all over the system! (Note -that /dev/cuaa0 is COM1, cuaa1 is COM2, etc.) +fix a bunch of files in /etc and .kermrc's all over the system! (Note +that /dev/cuaa0 is COM1, cuaa1 is COM2, etc.) Make sure you have pseudo-device sl 1 in your kernel's config file. It is included in the GENERIC kernel, so this won't be a problem unless you deleted it. Things you have to do only once

Add your home machine, the gateway and nameservers to your /etc/hosts file. Mine looks like this: 127.0.0.1 localhost loghost 136.152.64.181 silvia.HIP.Berkeley.EDU silvia.HIP silvia 136.152.64.1 inr-3.Berkeley.EDU inr-3 slip-gateway 128.32.136.9 ns1.Berkeley.edu ns1 128.32.136.12 ns2.Berkeley.edu ns2 By the way, silvia is the name of the car that I had when I was back in Japan (it's called 2?0SX here in U.S.). Make sure you have "hosts" before "bind" in your /etc/host.conf. Otherwise, funny things may happen. Edit the file /etc/sysconfig. Set your hostname by editing the line that says: hostname=myname.my.domain You should give it your full Internet hostname. Add sl0 to the list of network interfaces by changing the line that says: network_interfaces="lo0" to: network_interfaces="lo0 sl0" Set the startup flags of sl0 by adding a line: ifconfig_sl0="inet ${hostname} slip-gateway netmask 0xffffff00 up" Designate the default router by changing the line: defaultrouter=NO to: defaultrouter=slip-gateway Make a file /etc/resolv.conf which contains: domain HIP.Berkeley.EDU nameserver 128.32.136.9 nameserver 128.32.136.12 As you can see, these set up the nameserver hosts. Of course, the actual domain names and addresses depend on your environment. Set the password for root and toor (and any other accounts that doesn't have a password). Use passwd, don't edit the passwd or passwd.master files! Reboot your machine and make sure it comes up with the correct hostname. Making a SLIP connection

Dial up, type "slip" at the prompt, enter your machine name and password. The things you need to enter depends on your environment. I use kermit, with a script like this: # kermit setup set modem hayes set line /dev/modem set speed 115200 set parity none set flow rts/cts set terminal bytesize 8 set file type binary # The next macro will dial up and login define slip dial 643-9600, input 10 =>, if failure stop, - output slip\x0d, input 10 Username:, if failure stop, - output silvia\x0d, input 10 Password:, if failure stop, - output ***\x0d, echo \x0aCONNECTED\x0a (of course, you have to change the hostname and password to fit yours). Then you can just type "slip" from the kermit prompt to get connected. Note: leaving your password in plain text anywhere in the filesystem is generally a BAD idea. Do it at your own risk. I'm just too lazy. Leave the kermit there (you can suspend it by "z") and as root, type slattach -h -c -s 115200 /dev/modem if you are able to "ping" hosts on the other side of the router, you are connected! If it doesn't work, you might want to try "-a" instead of "-c" as an argument to slattach. How to shutdown the connection

Type "kill -INT `cat /var/run/slattach.modem.pid`" (as root) to kill slattach. Then go back to kermit ("fg" if you suspended it) and exit from it ("q"). The slattach man page says you have to use "ifconfig sl0 down" to mark the interface down, but this doesn't seem to make any difference for me. ("ifconfig sl0" reports the same thing.) Some times, your modem might refuse to drop the carrier (mine often does). In that case, simply start kermit and quit it again. It usually goes out on the second try. Troubleshooting

If it doesn't work, feel free to ask me. The things that people tripped over so far: Not using "-c" or "-a" in slattach (I have no idea why this can be fatal, but adding this flag solved the problem for at least one person) Using "s10" instead of "sl0" (might be hard to see the difference on some fonts. Try "ifconfig sl0" to see your interface status. I get: silvia# ifconfig sl0 sl0: flags=10 inet 136.152.64.181 --> 136.152.64.1 netmask ffffff00 Also, "netstat -r" will give the routing table, in case you get the "no route to host" messages from ping. Mine looks like: silvia# netstat -r Routing tables Destination Gateway Flags Refs Use IfaceMTU Rtt Netmasks: (root node) (root node) Route Tree for Protocol Family inet: (root node) => default inr-3.Berkeley.EDU UG 8 224515 sl0 - - localhost.Berkel localhost.Berkeley UH 5 42127 lo0 - 0.438 inr-3.Berkeley.E silvia.HIP.Berkele UH 1 0 sl0 - - silvia.HIP.Berke localhost.Berkeley UGH 34 47641234 lo0 - 0.438 (root node) (this is after transferring a bunch of files, your numbers should be smaller). diff --git a/handbook/submitters.sgml b/handbook/submitters.sgml index 903f842a57..b541641d80 100644 --- a/handbook/submitters.sgml +++ b/handbook/submitters.sgml @@ -1,222 +1,222 @@ - + Contributing to FreeBSD

Contributed by &a.jkh;. This guide is intended for those who are moderately familiar with FreeBSD and have reached a point where they have some locally developed customizations or fixes to the system which they'd like to incorporate back into the mainstream sources. Submitting something to the FreeBSD project ensures that you won't have to continually reintegrate it with each subsequent release and is also an excellent way of getting your code seriously tested! Many people have seen an original concept develop far beyond what they might have originally envisioned simply due to the flood of feedback and ideas generated by the many thousands of users of FreeBSD. Contributions are also what FreeBSD lives and grows from, so your contributions are very important to the continued survival of this communal effort of ours---we're very glad to see you reading this document! Submissions to FreeBSD can generally be classified into four categories: Ideas, general suggestions, bug reports. Changes to existing sources. Significant contribution of a large body of independent work. Porting of freely available software. A submission in any of these categories is highly welcomed as they are each, in their own way, quite significant to the project. Ideas and suggestions

An idea, suggestion or fix can be communicated in one of the following ways: An idea or suggestion of general technical interest should be mailed to <hackers@freebsd.org>. Likewise, people with an interest in such things (and a tolerance for a high volume of mail!) may subscribe to the hackers mailing list by sending mail to <majordomo@freebsd.org>. See for more information about this and other mailing lists. An actual bug report should be filed by using the send-pr(1) program. This will prompt you for various fields to fill in. Simply go to the fields surrounded by <>'s and fill in your own information in place of what's suggested there. You should receive confirmation of your bug report and a tracking number. Keep this tracking number and use it in any subsequent correspondence. If you do not receive confirmation in a timely fashion (3 days to a week, depending on your email connection) or are, for some reason, unable to use the send-pr(1) command, then you may also file a bug report by sending mail to <bugs@freebsd.org>. Changes to the existing code

An addition or change to the existing source code is a somewhat trickier affair and depends a lot on how far out of date you are with the current state of the core FreeBSD development. There is a special on-going release of FreeBSD known as ``FreeBSD-current'' which is made available in a variety of ways for the convenience of developers working actively on the system. See for more information about getting and using FreeBSD-current. Working from older sources unfortunately means that your changes may sometimes be too obsolete or too divergent for easy re-integration into FreeBSD. Chances of this can be minimized somewhat by subscribing to the <announce@freebsd.org> and <current@freebsd.org> mailing lists, where discussions on the current state of the system take place. Assuming that you can manage to secure fairly up-to-date sources to base your changes on, the next step is to produce a set of diffs to send to the FreeBSD maintainers. This is done with the diff(1) command, with the `context diff' form being preferred. For example: -diff -c <oldfile> <newfile> +diff -c oldfile newfile or -diff -c -r <olddir> <newdir> +diff -c -r olddir newdir would generate such a set of context diffs for the given source file or directory hierarchy. See the man page for diff(1) for more details. Once you have a set of diffs (which you may test with the patch(1) command), you should bundle them up in an email message and send it, along with a brief description of what the diffs are for, to <hackers@freebsd.org>. Someone will very likely get back in touch with you in 24 hours or less, assuming of course that your diffs are interesting! :-) If your changes don't express themselves well as diffs alone (e.g. you've perhaps added, deleted or renamed files as well) then you may be better off bundling any new files, diffs and instructions for deleting/renaming others into a tar file and running the uuencode(1) program on it before sending the output of that to <hackers@freebsd.org>. See the man pages on tar(1) and uuencode(1) for more information on bundling files this way. If your change is of a potentially sensitive nature, e.g. you're unsure of copyright issues governing its further distribution or you're simply not ready to release it without a tighter review first, then you should send it to <core@freebsd.org> rather than <hackers@freebsd.org>. The core mailing list reaches a much smaller group of people who do much of the day-to-day work on FreeBSD. Note that this group is also very busy and so you should only send mail to them in cases where mailing to hackers is truly impractical. Contributions of new code

In the case of a significant contribution of a large body work, or the addition of an important new feature to FreeBSD, it becomes almost always necessary to either send changes as uuencoded tar files or upload them to our ftp site . When working with large amounts of code, the touchy subject of copyrights also invariably comes up. Acceptable copyrights for code included in FreeBSD are: The BSD copyright. This copyright is most preferred due to its ``no strings attached'' nature and general attractiveness to commercial enterprises. Far from discouraging such commercial use, the FreeBSD Project actively encourages such participation by commercial interests who might eventually be inclined to invest something of their own into FreeBSD. The GNU Public License, or ``GPL''. This license isn't quite as popular with us due to the amount of extra effort demanded of anyone using the code for commercial purposes, but given the sheer quantity of GPL'd code we currently require (compiler, assembler, text formatter, etc) it would be silly to refuse additional contributions under this license. Code under the GPL also goes into a different part of the tree, that being /sys/gnu or /usr/src/gnu, and is therefore easily identifiable to anyone for whom the GPL presents a problem.

Contributions coming under any other type of copyright must be carefully reviewed before their inclusion into FreeBSD will be considered. Contributions for which particularly restrictive commercial copyrights apply are generally rejected, though the authors are always encouraged to make such changes available through their own channels. To place a ``BSD-style'' copyright on your work, include the following text at the very beginning of every source code file you wish to protect, replacing the text between the `%%' with the appropriate information. Copyright (c) %%proper_years_here%% %%your_name_here%%, %%your_state%% %%your_zip%%. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer as the first lines of this file unmodified. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. All advertising materials mentioning features or use of this software must display the following acknowledgment: This product includes software developed by %%your_name_here%%. 4. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY %%your_name_here%% ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL %%your_name_here%% BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - $Id: submitters.sgml,v 1.7 1995-09-27 00:46:29 jmz Exp $ + $Id: submitters.sgml,v 1.8 1995-10-07 04:32:03 jfieber Exp $ For your convenience, a copy of this text can be found in /usr/share/examples/etc/bsd-style-copyright. Porting of software

The porting of freely available software, while perhaps not as gratifying as developing your own from scratch, is still a vital part of FreeBSD's growth and of great usefulness to those who wouldn't otherwise know where to turn for it. All ported software is organized into a carefully organized hierarchy know as ``the ports collection''. The collection enables a new user to get a quick and complete overview of what's available for FreeBSD in an easy-to-compile form. It also saves considerable space by not actually containing the the majority of the sources being ported, but merely those differences required for running under FreeBSD. See for more information on using the ports collection and for guidelines on creating new ports. You may also send mail to <ports@freebsd.org>. Whichever way you decide to contribute, we hope you'll find it an enjoyable and rewarding process. Such contributions are also very valuable to FreeBSD's continued progress, and as a free software effort, the more we all put in the more we all get back out of it!