diff --git a/handbook/firewalls.sgml b/handbook/firewalls.sgml index 0de65e0ad8..b5f38540a5 100644 --- a/handbook/firewalls.sgml +++ b/handbook/firewalls.sgml @@ -1,536 +1,536 @@ - + Firewalls

Contributed by &a.gpalmer; and &a.alex;. Firewalls are an area of increasing interest for people who are connected to the Internet, and are even finding applications on private networks to provide enhanced security. This section will hopefully explain what firewalls are, how to use them, and how to use the facilities provided in the FreeBSD kernel to implement them. Note: People often think that having a firewall between your companies internal network and the ``Big Bad Internet'' will solve all your security problems. It may help, but a poorly setup firewall system is more of a security risk than not having one at all. A firewall can only add another layer of security to your systems, but they will not be able to stop a really determined hacker from penetrating your internal network. If you let internal security lapse because you believe your firewall to be impenetrable, you have just made the hackers job that bit easier. What is a firewall?

There are currently two distinct types of firewalls in common use on the Internet today. The first type is more properly called a packet filtering router, where the kernel on a multi-homed machine chooses whether to forward or block packets based on a set of rules. The second type, known as proxy servers, rely on daemons to provide authentication and to forward packets, possibly on a multi-homed machine which has kernel packet forwarding disabled.

Sometimes sites combine the two types of firewalls, so that only a certain machine (known as a bastion host) is allowed to send packets through a packet filtering router onto an internal network. Proxy services are run on the bastion host, which are generally more secure than normal authentication mechanisms.

FreeBSD comes with a kernel packet filter (known as IPFW), which is what the rest of this section will concentrate on. Proxy servers can be built on FreeBSD from third party software, but there is such a variety of proxy servers available that it would be impossible to cover them in this document. Packet filtering routers

A router is a machine which forwards packets between two or more networks. A packet filtering router has an extra piece of code in its kernel, which compares each packet to a list of rules before deciding if it should be forwarded or not. Most modern IP routing software has packet filtering code in it, which defaults to forwarding all packets. To enable the filters, you need to define a set of rules for the filtering code, so that it can decide if the packet should be allowed to pass or not.

To decide if a packet should be passed on or not, the code looks through its set of rules for a rule which matches the contents of this packets headers. Once a match is found, the rule action is obeyed. The rule action could be to drop the packet, to forward the packet, or even to send an ICMP message back to the originator. Only the first match counts, as the rules are searched in order. Hence, the list of rules can be referred to as a ``rule chain''.

The packet matching criteria varies depending on the software used, but typically you can specify rules which depend on the source IP address of the packet, the destination IP address, the source port number, the destination port number (for protocols which support ports), or even the packet type (UDP, TCP, ICMP, etc). Proxy servers

Proxy servers are machines which have had the normal system daemons (telnetd, ftpd, etc) replaced with special servers. These servers are called proxy servers as they normally only allow onward connections to be made. This enables you to run (for example) a proxy telnet server on your firewall host, and people can telnet in to your firewall from the outside, go through some authentication mechanism, and then gain access to the internal network (alternatively, proxy servers can be used for signals coming from the internal network and heading out).

Proxy servers are normally more secure than normal servers, and often have a wider variety of authentication mechanisms available, including ``one-shot'' password systems so that even if someone manages to discover what password you used, they will not be able to use it to gain access to your systems as the password instantly expires. As they do not actually give users access to the host machine, it becomes a lot more difficult for someone to install backdoors around your security system.

Proxy servers often have ways of restricting access further, so that only certain hosts can gain access to the servers, and often they can be set up so that you can limit which users can talk to which destination machine. Again, what facilities are available depends largely on what proxy software you choose. What does IPFW allow me to do?

IPFW, the software supplied with FreeBSD, is a packet filtering and accounting system which resides in the kernel, and has a user-land control utility, ipfw(8). Together, they allow you to define and query the rules currently used by the kernel in its routing decisions.

There are two related parts to IPFW. The firewall section allows you to perform packet filtering. There is also an IP accounting section which allows you to track usage of your router, based on similar rules to the firewall section. This allows you to see (for example) how much traffic your router is getting from a certain machine, or how much WWW (World Wide Web) traffic it is forwarding.

As a result of the way that IPFW is designed, you can use IPFW on non-router machines to perform packet filtering on incoming and outgoing connections. This is a special case of the more general use of IPFW, and the same commands and techniques should be used in this situation. Enabling IPFW on FreeBSD

As the main part of the IPFW system lives in the kernel, you will need to add one or more options to your kernel configuration file, depending on what facilities you want, and recompile your kernel. See for more details on how to recompile your kernel.

There are currently three kernel configuration options relevant to IPFW: syslogd(8). Without this option, even if you specify that packets should be logged in the filter rules, nothing will happen. -syslogd(8) on a per entry basis. You may wish to use this option in hostile environments in which you want to log firewall activity, but do not want to be open to a denial of serivce attack via syslog flooding.

When a chain entry reaches the packet limit specified, logging is turned off for that particular entry. To resume logging, you will need to reset the associated counter using the ipfw(8) utility: ipfw zero 4500 Where 4500 is the chain entry you wish to continue logging. Previous versions of FreeBSD contained an IPFIREWALL_ACCT option. This is now obsolete as the firewall code automatically includes accounting facilities. Configuring IPFW

The configuration of the IPFW software is done through the ipfw(8) utility. The syntax for this command looks quite complicated, but it is relatively simple once you understand its structure.

There are currently four different command categories used by the utility: addition/deletion, listing, flushing, and clearing. Addition/deletion is used to build the rules that control how packets are accepted, rejected, and logged. Listing is used to examine the contents of your rule set (otherwise known as the chain) and packet counters (accounting). Flushing is used to remove all entries from the chain. Clearing is used to zero out one or more accounting entries. Altering the IPFW rules

The syntax for this form of the command is: ipfw [-N] command [index] action [log] protocol addresses [options]

There is one valid flag when using this form of the command: The command given can be shortened to the shortest unique form. The valid commands are: Previous versions of IPFW used separate firewall and accounting entries. The present version provides packet accounting with each firewall entry.

If an index value is supplied, it used to place the entry at a specific point in the chain. Otherwise, the entry is placed at the end of the chain at an index 100 greater than the last chain entry (this does not include the default policy, rule 65535, deny).

The log option causes matching rules to be output to the system console if the kernel was compiled with IPFIREWALL_VERBOSE.

Valid actions are:

Each action will be recognized by the shortest unambiguous prefix. The protocols which can be specified are:

The address specification is: from <address/mask>[port] to <address/mask>[port&rsqb [via <interface>]

You can only specify port in conjunction with protocols which support ports (UDP and TCP).

The via is optional and may specify the IP address or domain name of a local IP interface, or an interface name (e.g. ed0) to match only packets coming through this interface. Interface unit numbers can be specified with an optional wildcard. For example, ppp* would match all kernel PPP interfaces.

The syntax used to specify an <address/mask> is: <address> or <address>/mask-bits or <address>:mask-pattern

A valid hostname may be specified in place of the IP address. mask-bits is a decimal number representing how many bits in the address mask should be set. e.g. specifying 192.216.222.1/24 will create a mask which will allow any address in a class C subnet (in this case, 192.216.222) to be matched. mask-pattern is an IP address which will be logically AND'ed with the address given. The keyword any may be used to specify ``any IP address''.

The port numbers to be blocked are specified as: port[,port[,port[...]]] to specify either a single port or a list of ports, or port-port to specify a range of ports. You may also combine a single range with a list, but the range must always be specified first.

The options available are: spec/Matches if the IP header contains the comma separated list of options specified in spec. The supported list of IP options are: ssrr (strict source route), lsrr (loose source route), rr (record packet route), and ts (timestamp). The absence of a particular option may be denoted with a leading '!'. established rules early in the chain. flags/Matches if the TCP header contains the comma separated list of flags. The supported flags are fin, syn, rst, psh, ack, and urg. The absence of a particular flag may be indicated by a leading '!'. types/Matches if the ICMP type is present in the list types. The list may be specified as any combination of ranges and/or individual types separated by commas. Commonly used ICMP types are: 0 echo reply (ping reply), 5 redirect, 8 echo request (ping request), and 11 time exceeded (used to indicate TTL expiration as with traceroute(8)). Listing the IPFW rules

The syntax for this form of the command is: ipfw [-atN] l

There are three valid flags when using this form of the command: ipfw(8) utility. Flushing the IPFW rules

The syntax for flushing the chain is: ipfw flush

This causes all entries in the firewall chain to be removed except the fixed default policy enforced by the kernel (index 65535). Use caution when flushing rules, the default deny policy will leave your system cut off from the network until allow entries are added to the chain. Clearing the IPFW packet counters

The syntax for clearing one or more packet counters is: ipfw zero [index]

When used without an index argument, all packet counters are cleared. If an index is supplied, the clearing operation only affects a specific chain entry. Example commands for ipfw

This command will deny all packets from the host evil.hacker.org to the telnet port of the host nice.people.org by being forwarded by the router: ipfw add deny tcp from evil.hacker.org to nice.people.org 23

The next example denies and logs any TCP traffic from the entire hacker.org network (a class C) to the nice.people.org machine (any port). ipfw add deny log tcp from evil.hacker.org/24 to nice.people.org If you do not want people sending X sessions to your internal network (a subnet of a class C), the following command will do the necessary filtering: ipfw add deny from any to my.org/28 6000 setup To allow access to the SUP server on sup.FreeBSD.ORG, use the following command: ipfw add accept from any to sup.FreeBSD.ORG 871 To see the accounting records: ipfw -a list or in the short form ipfw -a l You can also see the last time a chain entry was matched with ipfw -at l Building a packet filtering firewall

Note: The following suggestions are just that: suggestions. The requirements of each firewall are different and I cannot tell you how to build a firewall to meet your particular requirements.

When initially setting up your firewall, unless you have a test bench setup where you can configure your firewall host in a controlled environment, I strongly recommend you use the logging version of the commands and enable logging in the kernel. This will allow you to quickly identify problem areas and cure them without too much disruption. Even after the initial setup phase is complete, I recommend using the logging for of `deny' as it allows tracing of possible attacks and also modification of the firewall rules if your requirements alter. Note: If you use the logging versions of the accept command, it can generate large amounts of log data as one log line will be generated for every packet that passes through the firewall, so large ftp/http transfers, etc, will really slow the system down. It also increases the latencies on those packets as it requires more work to be done by the kernel before the packet can be passed on. syslogd with also start using up a lot more processor time as it logs all the extra data to disk, and it could quite easily fill the partition /var/log is located on.

As currently supplied, FreeBSD does not have the ability to load firewall rules at boot time. My suggestion is to put a call to a shell script in the /etc/netstart script. Put the call early enough in the netstart file so that the firewall is configured before any of the IP interfaces are configured. This means that there is no window during which time your network is open.

The actual script used to load the rules is entirely up to you. There is currently no support in the ipfw utility for loading multiple rules in the one command. The system I use is to use the command: # ipfw list to write a list of the current rules out to a file, and then use a text editor to prepend ``ipfw '' before all the lines. This will allow the script to be fed into /bin/sh and reload the rules into the kernel. Perhaps not the most efficient way, but it works.

The next problem is what your firewall should actually DO! This is largely dependent on what access to your network you want to allow from the outside, and how much access to the outside world you want to allow from the inside. Some general rules are: Block all incoming access to ports below 1000 for TCP. This is where most of the security sensitive services are, like finger, SMTP (mail) and telnet. Block incoming SYN (setup) connections to ports between 1001 and 1024 (this will allow internal users to rsh/rlogin to the outside). If you do not want to allow rsh/rlogin connections from the inside to the outside, then extend the above suggestion to cover ports 1-1024. Block all incoming UDP traffic. There are very few useful services that travel over UDP, and what useful traffic there is is normally a security threat (e.g. Suns RPC and NFS protocols). This has its disadvantages also, since UDP is a connectionless protocol, denying incoming UDP traffic also blocks the replies to outgoing UDP traffic. This can cause a problem for people (on the inside) using external archie (prospero) servers. If you want to allow access to archie, you'll have to allow packets coming from ports 191 and 1525 to any internal UDP port through the firewall. ntp is another service you may consider allowing through, which comes from port 123. Block traffic to port 6000 from the outside. Port 6000 is the port used for access to X11 servers, and can be a security threat (especially if people are in the habit of doing xhost + on their workstations). X11 can actually use a range of ports starting at 6000, the upper limit being how many X displays you can run on the machine. The upper limit as defined by RFC 1700 (Assigned Numbers) is 6063. Check what ports any internal servers use (e.g. SQL servers, etc). It's probably a good idea to block those as well, as they normally fall outside the 1-1024 range specified above.

Another checklist for firewall configuration is available from CERT at

As I said above, these are only guidelines. You will have to decide what filter rules you want to use on your firewall yourself. I cannot accept ANY responsibility if someone breaks into your network, even if you follow the advice given above. diff --git a/handbook/hw.sgml b/handbook/hw.sgml index e3cbda7d3f..711819b6bb 100644 --- a/handbook/hw.sgml +++ b/handbook/hw.sgml @@ -1,1344 +1,1344 @@ - + PC Hardware compatibility

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 commodity 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 e-mail to doc@freebsd.org. Questions about supported hardware should be directed to questions@freebsd.org (see 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. Resources on the Internet

The following links have proven useful in selecting hardware. Though some of what you see won't necessarily be specific (or even applicable) to FreeBSD, most of the hardware information out there is OS independant. Please check with the FreeBSD hardware guide to make sure that your chosen configuration is supported before making any purchases.

Sample Configurations

The following list of sample hardware configurations by no means constitutes an endorsement of a given hardware vendor or product by The FreeBSD Project. This information is provided only as a public service and merely catalogs some of the experiences that various individuals have had with different hardware combinations. Your mileage may vary. Slippery when wet. Beware of dog. Jordan's Picks

I have had fairly good luck building workstation and server configurations with the following components. I can't guarantee that you will too, nor that any of the companies here will remain "best buys" forever. I will try, when I can, to keep this list up-to-date but cannot obviously guarantee that it will be at any given time. Motherboards

The motherboard appears to be a good choice for mid-to-high range Pentium server and workstation systems. If you're really looking for performance, be also sure to get the . I feel that it's worth the extra cost. If you're looking for a 486 class motherboard, you might also investigate ASUS's offering (Note: These have become increasingly hard to get as ASUS apparently no longer manufactures them). NOTE: The Intel chip-set based motherboards do not offer memory parity logic, making it almost impossible to detect when a memory error has occurred. Those wishing to build more fault-tolerant systems should therefore buy one of the newer Triton II based motherboards, which offer both better performance and parity checking. Disk Controllers

This one is a bit trickier, and while I used to recommend the controllers unilaterally for everything from ISA to PCI, now I tend to lean towards the 1542CF for ISA, Buslogic Bt747c for EISA and Adaptec 2940 for PCI. Disk drives

In this particular game of Russian roulette, I'll make few specific recommendations except to say "SCSI over IDE whenever you can afford it." Even in small desktop configurations, SCSI often makes more sense since it allows you to easily migrate drives from server to desktop as falling drive prices make it economical to do so. If you have more than one machine to administer then think of it not simply as storage, think of it as a food chain!

I do not currently see SCSI WIDE drives as a necessary expense unless you're putting together an NFS or NEWS server that will be doing a lot of multiuser disk I/O. CDROM drives

My SCSI preferences extend to SCSI CDROM drives as well, and the XM-3501B (now released in a caddy-less model called the XM-5401B) drive has always performed well for me. Generally speaking, most SCSI CDROM drives I've seen have been of pretty solid construction (probably because they don't occupy the lower end of the market, due to their higher price) and you probably won't go wrong with an HP or NEC SCSI CDROM drive either. Tape drives

I've had pretty good luck with both from and drives from .

For backup purposes, I'd have to give the higher recommendation to the Exabyte due to the more robust nature (and higher storage capacity) of 8mm tape. Video Cards

If you can also afford to buy a commercial X server for US$99 from then I can heartily recommend the card. If free X servers are more to your liking, you certainly can't go wrong with one of cards - their S3 Vision 868 and 968 based cards (the 9FX series) are pretty fast cards as well, and are supported by 's S3 server. Monitors

I have had very good luck with the , as have I with the Viewsonic offering in the same (trinitron) tube. For larger than 17", all I can recommend at the time of this writing is to not spend any less than U.S. $2,500 for a 21" monitor if that's what you really need. There are good monitors available in the >=20" range and there are also cheap monitors in the >=20" range. Unfortunately, none are both cheap and good! Networking

I can recommend the Ultra 16 controller for any ISA application and the SMC EtherPower or Compex ENET32 cards for any serious PCI based networking. Both of the PCI cards are based around DEC's DC21041 Ethernet controller chip and other cards using it, such as the Zynx ZX342 or DEC DE435, will generally work as well. For 100Mbit networking, either the SMC SMC9332DST 10/100MB or Intel EtherExpress Pro/100B cards will do a fine job. Serial

If you're looking for high-speed serial networking solutions, then makes the series, with drivers now in FreeBSD-current. also manufactures a board with T1/E1 capabilities, using software they provide.

Multiport card options are somewhat more numerous, though it has to be said that FreeBSD's support for 's products is probably the tightest, primarily as a result of that company's committment to making sure that we are adequately supplied with evaluation boards and technical specs. I've heard that the Cyclom-16Ye offers the best price/performance, though I've not checked the prices lately. Other multiport cards I've heard good things about are the BOCA and AST cards, and apparently offers an unofficial driver for their cards at location. Audio

I currently use the Ultrasound MAX due to its high sound quality and full-duplex audio capabilities (dual DMA channels). Support for Windows NT and OS/2 is fairly anemic, however, so I'm not sure that I can recommend it as an all-around card for a machine that will be running both FreeBSD and NT or OS/2. In such a scenario, I might recommend the AWE32 instead. Video

For video capture, there's really only once choice - the card. FreeBSD also supports the older video spigot card from Creative Labs, but those are getting somewhat difficult to find and the Meteor is a more current generation frame-grabber with a higher-speed PCI interface. I use one for broadcasting video on the MBONE and it works quite well! Core/Processing Motherboards, busses, and chipsets * ISA * EISA * VLB PCI

Contributed by &a.rgrimes;.25 April 1995.

Of the Intel PCI chip sets, the following list describes various types of known-brokenness and the degree of breakage, listed from worst to best.

Mercury: 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. Saturn-I (ie, 82424ZX at rev 0, 1 or 2): 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. Saturn-II (ie, 82424ZX at rev 3 or 4): 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). Neptune: 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''. Triton: No known cache coherency or bus master problems, chip set does not implement parity checking. Workaround for parity issue. Wait for Triton-II. Triton-II: Unknown, not yet shipping.

* CPUs/FPUs * Memory * BIOS Input/Output Devices * Video cards * Sound cards Serial ports and multiport cards &uart; &sio; &cy; * Parallel ports * Modems * Network cards * Keyboards * Mice * Other Storage Devices &esdi; &scsi; * Disk/tape controllers * SCSI * IDE * Floppy * Hard drives Tape drives

Contributed by &a.jmb;.2 July 1996.

General tape access commands

mt(1) provides generic access to the tape drives. Some of the more common commands are rewind, erase, and status. See the mt(1) manual page for a detailed description. Controller Interfaces

There are several different interfaces that support tape drives. The interfaces are SCSI, IDE, Floppy and Parallel Port. A wide variety of tape drives are available for these interfaces. Controllers are discussed in SCSI drives

The st(4) driver provides support for 8mm (Exabyte), 4mm (DAT: Digital Audio Tape), QIC (Quarter-Inch Cartridge), DLT (Digital Linear Tape), QIC Minicartridge and 9-track (remember the big reels that you see spinning in Hollywood computer rooms) tape drives. See the st(4) manual page for a detailed description.

The drives listed below are currently being used by members of the FreeBSD community. They are not the only drives that will work with FreeBSD. They just happen to be the ones that we use. 4mm (DAT: Digital Audio Tape)

8mm (Exabyte)

QIC (Quarter-Inch Cartridge)

DLT (Digital Linear Tape)

Mini-Cartridge

Autoloaders/Changers

* IDE drives Floppy drives

* Parallel port drives Detailed Information

The boot message identifier for this drive is "ARCHIVE ANCDA 2750 28077 -003 type 1 removable SCSI 2"

This is a QIC tape drive.

Native capacity is 1.35GB when using QIC-1350 tapes. This drive will read and write QIC-150 (DC6150), QIC-250 (DC6250), and QIC-525 (DC6525) tapes as well.

Data transfer rate is 350kB/s using dump(8). Rates of 530kB/s have been reported when using

Production of this drive has been discontinued.

The SCSI bus connector on this tape drive is reversed from that on most other SCSI devices. Make sure that you have enough SCSI cable to twist the cable one-half turn before and after the Archive Anaconda tape drive, or turn your other SCSI devices upside-down.

Two kernel code changes are required to use this drive. This drive will not work as delivered.

If you have a SCSI-2 controller, short jumper 6. Otherwise, the drive behaves are a SCSI-1 device. When operating as a SCSI-1 device, this drive, "locks" the SCSI bus during some tape operations, including: fsf, rewind, and rewoffl.

If you are using the NCR SCSI controllers, patch the file /usr/src/sys/pci/ncr.c (as shown below). Build and install a new kernel. *** 4831,4835 **** }; ! if (np->latetime>4) { /* ** Although we tried to wake it up, --- 4831,4836 ---- }; ! if (np->latetime>1200) { /* ** Although we tried to wake it up,

Reported by: Jonathan M. Bresler jmb@FreeBSD.ORG

The boot message identifier for this drive is "ARCHIVE Python 28454-XXX4ASB" "type 1 removable SCSI 2" "density code 0x8c, 512-byte blocks"

This is a DDS-1 tape drive.

Native capacity is 2.5GB on 90m tapes.

Data transfer rate is XXX.

This drive was repackaged by Sun Microsystems as model 411.

Reported by: Bob Bishop rb@gid.co.uk

The boot message identifier for this drive is "ARCHIVE VIPER 60 21116 -007" "type 1 removable SCSI 1"

This is a QIC tape drive.

Native capacity is 60MB.

Data transfer rate is XXX.

Production of this drive has been discontinued.

Reported by: Philippe Regnauld regnauld@hsc.fr

The boot message identifier for this drive is "ARCHIVE VIPER 150 21531 -004" "Archive Viper 150 is a known rogue" "type 1 removable SCSI 1". A multitude of firmware revisions exist for this drive. Your drive may report different numbers (e.g "21247 -005".

This is a QIC tape drive.

Native capacity is 150/250MB. Both 150MB (DC6150) and 250MB (DC6250) tapes have the recording format. The 250MB tapes are approximately 67% longer than the 150MB tapes. This drive can read 120MB tapes as well. It can not write 120MB tapes.

Data transfer rate is 100kB/s

This drive reads and writes DC6150 (6150MB) and DC6250 (250MB) tapes.

This drives quirks are known and pre-compiled into the scsi tape device driver (st(4)).

Under FreeBSD 2.2-current, use mt blocksize 512 to set the blocksize. (The particular drive had firmware revision 21247 -005. Other firmware revisions may behave differently) Previous versions of FreeBSD did not have this problem.

Production of this drive has been discontinued.

Reported by: Pedro A M Vazquez vazquez@IQM.Unicamp.BR

Mike Smith msmith@atrad.adelaide.edu.au

The boot message identifier for this drive is "ARCHIVE VIPER 2525 25462 -011" "type 1 removable SCSI 1"

This is a QIC tape drive.

Native capacity is 525MB.

Data transfer rate is 180kB/s at 90 inches/sec.

The drive reads QIC-525, QIC-150, QIC-120 and QIC-24 tapes. Writes QIC-525, QIC-150, and QIC-120.

Firmware revisions prior to "25462 -011" are bug ridden and will not function properly.

Production of this drive has been discontinued.

Reported by: Hellmuth Michaelis hm@kts.org

The boot message identifier for this drive is "Conner tape".

This is a floppy controller, minicartridge tape drive.

Native capacity is XXXX

Data transfer rate is XXX

The drive uses QIC-80 tape cartridges.

Reported by: Mark Hannon mark@seeware.DIALix.oz.au

The boot message identifier for this drive is "CONNER CTMS 3200 7.00" "type 1 removable SCSI 2".

This is a minicartridge tape drive.

Native capacity is XXXX

Data transfer rate is XXX

The drive uses QIC-3080 tape cartridges.

Reported by: Thomas S. Traylor tst@titan.cs.mci.com

The boot message identifier for this drive is "DEC TZ87 (C) DEC 9206" "type 1 removable SCSI 2" "density code 0x19"

This is a DLT tape drive.

Native capacity is 10GB.

This drive supports hardware data compression.

Data transfer rate is 1.2MB/s.

This drive is identical to the Quantum DLT2000. The drive firmware can be set to emulate several well-known drives, including an Exabyte 8mm drive.

Reported by: Wilko Bulte wilko@yedi.iaf.nl

The boot message identifier for this drive is "EXABYTE EXB-2501"

This is a mini-cartridge tape drive.

Native capacity is 1GB when using MC3000XL minicartridges.

Data transfer rate is XXX

This drive can read and write DC2300 (550MB), DC2750 (750MB), MC3000 (750MB), and MC3000XL (1GB) minicartridges.

WARNING: This drive does not meet the SCSI-2 specifications. The drive locks up completely in response to a SCSI MODE_SELECT command unless there is a formatted tape in the drive. Before using this drive, set the tape blocksize with mt -f /dev/st0ctl.0 blocksize 1024 Before using a minicartridge for the first time, the minicartridge must be formated. FreeBSD 2.1.0-RELEASE and earlier: /sbin/scsi -f /dev/rst0.ctl -s 600 -c "4 0 0 0 0 0" (Alternatively, fetch a copy of the scsiformat shell script from FreeBSD 2.1.5/2.2.) FreeBSD 2.1.5 and later: /sbin/scsiformat -q -w /dev/rst0.ctl

Right now, this drive cannot really be recommended for FreeBSD.

Reported by: Bob Beaulieu ez@eztravel.com

The boot message identifier for this drive is "EXABYTE EXB-8200 252X" "type 1 removable SCSI 1"

This is an 8mm tape drive.

Native capacity is 2.3GB.

Data transfer rate is 270kB/s.

This drive is fairly slow in responding to the SCSI bus during boot. A custom kernel may be required (set SCSI_DELAY to 10 seconds).

There are a large number of firmware configurations for this drive, some have been customized to a particular vendor's hardware. The firmware can be changed via EPROM replacement.

Production of this drive has been discontinued.

Reported by: Mike Smith msmith@atrad.adelaide.edu.au

The boot message identifier for this drive is "EXABYTE EXB-8500-85Qanx0 0415" "type 1 removable SCSI 2"

This is an 8mm tape drive.

Native capacity is 5GB.

Data transfer rate is 300kB/s.

Reported by: Greg Lehey grog@lemis.de

The boot message identifier for this drive is "EXABYTE EXB-85058SQANXR1 05B0" "type 1 removable SCSI 2"

This is an 8mm tape drive.

Native capacity is 2GB.

The drive supports hardware data compression.

Data transfer rate is 300kB/s.

Reported by: Glen Foster gfoster@gfoster.com

The boot message identifier for this drive is "HP C1533A 9503" "type 1 removable SCSI 2".

This is a DDS-2 tape drive. DDS-2 means hardware data compression and narrower tracks for increased data capacity.

Native capacity is 4GB when using 120m tapes. This drive supports hardware data compression.

Data transfer rate is 510kB/s.

This drive is used in Hewlett-Packard's SureStore 6000eU and 6000i tape drives and C1533A DDS-2 DAT drive.

The drive has a block of 8 dip switches. The proper settings for FreeBSD are: 1 ON; 2 ON; 3 OFF; 4 ON; 5 ON; 6 ON; 7 ON; 8 ON. switch 1 2 Result ON ON Compression enabled at power-on, with host control ON OFF Compression enabled at power-on, no host control OFF ON Compression disabled at power-on; the host is allowed to control compression OFF OFF Compression disabled at power-on, no host control

Switch 3 controls MRS (Media Recognition System). MRS tapes have stripes on the transparent leader. These identify the tape as DDS (Digital Data Storage) grade media. Tapes that do not have the stripes will be treated as write-protected. Switch 3 OFF enables MRS. Switch 3 ON disables MRS.

Warning: Quality control on these drives varies greatly. One FreeBSD core-team member has returned 2 of these drives. Neither lasted more than 5 months.

Reported by: Stefan Esser se@ZPR.Uni-Koeln.DE

The boot message identifier for this drive is "HP HP35470A T503" type 1 removable SCSI 2" "Sequential-Access density code 0x13, variable blocks".

This is a DDS-1 tape drive. DDS-1 is the original DAT tape format.

Native capacity is 2GB when using 90m tapes.

Data transfer rate is 183kB/s.

The same mechanism is used in Hewlett-Packard's SureStore tape drive, C35470A DDS format DAT drive, C1534A DDS format DAT drive and HP C1536A DDS format DAT drive.

The HP C1534A DDS format DAT drive has two indicator lights, one green and one amber. The green one indicates tape action: slow flash during load, steady when loaded, fast flash during read/write operations. The amber one indicates warnings: slow flash when cleaning is required or tape is nearing the end of its useful life, steady indicates an hard fault. (factory service required?)

Reported by Gary Crutcher gcrutchr@nightflight.com

The boot message identifier for this drive is "".

This is a DDS-2 tape drive. DDS-2 means hardware data compression and narrower tracks for increased data capacity.

Native capacity is 24GB when using 120m tapes. This drive supports hardware data compression.

Data transfer rate is 510kB/s (native).

This drive is used in Hewlett-Packard's SureStore tape drive.

The drive has two selectors on the rear panel. The selector closer to the fan is SCSI id. The other selector should be set to 7.

There are four internal switches. These should be set: 1 ON; 2 ON; 3 ON; 4 OFF.

At present the kernel drivers do not automatically change tapes at the end of a volume. This shell script can be used to change tapes: #!/bin/sh PATH="/sbin:/usr/sbin:/bin:/usr/bin"; export PATH usage() { echo "Usage: dds_changer [123456ne] raw-device-name echo "1..6 = Select cartridge" echo "next cartridge" echo "eject magazine" exit 2 } if [ $# -ne 2 ] ; then usage fi cdb3=0 cdb4=0 cdb5=0 case $1 in [123456]) cdb3=$1 cdb4=1 ;; n) ;; e) cdb5=0x80 ;; ?) usage ;; esac scsi -f $2 -s 100 -c "1b 0 0 $cdb3 $cdb4 $cdb5"

The boot message identifier for this drive is "HP HP35450A -A C620" "type 1 removable SCSI 2" "Sequential-Access density code 0x13"

This is a DDS-1 tape drive. DDS-1 is the original DAT tape format.

Native capacity is 1.2GB.

Data transfer rate is 160kB/s.

Reported by: mark thompson mark.a.thompson@pobox.com

The boot message identifier for this drive is "HP HP35470A 9 09" type 1 removable SCSI 2"

This is a DDS-1 tape drive. DDS-1 is the original DAT tape format.

Native capacity is 2GB when using 90m tapes.

Data transfer rate is 183kB/s.

The same mechanism is used in Hewlett-Packard's SureStore tape drive, C35470A DDS format DAT drive, C1534A DDS format DAT drive, and HP C1536A DDS format DAT drive.

Warning: Quality control on these drives varies greatly. One FreeBSD core-team member has returned 5 of these drives. None lasted more than 9 months.

Reported by: David Dawes dawes@rf900.physics.usyd.edu.au (9 09)

The boot message identifier for this drive is "HP HP35480A 1009" "type 1 removable SCSI 2" "Sequential-Access density code 0x13".

This is a DDS-DC tape drive. DDS-DC is DDS-1 with hardware data compression. DDS-1 is the original DAT tape format.

Native capacity is 2GB when using 90m tapes. This drive supports hardware data compression

Data transfer rate is 183kB/s.

This drive is used in Hewlett-Packard's SureStore and tape drives and C35480A DDS format DAT drive..

This drive will occasionally hang during a tape eject operation (mt offline). Pressing the front panel button will eject the tape and bring the tape drive back to life.

WARNING: HP 35480-03110 only. On at least two occasions this tape drive when used with FreeBSD 2.1.0, an IBM Server 320 and an 2940W SCSI controller resulted in all SCSI disk partitions being lost. The problem has not be analyzed or resolved at this time.

There are at least two significantly different models: one is a DDS-1 and the other DDS-2. The DDS-1 version is "SDT-5000 3.02". The DDS-2 version is "SONY SDT-5000 327M". The DDS-2 version has a 1MB cache. This cache is able to keep the tape streaming in almost any circumstances.

The boot message identifier for this drive is "SONY SDT-5000 3.02" "type 1 removable SCSI 2" "Sequential-Access density code 0x13"

Native capacity is 4GB when using 120m tapes. This drive supports hardware data compression.

Data transfer rate is depends upon the model or the drive. The rate is 630kB/s for the "SONY SDT-5000 327M" while compressing the data. For the "SONY SDT-5000 3.02", the data transfer rate is 225kB/s.

In order to get this drive to stream, set the blocksize to 512 bytes (mt blocksize 512) reported by Kenneth Merry ken@ulc199.residence.gatech.edu"

"SONY SDT-5000 327M" information reported by Charles Henrich henrich@msu.edu

Reported by: Jean-Marc Zucconi jmz@cabri.obs-besancon.fr

The boot message identifier for this drive is "TANDBERG TDC 3600 =08:" "type 1 removable SCSI 2"

This is a QIC tape drive.

Native capacity is 150/250MB.

This drive has quirks which are known and work around code is present in the scsi tape device driver (st(4)). Upgrading the firmware to XXX version will fix the quirks and provide SCSI 2 capabilities.

Data transfer rate is 80kB/s.

IBM and Emerald units will not work. Replacing the firmware EPROM of these units will solve the problem.

Reported by: Michael Smith msmith@atrad.adelaide.edu.au

This is very similar to the drive.

Reported by: Jörg Wunsch joerg_wunsch@uriah.heep.sax.de

The boot message identifier for this drive is "TANDBERG TDC 4222 =07" "type 1 removable SCSI 2"

This is a QIC tape drive.

Native capacity is 2.5GB. The drive will read all cartridges from the 60 MB (DC600A) upwards, and write 150 MB (DC6150) upwards. Hardware compression is optionally supported for the 2.5 GB cartridges.

This drives quirks are known and pre-compiled into the scsi tape device driver (st(4)) beginning with FreeBSD 2.2-current. For previous versions of FreeBSD, use mt to read one block from the tape, rewind the tape, and then execute the backup program (mt fsr 1; mt rewind; dump ...)

Data transfer rate is 600kB/s (vendor claim with compression), 350 KB/s can even be reached in start/stop mode. The rate decreases for smaller cartridges.

Reported by: Jörg Wunsch joerg_wunsch@uriah.heep.sax.de

The boot message identifier for this drive is "WANGTEK 5525ES SCSI REV7 3R1" "type 1 removable SCSI 1" "density code 0x11, 1024-byte blocks"

This is a QIC tape drive.

Native capacity is 525MB.

Data transfer rate is 180kB/s.

The drive reads 60, 120, 150, and 525MB tapes. The drive will not write 60MB (DC600 cartridge) tapes. In order to overwrite 120 and 150 tapes reliably, first erase (mt erase) the tape. 120 and 150 tapes used a wider track (fewer tracks per tape) than 525MB tapes. The "extra" width of the previous tracks is not overwritten, as a result the new data lies in a band surrounded on both sides by the previous data unless the tape have been erased.

This drives quirks are known and pre-compiled into the scsi tape device driver (st(4)).

Other firmware revisions that are known to work are: M75D

Reported by: Marc van Kempen marc@bowtie.nl "REV73R1" Andrew Gordon Andrew.Gordon@net-tel.co.uk "M75D"

The boot message identifier for this drive is "WANGTEK 6200-HS 4B18" "type 1 removable SCSI 2" "Sequential-Access density code 0x13"

This is a DDS-1 tape drive.

Native capacity is 2GB using 90m tapes.

Data transfer rate is 150kB/s.

Reported by: Tony Kimball alk@Think.COM * Problem drives * CD-ROM drives * Other * Adding and reconfiguring disks Tapes and backups * What about backups to floppies? Tape Media

4mm tapes are replacing QIC as the workstation backup media of choice. This trend accelerated greatly when Conner purchased Archive, a leading manufacturer of QIC drives, and then stopped production of QIC drives. 4mm drives are small and quiet but do not have the reputation for reliability that is enjoyed by 8mm drives. The cartridges are less expensive and smaller (3 x 2 x 0.5 inches, 76 x 51 x 12 mm) than 8mm cartridges. 4mm, like 8mm, has comparatively short head life for the same reason, both use helical scan.

Data thruput on these drives starts ~150kB/s, peaking at ~500kB/s. Data capacity starts at 1.3 GB and ends at 2.0 GB. Hardware compression, available with most of these drives, approximately doubles the capacity. Multi-drive tape library units can have 6 drives in a single cabinet with automatic tape changing. Library capacities reach 240 GB.

4mm drives, like 8mm drives, use helical-scan. All the benefits and drawbacks of helical-scan apply to both 4mm and 8mm drives.

Tapes should be retired from use after 2,000 passes or 100 full backups.

8mm tapes are the most common SCSI tape drives; they are the best choice of exchanging tapes. Nearly every site has an exabyte 2 GB 8mm tape drive. 8mm drives are reliable, convienent and quiet. Cartidges are inexpensive and small (4.8 x 3.3 x 0.6 inches; 122 x 84 x 15 mm). One downside of 8mm tape is relatively short head and tape life due to the high rate of relative motion of the tape across the heads.

Data thruput ranges from ~250kB/s to ~500kB/s. Data sizes start at 300 MB and go up to 7 GB. Hardware compression, available with most of these drives, approximately doubles the capacity. These drives are available as single units or multi-drive tape libraries with 6 drives and 120 tapes in a single cabinet. Tapes are changed automatically by the unit. Library capacities reach 840+ GB.

Data is recorded onto the tape using helical-scan, the heads are positioned at an angle to the media (approximately 6 degrees). The tape wraps around 270 degrees of the spool that holds the heads. The spool spins while the tape slides over the spool. The result is a high density of data and closely packed tracks that angle across the tape from one edge to the other.

QIC-150 tapes and drives are, perhaps, the most common tape drive and media around. QIC tape drives are the least expensive "serious" backup drives. The downside is the cost of media. QIC tapes are expensive compared to 8mm or 4mm tapes, up to 5 times the price per GB data storage. But, if your needs can be satisified with a half-dozen tapes, QIC may be the correct choice. QIC is the most common tape drive. Every site has a QIC drive of some density or another. Therein lies the rub, QIC has a large number of densities on physically similar (sometimes identical) tapes. QIC drives are not quiet. These drives audibly seek before they begin to record data and are clearly audible whenever reading, writing or seeking. QIC tapes measure (6 x 4 x 0.7 inches; 15.2 x 10.2 x 1.7 mm). , which also use 1/4" wide tape are discussed separately. Tape libraries and changers are not available.

Data thruput ranges from ~150kB/s to ~500kB/s. Data capacity ranges from 40 MB to 15 GB. Hardware compression is available on many of the newer QIC drives. QIC drives are less frequently installed; they are being supplanted by DAT drives.

Data is recorded onto the tape in tracks. The tracks run along the long axis of the tape media from one end to the other. The number of tracks, and therefore the width of a track, varies with the tape's capacity. Most if not all newer drives provide backward-compatibility at least for reading (but often also for writing). QIC has a good reputation regarding the safety of the data (the mechanics are simpler and more robust than for helical scan drives).

Tapes should be retired from use after 5,000 backups.

DLT has the fastest data transfer rate of all the drive types listed here. The 1/2" (12.5mm) tape is contained in a single spool cartridge (4 x 4 x 1 inches; 100 x 100 x 25 mm). The cartridge has a swinging gate along one entire side of the cartridge. The drive mechanism opens this gate to extract the tape leader. The tape leader has an oval hole in it which the drive uses to "hook" the tape. The take-up spool is located inside the tape drive. All the other tape cartridges listed here (9 track tapes are the only exception) have both the supply and take-up spools located inside the tape cartridge itself. Data thruput is approximately 1.5MB/s, three times the thruput of 4mm, 8mm, or QIC tape drives. Data capacities range from 10GB to 20GB for a single drive. Drives are available in both multi-tape changers and multi-tape, multi-drive tape libraries containing from 5 to 900 tapes over 1 to 20 drives, providing from 50GB to 9TB of storage. Data is recorded onto the tape in tracks parallel to the direction of travel (just like QIC tapes). Two tracks are written at once. Read/write head lifetimes are relatively long; once the tape stops moving, there is no relative motion between the heads and the tape. Using a new tape for the first time

The first time that you try to read or write a new, completely blank tape, the operation will fail. The console messages should be similar to: st0(ncr1:4:0): NOT READY asc:4,1 st0(ncr1:4:0): Logical unit is in process of becoming ready The tape does not contain an Identifier Block (block number 0). All QIC tape drives since the adoption of QIC-525 standard write an Identifier Block to the tape. There are two solutions:

mt fsf 1 causes the tape drive to write an Identifier Block to the tape.

Use the front panel button to eject the tape.

Re-insert the tape and dump(8) data to the tape.

dump(8) will report DUMP: End of tape detected and the console will show: HARDWARE FAILURE info:280 asc:80,96

rewind the tape using: mt rewind

Subsequent tape operations are successful. Backup Programs

The three major programs are dump(8), tar(1), and cpio(1). Dump and Restore

dump(8) and restore(8) are the traditional Unix backup programs. They operate on the drive as a collection of disk blocks, below the abstractions of files, links and directories that are created by the filesystems. dump(8) backs up devices, entire filesystems, not parts of a filesystem and not directory trees that span more than one filesystem, using either soft links ln(1) or mounting one filesystem onto another. dump(8) does not write files and directories to tape, but rather writes the data blocks that are the building blocks of files and directories. dump(8) has quirks that remain from its early days in Version 6 of ATT Unix (circa 1975). The default parameters are suitable for 9-track tapes (6250 bpi), not the high-density media available today (up to 62,182 ftpi). These defaults must be overridden on the command line to utilize the capacity of current tape drives.

rdump(8) and rrestore(8) backup data aross the network to a tape drive attached to another computer. Both programs rely upon rcmd(3) and ruserok(3) to access the remote tape drive. Therefore, the user performing the backup must have rhosts access to the remote computer. The arguments to rdump(8) and rrestore(8) must suitable to use on the remote computer. (e.g. When rdump'ing from a FreeBSD computer to an Exabyte tape drive connected to a Sun called komodo, use: /sbin/rdump 0dsbfu 54000 13000 126 komodo:/dev/nrst8 /dev/rsd0a 2>&1) Beware: there are security implications to allowing rhosts commands. Evaluate your situation carefully. Tar

tar(1) also dates back to Version 6 of ATT Unix (circa 1975). tar(1) operates in cooperation with the filesystem; tar(1) writes files and directories to tape. tar(1) does not support the full range of options that are available from cpio(1), but tar(1) does not require the unusual command pipeline that cpio(1) uses.

tar(1) does not support backups across the network. You can use a pipeline and rsh(1) to send the data to a remote tape drive. (XXX add an example command) Cpio

cpio(1) is the original Unix file interchange tape program for magnetic media. cpio(1) has options (among many others) to perform byte-swapping, write a number of different archives format, and pipe the data to other programs. This last feature makes cpio(1) and excellent choice for installation media. cpio(1) does not know how to walk the directory tree and a list of files must be provided thru STDIN.

cpio(1) does not support backups across the network. You can use a pipeline and rsh(1) to send the data to a remote tape drive. (XXX add an example command)

Amanda (Advanced Maryland Network Disk Archiver) is a client/server backup system, rather than a single program. An Amanda server will backup to a single tape drive any number of computers that have Amanda clients and network communications with the Amanda server. A common problem at locations with a number of large disks is the length of time required to backup to data directly to tape exceeds the amount of time available for the task. Amanda solves this problem. Amanda can use a "holding disk" to backup several filesystems at the same time. Amanda creates "archive sets": a group of tapes used over a period of time to create full backups of all the filesystems listed in Amanda's configuration file. The "archive set" also contains nightly incremental (or differential) backups of all the filesystems. Restoring a damaged filesystem requires the most recent full backup and the incremental backups.

The configuration file provides fine control backups and the network traffic that Amanda generates. Amanda will use any of the above backup programs to write the data to tape. Amanda is available as either a port or a package, it is not installed by default. Do nothing

"Do nothing" is not a computer program, but it is the most widely used backup strategy. There are no initial costs. There is no backup schedule to follow. Just say no. If something happens to your data, grin and bear it!

If your time and your data is worth little to nothing, then "Do nothing" is the most suitable backup program for your computer. But beware, Unix is a useful tool, you may find that within six months you have a collection of files that are valuable to you.

"Do nothing" is the correct backup method for /usr/obj and other directory trees that can be exactly recreated by your computer. An example is the files that comprise these handbook pages-they have been generated from SGML input files. Creating backups of these HTML files is not necessary. The SGML source files are backed up regularly. Which Backup Program is Best?

dump(8) Period. Elizabeth D. Zwicky torture tested all the backup programs discussed here. The clear choice for preserving all your data and all the peculiarities of Unix filesystems is dump(8). Elizabeth created filesystems containing a large variety of unusual conditions (and some not so unusual ones) and tested each program by do a backup and restore of that filesystems. The peculiarities included: files with holes, files with holes and a block of nulls, files with funny characters in their names, unreadable and unwriteable files, devices, files that change size during the backup, files that are created/deleted during the backup and more. She presented the results at LISA V in Oct. 1991. Emergency Restore Procedure Before the Disaster

There are only four steps that you need to perform in preparation for any disaster that may occur.

First, print the disklabel from each of your disks (e.g. disklabel sd0 | lpr), your filesystem table (/etc/fstab) and all boot messages, two copies of each.

Second, determine the boot and fixit floppies (boot.flp and fixit.flp) have all your devices. The easiest way to check is to reboot your machine with the boot floppy in the floppy drive and check the boot messages. If all your devices are listed and functional, skip on to step three.

Otherwise, you have to create two custom bootable floppies which has a kernel that can mount your all of your disks and access your tape drive. These floppies must contain: fdisk(8), disklabel(8), newfs(8), mount(8), and whichever backup program you use. These programs must be statically linked. If you use dump(8), the floppy must contain restore(8).

Third, create backup tapes regularly. Any changes that you make after your last backup may be irretrievably lost. Write-protect the backup tapes.

Fourth, test the floppies (either boot.flp and fixit.flp or the two custom bootable floppies you made in step two.) and backup tapes. Make notes of the procedure. Store these notes with the bootable floppy, the printouts and the backup tapes. You will be so distraught when restoring that the notes may prevent you from destroying your backup tapes (How? In place of tar xvf /dev/rst0, you might accidently type tar cvf /dev/rst0 and over-write your backup tape).

For an added measure of security, make bootable floppies and two backup tapes each time. Store one of each at a remote location. A remote location is NOT the basement of the same office building. A number of firms in the World Trade Center learned this lesson the hard way. A remote location should be physically separated from your computers and disk drives by a significant distance.

An example script for creating a bootable floppy: #!/bin/sh # # create a restore floppy # # format the floppy # PATH=/bin:/sbin:/usr/sbin:/usr/bin fdformat -q fd0 if [ $? -ne 0 ] then echo "Bad floppy, please use a new one" exit 1 fi # place boot blocks on the floppy # disklabel -w -B -b /usr/mdec/fdboot -s /usr/mdec/bootfd /dev/rfd0c fd1440 # # newfs the one and only partition # newfs -t 2 -u 18 -l 1 -c 40 -i 5120 -m 5 -o space /dev/rfd0a # # mount the new floppy # mount /dev/fd0a /mnt # # create required directories # mkdir /mnt/dev mkdir /mnt/bin mkdir /mnt/sbin mkdir /mnt/etc mkdir /mnt/root mkdir /mnt/mnt # for the root partition mkdir /mnt/tmp mkdir /mnt/var # # populate the directories # if [ ! -x /sys/compile/MINI/kernel ] then cat << EOM The MINI kernel does not exist, please create one. Here is an example config file: # # MINI -- A kernel to get FreeBSD on onto a disk. # machine "i386" cpu "I486_CPU" ident MINI maxusers 5 options INET # needed for _tcp _icmpstat _ipstat # _udpstat _tcpstat _udb options FFS #Berkeley Fast File System - options "FAT_CURSOR" #block cursor in syscons or pccons - options "SCSI_DELAY=15" #Be pessimistic about Joe SCSI device - options "NCONS=2" #1 virtual consoles + options FAT_CURSOR #block cursor in syscons or pccons + options SCSI_DELAY=15 #Be pessimistic about Joe SCSI device + options NCONS=2 #1 virtual consoles options USERCONFIG #Allow user configuration with -c XXX config kernel root on sd0 swap on sd0 and sd1 dumps on sd0 controller isa0 controller pci0 controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr disk fd0 at fdc0 drive 0 controller ncr0 controller scbus0 device sc0 at isa? port "IO_KBD" tty irq 1 vector scintr device npx0 at isa? port "IO_NPX" irq 13 vector npxintr device sd0 device sd1 device sd2 device st0 pseudo-device loop # required by INET pseudo-device gzip # Exec gzipped a.out's EOM exit 1 fi cp -f /sys/compile/MINI/kernel /mnt gzip -c -best /sbin/init > /mnt/sbin/init gzip -c -best /sbin/fsck > /mnt/sbin/fsck gzip -c -best /sbin/mount > /mnt/sbin/mount gzip -c -best /sbin/halt > /mnt/sbin/halt gzip -c -best /sbin/restore > /mnt/sbin/restore gzip -c -best /bin/sh > /mnt/bin/sh gzip -c -best /bin/sync > /mnt/bin/sync cp /root/.profile /mnt/root cp -f /dev/MAKEDEV /mnt/dev chmod 755 /mnt/dev/MAKEDEV chmod 500 /mnt/sbin/init chmod 555 /mnt/sbin/fsck /mnt/sbin/mount /mnt/sbin/halt chmod 555 /mnt/bin/sh /mnt/bin/sync chmod 6555 /mnt/sbin/restore # # create the devices nodes # cd /mnt/dev ./MAKEDEV std ./MAKEDEV sd0 ./MAKEDEV sd1 ./MAKEDEV sd2 ./MAKEDEV st0 ./MAKEDEV pty0 cd / # # create minimum filesystem table # cat > /mnt/etc/fstab < /mnt/etc/passwd < /mnt/etc/master.passwd < After the Disaster

The key question is: did your hardware survive? You have been doing regular backups so there is no need to worry about the software.

If the hardware has been damaged. First, replace those parts that have been damaged.

If your hardware is okay, check your floppies. If you are using a custom boot floppy, boot single-user (type "-s" at the "boot:" prompt). If you are using the boot.flp and fixit.flp floppies, keep reading. insert the boot.flp floppy in the floppy drive and boot the computer. The original install menu is displayed on the screen. Select the "fixit XXX" option. Insert the fixit.flp when prompted. restore and the other programs that you need are located in /mnt2/stand. Skip the following paragraph.

Recover each filesystem separately.

Try to mount(8) (e.g. mount /dev/sd0a /mnt) the root partition of your first disk. If the disklabel was damaged, use disklabel(8) to re-partition and label the disk to match the label that your printed and saved. Use newfs(8) to re-create the filesystems. Re-mount the root partition of the floppy read-write ("mount -u -o rw /mnt"). Use your backup program and backup tapes to recover the data for this filesystem (e.g. restore vrf /dev/st0). Unmount the filesystem (e.g. umount /mnt) Repeat for each filesystem that was damaged.

Once your system is running, backup your data onto new tapes. Whatever caused the crash or data loss may strike again. An another hour spent now, may save you from further distress later. * I did not prepare for the Disaster, What Now? * Serial ports * Sound cards * PCMCIA * Other diff --git a/handbook/linuxemu.sgml b/handbook/linuxemu.sgml index 384c549974..9e1454f7d2 100644 --- a/handbook/linuxemu.sgml +++ b/handbook/linuxemu.sgml @@ -1,700 +1,700 @@ - + Linux Emulation

Contributed by &a.brian and &a.rich; How to install the Linux emulator

Linux emulation in FreeBSD has reached a point where it is possible to run a large fraction of Linux binaries in both a.out and ELF format. The linux emulation in the -STABLE branch is capable of running Linux DOOM and Mathematica; the version present in FreeBSD-CURRENT is vastly more capable and runs all these as well as Quake, Abuse, IDL, netrek for Linux and a whole host of other programs. There are some Linux-specific operating system features that are not supported on FreeBSD. Linux binaries will not work on FreeBSD if they use the Linux /proc filesystem (which is different from the optional FreeBSD /proc filesystem) or i386-specific calls, such as enabling virtual 8086 mode.

To tell whether your kernel is configured for Linux compatibility simply run any Linux binary. If it prints the error message linux-executable: Exec format error. Wrong Architecture. then you do not have linux compatibility support and you need to configure and install a new kernel. Depending on which version of FreeBSD you are running, how you get Linux-emulation up will vary slightly: Installing Linux Emulation in 2.1-STABLE

The GENERIC kernel in 2.1-stable is not configured for linux compatibility so you you must reconfigure your kernel for it. There are two ways to do this: 1. linking the emulator statically in the kernel itself and 2. configuring your kernel to dynamically load the linux loadable kernel module (LKM).

To enable the emulator, add the following to your configuration file (c.f. /sys/i386/conf/LINT): -options "COMPAT_LINUX" +options COMPAT_LINUX If you want to run doom or other applications that need shared memory also add the following. options SYSVSHM The linux system calls require 4.3 BSD system call compatibility. So make sure you have the following. options "COMPAT_43" If you prefer to statically link the emulator in the kernel rather than use the loadable kernel module (LKM), then add options LINUX Then run config and install the new kernel as described in the section. If you decide to use the LKM you must also install the loadable module. A mismatch of versions between the kernel and loadable module can cause the kernel to crash, so the safest thing to do is to reinstall the LKM when you install the kernel. % cd /usr/src/lkm/linux % make all install Once you have installed the kernel and the LKM, you can invoke `linux' as root to load the LKM. % linux Linux emulator installed Module loaded as ID 0 % To see whether the LKM is loaded, run `modstat'. % modstat Type Id Off Loadaddr Size Info Rev Module Name EXEC 0 3 f0baf000 0018 f0bb4000 1 linux_emulator % You can cause the LKM to be loaded when the system boots in either of two ways. On FreeBSD-CURRENT and FreeBSD-STABLE enable it in /etc/sysconfig linux=YES by changing it from NO to YES. FreeBSD 2.1 RELEASE and earlier do not have such a line and on those you will need to edit /etc/rc.local to add the following line. linux Installing Linux Emulation in 2.2-CURRENT -

In -current it is no longer necessary to specify options "LINUX" -or options "COMPAT_LINUX". Linux emulation is done with an LKM +

In -current it is no longer necessary to specify ``options LINUX'' +or ``options COMPAT_LINUX''. Linux emulation is done with an LKM (``Loadable Kernel Module'') so it can be installed on the fly without having to reboot. You will need the following things in your startup files, however: In /etc/sysconfig, you need the following line: linux=YES This, in turn, triggers the following action in /etc/rc.i386: # Start the Linux binary emulation if requested. if [ "X${linux}" = X"YES" ]; then echo -n ' '; linux # XXX BOGUS - Linux script shouldn't make any output on success fi

If you want to verify it is running, modstat will do that: % modstat Type Id Off Loadaddr Size Info Rev Module Name EXEC 0 4 f09e6000 001c f09ec010 1 linux_mod % However, there have been reports that this fails on some FreeBSD-current systems. If for some reason you cannot load the linux LKM, then statically link the emulator in the kernel by adding options LINUX to your kernel config file. Then run config and install the new kernel as described in the section. Installing Linux Runtime Libraries Installing using the linux_lib port

Most linux applications use shared libraries, so you are still not done until you install the shared libraries. It is possible to do this by hand, however, it is vastly simpler to just grab the linux_lib port: % cd /usr/ports-current/emulators/linux_lib % make all install and you should have a working linux emulator. Legend (and the mail archives :-) seems to hold that Linux emulation works best with linux binaries linked against the ZMAGIC libraries; QMAGIC libraries (such as those used in Slackware V2.0) may tend to give the Linuxulator heartburn. As of this writing (March 1996) ELF emulation is still in the formulative stages but seems to work pretty well. Also, expect some programs to complain about incorrect minor versions. In general this does not seem to be a problem. Installing libraries manually

If you don't have the ``ports'' distribution, you can install the libraries by hand instead. You will need the Linux shared libraries that the program depends on and the runtime linker. Also, you will need to create a "shadow root" directory, /compat/linux, for Linux libraries on your FreeBSD system. Any shared libraries opened by Linux programs run under FreeBSD will look in this tree first. So, if a Linux program loads, for example, /lib/libc.so, FreeBSD will first try to open /compat/linux/lib/libc.so, and if that does not exist then it will try /lib/libc.so. Shared libraries should be installed in the shadow tree /compat/linux/lib rather than the paths that the Linux ld.so reports. FreeBSD-current works slightly differently with respect to /compat/linux. On -current, all files, not just libraries, are searched for from the ``shadow root'' /compat/linux. Generally, you will need to look for the shared libraries that Linux binaries depend on only the first few times that you install a Linux program on your FreeBSD system. After a while, you will have a sufficient set of Linux shared libraries on your system to be able to run newly imported Linux binaries without any extra work. How to install additional shared libraries

What if you install the linux_lib port and your application still complains about missing shared libraries? How do you know which shared libraries Linux binaries need, and where to get them? Basically, there are 2 possibilities (when following these instructions: you will need to be root on your FreeBSD system to do the necessary installation steps).

If you have access to a Linux system, see what shared libraries it needs, and copy them to your FreeBSD system. Example: you have just ftp'ed the Linux binary of Doom. Put it on the Linux system you have access to, and check which shared libraries it needs by running `ldd linuxxdoom': % ldd linuxxdoom libXt.so.3 (DLL Jump 3.1) => /usr/X11/lib/libXt.so.3.1.0 libX11.so.3 (DLL Jump 3.1) => /usr/X11/lib/libX11.so.3.1.0 libc.so.4 (DLL Jump 4.5pl26) => /lib/libc.so.4.6.29

You would need go get all the files from the last column, and put them under /compat/linux, with the names in the first column as symbolic links pointing to them. This means you eventually have these files on your FreeBSD system: /compat/linux/usr/X11/lib/libXt.so.3.1.0 /compat/linux/usr/X11/lib/libXt.so.3 -> libXt.so.3.1.0 /compat/linux/usr/X11/lib/libX11.so.3.1.0 /compat/linux/usr/X11/lib/libX11.so.3 -> libX11.so.3.1.0 /compat/linux/lib/libc.so.4.6.29 /compat/linux/lib/libc.so.4 -> libc.so.4.6.29

Note that if you already have a Linux shared library with a matching major revision number to the first column of the 'ldd' output, you will not need to copy the file named in the last column to your system, the one you already have should work. It is advisable to copy the shared library anyway if it is a newer version, though. You can remove the old one, as long as you make the symbolic link point to the new one. So, if you have these libraries on your system: /compat/linux/lib/libc.so.4.6.27 /compat/linux/lib/libc.so.4 -> libc.so.4.6.27 and you find a new binary that claims to require a later version according to the output of ldd: libc.so.4 (DLL Jump 4.5pl26) -> libc.so.4.6.29 If it is only one or two versions out of date in the in the trailing digit then do not worry about copying /lib/libc.so.4.6.29 too, because the program should work fine with the slightly older version. However, if you like you can decide to replace the libc.so anyway, and that should leave you with: /compat/linux/lib/libc.so.4.6.29 /compat/linux/lib/libc.so.4 -> libc.so.4.6.29

Please note that the symbolic link mechanism is only needed for Linux binaries, the FreeBSD runtime linker takes care of looking for matching major revision numbers itself, you do not need to worry about that. Configuring the ld.so -- for FreeBSD-current only

This section applies only to FreeBSD-current only. Those running FreeBSD-stable should skip this section.

Finally, if you run FreeBSD-current you must make sure that you have the Linux runtime linker and its config files on your system. You should copy these files from the Linux system to their appropriate place on your FreeBSD system (to the /compat/linux tree): /compat/linux/lib/ld.so /compat/linux/etc/ld.so.config

If you do not have access to a Linux system, you should get the extra files you need from various ftp sites. Information on where to look for the various files is appended below. For now, let us assume you know where to get the files.

Retrieve the following files (all from the same ftp site to avoid any version mismatches), and install them under /compat/linux (i.e. /foo/bar is installed as /compat/linux/foo/bar): /sbin/ldconfig /usr/bin/ldd /lib/libc.so.x.y.z /lib/ld.so

ldconfig and ldd do not necessarily need to be under /compat/linux, you can install them elsewhere in the system too. Just make sure they do not conflict with their FreeBSD counterparts. A good idea would be to install them in /usr/local/bin as ldconfig-linux and ldd-linux.

Create the file /compat/linux/etc/ld.so.conf, containing the directories in which the Linux runtime linker should look for shared libs. It is a plain text file, containing a directory name on each line. /lib and /usr/lib are standard, you could add the following: /usr/X11/lib /usr/local/lib

When a linux binary opens a library such as /lib/libc.so the emulator maps the name to /compat/linux/lib/libc.so internally. All linux libraries should be installed under /compat/linux (e.g. /compat/linux/lib/libc.so, /compat/linux/usr/X11/lib/libX11.so, etc.) in order for the emulator to find them.

Those running FreeBSD-current should run the Linux ldconfig program. % cd /compat/linux/lib % /compat/linux/sbin/ldconfig

Ldconfig is statically linked, so it does not need any shared libraries to run. It creates the file /compat/linux/etc/ld.so.cache which contains the names of all the shared libraries. It should rerun to recreate this file whenever you install additional shared libraries. On FreeBSD-stable do not install /compat/linux/etc/ld.so.cache or run ldconfig becuase in FreeBSD-stable the syscalls are implemented differently and ldconfig is not needed or used.

You should now be set up for Linux binaries which only need a shared libc. You can test this by running the Linux ldd on itself. Suppose that you have it installed as ldd-linux, it should produce something like: % ldd-linux `which ldd-linux` libc.so.4 (DLL Jump 4.5pl26) => /lib/libc.so.4.6.29

This being done, you are ready to install new Linux binaries. Whenever you install a new Linux program, you should check if it needs shared libraries, and if so, whether you have them installed in the /compat/linux tree. To do this, you run the Linux version ldd on the new program, and watch its output. ldd (see also the manual page for ldd(1)) will print a list of shared libraries that the program depends on, in the form majorname (jumpversion) => fullname.

If it prints "not found" instead of fullname it means that you need an extra library. Which library this is, is shown in majorname, which will be of the form libXXXX.so.N You will need to find a libXXXX.so.N.mm on a Linux ftp site, and install it on your system. The XXXX (name) and N (major revision number) should match; the minor number(s) mm are less important, though it is advised to take the most recent version. Configuring the host name resolver

If DNS does not work or you get the messages resolv+: "bind" is an invalid keyword resolv+: "hosts" is an invalid keyword then you need to configure a /compat/linux/etc/host.conf file containing: order hosts, bind multi on where the order here specifies that /etc/hosts is searched first and DNS is searched second. When /compat/linux/etc/host.conf is not installed linux applications find FreeBSD's /etc/host.conf and complain about the incompatible FreeBSD syntax. You should remove `bind,' if you have not configured a name-server using the /etc/resolv.conf file.

Lastly, those who run FreeBSD-stable need to set an the RESOLV_HOST_CONF environment variable so that applications will know how to search the host tables. If you run FreeBSD-current you can skip this. For the /bin/csh shell use: setenv RESOLV_HOST_CONF /compat/linux/etc/host.conf For /bin/sh use: RESOLV_HOST_CONF=/compat/linux/etc/host.conf; export RESOLV_HOST_CONF Finding the necessary files

Note: the information below is valid as of the time this document was written, but certain details such as names of ftp sites, directories and distribution names may have changed by the time you read this.

Linux is distributed by several groups that make their own set of binaries that they distribute. Each distribution has its own name, like ``Slackware'' or ``Yggdrasil''. The distributions are available on a lot of ftp sites. Sometimes the files are unpacked, and you can get the individual files you need, but mostly they are stored in distribution sets, usually consisting of subdirectories with gzipped tar files in them. The primary ftp sites for the distributions are: sunsite.unc.edu:/pub/Linux/distributions tsx-11.mit.edu:/pub/linux/distributions

Some European mirrors: ftp.luth.se:/pub/linux/distributions ftp.demon.co.uk:/pub/linux/distributions src.doc.ic.ac.uk:/packages/linux/distributions

For simplicity, let us concentrate on Slackware here. This distribution consists of a number of subdirectories, containing separate packages. Normally, they are controlled by an install program, but you can retrieve files "by hand" too. First of all, you will need to look in the "contents" subdir of the distribution. You will find a lot of small text files here describing the contents of the separate packages. The fastest way to look something up is to retrieve all the files in the contents subdirectory, and grep through them for the file you need. Here is an example of a list of files that you might need, and in which contents-file you will find it by grepping through them: Library Package ld.so ldso ldconfig ldso ldd ldso libc.so.4 shlibs libX11.so.6.0 xf_lib libXt.so.6.0 xf_lib libX11.so.3 oldlibs libXt.so.3 oldlibs

So, in this case, you will need the packages ldso, shlibs, xf_lib and oldlibs. In each of the contents-files for these packages, look for a line saying ``PACKAGE LOCATION'', it will tell you on which `disk' the package is, in our case it will tell us in which subdirectory we need to look. For our example, we would find the following locations: Package Location ldso diska2 shlibs diska2 oldlibs diskx6 xf_lib diskx9

The locations called ``diskXX'' refer to the ``slakware/XX'' subdirectories of the distribution, others may be found in the ``contrib'' subdirectory. In this case, we could now retrieve the packages we need by retrieving the following files (relative to the root of the Slackware distribution tree): slakware/a2/ldso.tgz slakware/a2/shlibs.tgz slakware/x6/oldlibs/tgz slakware/x9/xf_lib.tgz

Extract the files from these gzipped tarfiles in your /compat/linux directory (possibly omitting or afterwards removing files you don't need), and you are done.

See also: ftp.freebsd.org:pub/FreeBSD/2.0.5-RELEASE/xperimnt/linux-emu/README /usr/src/sys/i386/ibcs2/README.iBCS2 How to Install Mathematica on FreeBSD

Contributed by &a.rich and &a.chuck This document shows how to install the Linux binary distribution of Mathematica 2.2 on FreeBSD 2.1.

Mathematica supports Linux but not FreeBSD as it stands. So once you have configured your system for Linux compatibility you have most of what you need to run Mathematica.

For those who already have the student edition of Mathematica for DOS the cost of upgrading to the Linux version at the time this was written, March 1996, was $45.00. It can be ordered directly from Wolfram at (217) 398-6500 and paid for by credit card. Unpacking the Mathematica distribution

The binaries are currently distributed by Wolfram on CDROM. The CDROM has about a dozen tar files, each of which is a binary distribution for one of the supported architectures. The one for Linux is named LINUX.TAR. You can, for example, unpack this into /usr/local/Mathematica: % cd /usr/local % mkdir Mathematica % cd Mathematica % tar -xvf /cdrom/LINUX.TAR Obtaining your Mathematica Password

Before you can run Mathematica you will have to obtain a password from Wolfram that corresponds to your `machine ID.'

Once you have installed the linux compatibility runtime libraries and unpacked the mathematica you can obtain the `machine ID' by running the program `mathinfo' in the Install directory. % cd /usr/local/Mathematica/Install % mathinfo LINUX: 'ioctl' fd=5, typ=0x89(), num=0x27 not implemented richc.isdn.bcm.tmc.edu 9845-03452-90255 % So, for example, the `machine ID' of `richc' is `9845-03452-90255'. You can ignore the message about the ioctl that is not implemented. It won't prevent Mathematica from running in any way and you can safely ignore it, though you will see the message every time you run Mathematica.

When you register with Wolfram, either by email, phone or fax, you'll give them the 'machine ID' and they will respond with a corresponding password consisting of groups of numbers. You need to add them both along with the machine name and license number in your mathpass file. You can do this by invoking: % cd /usr/local/Mathematica/Install % math.install It will ask you to enter your license number and the Wolfram supplied password. If you get them mixed up or for some reason the math.install fails, That's OK, because you can simply edit the file 'mathpass' in this same directory to correct the info manually.

After getting past the password, math.install will ask you if you accept their canned install defaults, or if you want to use your own. If you are like us and distrust all install programs, you probably want to specify the actual directories. Beware. Although the math.install program asks you to specify directories, it won't create them for you, so you should perhaps have a second window open with another shell so that you can create them before you give them to the install program. Or, if it fails, you can create the directories and then restart the math.install program. The directories we chose to create beforehand and specify to math.install were: /usr/local/Mathematica/bin for binaries /usr/local/Mathematica/man/man1 for man pages /usr/local/Mathematica/lib/X11 for the XKeysymb file You can also tell it to use /tmp/math.record for the system record file, where it puts logs of sessions. After this math.install will continue on to unpacking things and placing everything where it should go.

The Mathematica Notebook feature is included separately, as the X Front End, and you have to install it separately. To get the X Front End stuff correctly installed, cd into the /usr/local/Mathematica/FrontEnd directory and executed the ./xfe.install shell script. You'll have to tell it where to put things, but you don't have to create any directories because it uses all the same directories that had been created for math.install. When it finished, there should be a new shell script in /usr/local/Mathematica/bin called "mathematica".

Lastly, you need to modify each of the shell scripts that Mathematica has installed. At the beginning of every shell script in /usr/local/Mathematica/bin add the following line: XKEYSYMDB=/usr/local/Mathematica/lib/X11/XKeysymDB; export XKEYSYMDB This tells Mathematica were to find it's own version of the key mapping file XKeysymDB. Without this you will get pages of error messages about missing key mappings. On FreeBSD-stable you need to add the following as well: RESOLV_HOST_CONF=/compat/linux/etc/host.conf; export RESOLV_HOST_CONF This tells Mathematica to use the linux version of host.conf. This file has a different syntax from FreeBSD's host.conf, so you'll get an error message about /etc/host.conf if you leave this out.

You might want to also modify your /etc/manpath.config file to read the new man directory, and you may need to edit your ~/.cshrc file to add /usr/local/Mathematica/bin to your path.

That's about all it takes, With this you should be able to type "mathematica" and get a really slick looking Mathematica Notebook screen up. Mathematica has included the Motif user interfaces, but it's compiled in statically, so you don't need the Motif libraries. Good luck doing this yourself! Bugs

The Notebook front end is known to hang sometimes when reading notebook files with an error messages similar to: File .../Untitled-1.mb appears to be broken for OMPR.257.0 We haven't found the cause for this, but it only affects the Notebook's X window front end, not the mathematica engine itself. So the command line interface invoked by 'math' is unaffected by this bug. Acknowledgments

A well-deserved thanks should go to &a.sos; and &a.peter; who made linux emulation what it is today, and Michael Smith who drove these two guys like dogs to get it to the point where it runs Linux binaries better than linux! :-) diff --git a/handbook/scsi.sgml b/handbook/scsi.sgml index c0a0a02e6f..b5802216fd 100644 --- a/handbook/scsi.sgml +++ b/handbook/scsi.sgml @@ -1,891 +1,891 @@ - + What is SCSI?

Copyright © 1995, &a.wilko;.July 6, 1996. 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 rapidly becoming 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 do not know what single-ended means, do not 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. Quickly emerging are Ultra SCSI (also called Fast-20) and Ultra2 (also called Fast-40). Fast-20 is 20 mega-transfers per second (20 Mbytes/sec on a 8 bit bus), Fast-40 is 40 mega-transfers per second (40 Mbytes/sec on a 8 bit bus). 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 busses that reduces the cabling overhead and allows a higher maximum bus length. You might see names like SSA and Fiberchannel in this context. None of the serial buses are currently in widespread use (especially not in the typical FreeBSD environment). For this reason the serial bus types are not discussed any further. 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. Whether 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. I say 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 implies that you do not 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. From a performance standpoint you might want to seperate your older and newer (=faster) devices however. 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. FreeBSD uses this capability during boot to check out what devices are connected and whether they need any special treatment. 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: do no 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 by 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. As discussed before, bus speeds of 20 and 40 megatransfers/second are also emerging (Fast-20 == Ultra SCSI and Fast-40 == Ultra2 SCSI). 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 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. Fast-20 (Ultra SCSI) and Fast-40 allow for 20 and 40 megatransfers/second respectively. So, F20 is 20 Mbytes/second on a 8 bit bus, 40 Mbytes/second on a 16 bit bus etc. For F20 the max bus length is 1.5 meters, for F40 it becomes 0.75 meters. Be aware that F20 is pushing the limits quite a bit, so you'll quickly find out if your SCSI bus is electrically sound. 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. For Fast-20 and 40 don't even think about buses like this.. 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 its 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 (do not 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 traveling over your SCSI bus, you do not 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 store them. 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, or 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 slightly more elaborate circuit to give cleaner 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 favor 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. 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! 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 its 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 un-powered devices on a bus, the terminator power must be supplied to the bus via a diode. This prevents the backflow of current to un-powered 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 that 'reset' themselves after some time are sometimes used. 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. A pitfall is that one of the devices sharing the same ID sometimes even manages to answer to I/O requests! 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 buses 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 functional units of the tape changer 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, its 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 its 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 in order to load the FreeBSD kernel during boot. The SCSI host adapter or SCSI controller you have put in your AT/EISA/PCI/whatever bus to connect your disk therefore has its 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 64 heads and 32 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 is not. 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 lead to un-bootable systems or operating systems overwriting each others partitions. Using fdisk you should be able to see all partitions. You might have heard some talk of 'lying' devices? Older FreeBSD kernels used to report the geometry of SCSI disks when booting. An example from one of my systems: aha0 targ 0 lun 0: sd0: 636MB (1303250 total sec), 1632 cyl, 15 head, 53 sec, bytes/sec 512 Newer kernels usually do not report this information.. e.g. (bt0:0:0): "SEAGATE ST41651 7574" type 0 fixed SCSI 2 sd0(bt0:0:0): Direct-Access 1350MB (2766300 512 byte sectors) Why has this changed? 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 suspect at best, and nearly always misleading. When asked for a geometry , it is nearly always better to supply the geometry used by the BIOS, or if the BIOS is never going to know about this disk, (e.g. it is not a booting disk) to supply a fictitious geometry that is convenient. 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 its 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 loosely 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!). # [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 Ultrastor adapter] controller uha0 at isa? port "IO_UHA0" bio irq ? drq 5 vector uhaintr # Map SCSI buses to specific SCSI adapters controller scbus0 at ahc0 controller scbus2 at ahb0 controller scbus1 at uha0 # The actual SCSI devices 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 scbus1 target 3 [SCSI disk on the uha0] disk sd3 at scbus2 target 4 [SCSI disk on the ahb0] 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 ahc (Adaptec 274x) controller, then for an Adaptec 174x 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 on the corresponding bus. Wired down devices get 'first shot' at the unit numbers so the first non 'wired down' device, is allocated the unit number one greater than the highest 'wired down' unit number for that kind of device. So, if you had a SCSI tape at target ID 2 it would be configured as st2, as the tape at target ID 6 is wired down to unit number 1. Note that wired down devices need not be found to get their unit number. The unit number for a wired down device is reserved for that device, even if it is turned off at boot time. This allows the device to be turned on and brought on-line at a later time, without rebooting. Notice that a device's unit number has no relationship with its target ID on the SCSI bus. 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. [driver for Adaptec 174x] controller ahb0 at isa? bio irq 11 vector ahbintr [for Adaptec 154x] controller aha0 at isa? port "IO_AHA0" bio irq 11 drq 5 vector ahaintr [for Seagate ST01/02] controller sea0 at isa? bio irq 5 iomem 0xc8000 iosiz 0x2000 vector seaintr controller scbus0 device sd0 [support for 4 SCSI harddisks, sd0 up sd3] device st0 [support for 2 SCSI tapes] [for the cdrom] device cd0 #Only need one of these, the code dynamically grows Both examples support 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 simply allocate more devices, incrementing the unit number starting at the last number 'wired down'. If there are no 'wired down' devices then counting starts at unit 0. 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 (which happens at boot time). 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 the 'slow response' 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 +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 /kernel: ahb0 targ 5 lun 0: Feb 25 21:03:34 yedi /kernel: st0: Tandberg tdc3600 is a known rogue Mar 29 21:16:37 yedi /kernel: aha0 targ 5 lun 0: Mar 29 21:16:37 yedi /kernel: 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 reader. 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. See e.g. /sys/scsi/st.c and /sys/scsi/scsiconf.c for more info on how this is done. 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. After you got your Mumbletech working, please send the required workaround to the FreeBSD development team for inclusion in the next release of FreeBSD. Other Mumbletech owners will be grateful to you. Multiple LUN devices

In some cases you come across devices that use multiple logical units (LUNs) on a single SCSI ID. In most cases FreeBSD only probes devices for LUN 0. An example are so called bridge boards that connect 2 non-SCSI harddisks to a SCSI bus (e.g. an Emulex MD21 found in old Sun systems). This means that any devices with LUNs != 0 are not normally found during device probe on system boot. To work around this problem you must add an apropriate entry in /sys/scsi/scsiconf.c and rebuild your kernel. Look for a struct that is initialised like below: { T_DIRECT, T_FIXED, "MAXTOR", "XT-4170S", "B5A", "mx1", SC_ONE_LU } For you Mumbletech BRIDGE2000 that has more than one LUN, acts as a SCSI disk and has firmware revision 123 you would add something like: { T_DIRECT, T_FIXED, "MUMBLETECH", "BRIDGE2000", "123", "sd", SC_MORE_LUS } The kernel on boot scans the inquiry data it receives against the table and acts accordingly. See the source for more info. Tagged command queueing

Modern SCSI devices, particularly magnetic disks, support what is called tagged command queuing (TCQ). In a nutshell, TCQ allows the device to have multiple I/O requests outstanding at the same time. Because the device is intelligent, it can optimise it's operations (like head positioning) based on it's own request queue. On SCSI devices like RAID (Redundant Array of Independent Disks) arrays the TCQ function is indispensable to take advantage of the device's inherent parallelism. Each I/O request is uniquely identified by a 'tag' (hence the name tagged command queuing) and this tag is used by FreeBSD to see which I/O in the device drivers queue is reported as complete by the device. It should be noted however that TCQ requires device driver support and that some devices implemented it 'not quite right' in their firmware. This problem bit me once, and it leads to highly mysterious problems. In such cases, try to disable TCQ. 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 double check 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 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. Disable tagged command queuing to make things as simple as possible (for a NCR hostadapter based system see man ncrcontrol) If you can compile a kernel, make one with the SCSIDEBUG option, and try accessing the device with debugging turned on for that device. If your device does not even probe at startup, you may have to define the address of the device that is failing, and the desired debug level in /sys/scsi/scsidebug.h. If it probes but just does not work, you can use the scsi(8) command to dynamically set a debug level to it in a running kernel (if SCSIDEBUG is defined). This will give you COPIOUS debugging output with which to confuse the gurus. see man 4 scsi for more exact information. Also look at man 8 scsi. 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/sio.sgml b/handbook/sio.sgml index 116a5159f7..9e9861b4a4 100644 --- a/handbook/sio.sgml +++ b/handbook/sio.sgml @@ -1,207 +1,207 @@ - + Configuring the sio driver

The sio 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 sio(4) manual page for detailed technical documentation. Digi International (DigiBoard) PC/8

Contributed by &a.awebster;.26 August 1995. Here is a config snippet from a machine with a Digi International PC/8 with 16550. It has 8 modems connected to these 8 lines, and they work just great. Do not - forget to add options "COM_MULTIPORT" or it + forget to add options COM_MULTIPORT or it will not work very well! 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 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. Boca 16

Contributed by &a.whiteside;.26 August 1995. The procedures to make a Boca 16 pord board with FreeBSD are pretty straightforward, but you will need a couple things to make it work: 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 not come with multiport support enabled and you will need to add a device entry for each port anyways. 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. 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 for general procedures. The following are the specifics for the Boca 16 board and assume you are using the kernel name MYKERNEL and editing with vi. Add the line -options "COM_MULTIPORT" +options COM_MULTIPORT to the config file. Where the current device sio xxx lines are, you will need to add 16 more devices. Only the last device includes the interrupt vector for the board. (See the sio(4) 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 hexadecimal from the previous port, thus the 100h, 108h, 110h... addresses. 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 The flags entry must be changed from this example unless you are using the exact same sio assignments. Flags are set according to 0xMYY where M indicates the minor number of the master port (the last port on a Boca 16) and YY 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, flags 0x1005 indicates that the master port is sio16. If I added another board and assigned sio17 through sio28, the flags for all 16 ports on that board would be 0x1C05, where 1C indicates the minor number of the master port. Do not change the 05 setting. 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) 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) If the messages go by too fast to see, dmesg > more will show you the boot messages. Next, appropriate entries in /dev for the devices must be made using the /dev/MAKEDEV script. After becoming root: # cd /dev # ./MAKEDEV tty1 # ./MAKEDEV cua1 (everything in between) # ./MAKEDEV ttyg # ./MAKEDEV cuag If you do not want or need callout devices for some reason, you can dispense with making the cua* devices. 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) echo at > ttyd* for each device you have made. You should see the RX lights flash for each working port.