Before you install
Using old hardware; PC Hardware; How the system detects hardware; Configuring ISA cards; PCMCIA, PC Card and Card Bus; Universal Serial Bus; Disks; Disk data layout; Making the file systems; Disk size limitations; Display hardware; The hardware; Compaq/Digital Alpha machines; The CD-ROM distribution.
FreeBSD runs on just about any modern PC, Alpha or 64 bit SPARC machine. You can skip this chapter and the next and move to chapter 3, and you'll have a very good chance of success. Nevertheless, it makes things easier to know the contents of this chapter before you start. If you do run into trouble, it will give you the background information you need to solve the trouble quickly and simply.
FreeBSD also runs on most Intel-based laptops; in general the considerations above apply for laptops as well In the course of the book we'll see examples ol where laptops require special treatment.
Most of the information here applies primarily to Intel platforms. We'll look at the Compaq Alpha architecture on page 42. The first release of FreeBSD to support the SPARC 64 architecture is 5.0, and support is still a little patchy. At the time ol going to press, it's not worth describing, since it will change rapidly. The instructions on the CD-ROM distribution are currendy the best source ol information on running FreeBSD on SPARC 64.
Using old hardware
FreeBSD runs on all relatively recent machines. In addition, a lot of older hardware that is available for a nominal sum, or even for free, runs FreeBSD quite happily, though you may need to take more care in the installation.
FreeBSD does not support all PC hardware: the PC has been on the market for over 20 years, and it has changed a lot in that time. In particular:
- • FreeBSD does not support 8 bit and 16 bit processors. These include the 8086 àïâ 8088, which were used in the IBM PC and PC-XT and clones, and the 80286, used in the IBM PC-ÀÃ and clones.
- • The FreeBSD kernel no longer supports ST-506 and ESDI drives. You're unlikely to have any of these: they're now so old that most of them have failed. The wd driver still includes support for them, but it hasn't been tested, and if you want to use this kind of drive you might find it better to use FreeBSD Release 3. See page 32 to find out how to identify these drives. You can get Release 3 of FreeBSD from ññûëêà: ftpy/ftp.FreeBSD.org/pub/FreeBSD/releases/i386/3.x-STABLE. You'D have toper-form a network installation.
- • Memory requirements for FreeBSD have increased significandy in the last few years, and you should consider 16 MB a minimum size, though nobody has recendy checked whether it wouldn't install in, say, 12MB. FreeBSD Release 3 still runs in 4 MB, though you need 5 MB for installation.
If you're planning to install FreeBSD on an old machine, consider the following to be an absolute minimum:
- • PC with 80386 CPU, Alpha-based machine with SRM firmware.
- • 16 MB memory (Intel) or 24 MB (Alpha).
- • 80 MB free disk space (Intel). Nobody has tried an installation on an Alpha or SPARC machine with less than 500 MB, though you can probably reduce this value significandy.
You don't absolutely need a keyboard and display board: many FreeBSD machines run server tasks with neither keyboard nor display. Even then, though, you may find it convenient to put a display board in the machine to help in case you run into trouble.
When I say absolute minimum, I mean it. You can't do very much with such a minimal system, but for some purposes it might be adequate. You can improve the performance of such a minimal system significandy by adding memory. Before you go to the trouble to even try such a minimal installation, consider the cost of another 16 MB of memory. And you can pick up better machines than this second-hand for $50. Is the hassle worth it?
To get full benefits from a desktop or laptop FreeBSD system (but not from a machine used primarily as a server), you should be running the X Wmdow system. This uses more memory. Consider 32 MB a usable minimum here, though thanks to FreeBSD's virtual memory system, this is not such a hard limit as it is with some other systems.
The speed of a virtual memory-based system such as FreeBSD depends at least as much on memory performance as on processor performance. If you have, say, a 486DX-33 and 16 MB of memory, upgrading memory to 32 MB will probably buy you more performance than upgrading the motherboard to a Pentium 100 and keeping the 16 MB memory This applies for a usual mix of programs, in particular, programs that don't perform number crunching.
Any SPARC 64 machine runs FreeBSD acceptably, as the machines are relatively new. If you're running Intel or Alpha, consider the following the minimum for getting useful work done with FreeBSD and X:
- • PC with 80486DX/2-66, or Alpha-based machine
- • 32 MB memory (i386) or 64 MB (Alpha)
- • SVGA display board with 2 MB memory, 1024x768
- • Mouse
- • 200 MB free disk space
Your mileage may vary. During the review phase of an earlier edition of this book, one of the reviewers stated that he was very happy with his machine, which has a 486-33 processor, 16MB main memory, and 1 MB memory on his display board. He said that it ran a lot faster than his Pentium 100 at work, which ran Microsoft. The moral if your hardware doesn't measure up to the recommended specifi cation, don't be discouraged. Try it out anyway.
Beyond this minimum, FreeBSD supports a large number of other hardware components.
Device drivers
The FreeBSD kernel is the only part of the system that can access the hardware. It includes device drivers, which control the function of peripheral devices such as disks, displays and network boards. When you install new hardware, you need a driver for it.
There are two ways to get a driver into the kernel you can build a kernel that includes the driver code, or you can load a driver module (Kernel Loadable Module or kid) into the kernel at run time. Not all drivers are available as kids. If you need one of these drivers, and it's not included in the standard kernel, you have to build a new kernel We look at building kernels in Chapter 33.
The kernel configuration supplied with FreeBSD distributions is called GENERIC after the name of the configuration file that describes it. It contains support for most common devices, though support for some older hardware is missing, usually because it conflicts with more modern drivers. For a full list of currently supported hardware, read the web page ññûëêà: httpy/www.FreeBSD.or^releases/ and select the link Hardware Notes for the release you're interested in. This file is also available on installed FreeBSD systems as ññûëêà: /usr/share/doc/en_US.ISO_8859-l/books/faq/hardware.htmL It is also available in other languages; see the subdirectories of/usr/share/doc.
PC Hardware
This section looks at the information you need to understand to install FreeBSD on the i386 architecture. In particular, in the next section we'll look at how FreeBSD detects hardware, and what to do if your hardware doesn't correspond to the system's expectations. On page 32 we'll see how FreeBSD and other PC operating systems handle disk space, and how to set up your disk for FreeBSD.
Some of this information also applies to the Alpha and SPARC 64 architectures. We'll look at the differences for the Alpha architecture on page 42. Currently the SPARC 64 implementation is changing too fast to describe it in a meaningful manner.
Since the original PC, a number of hardware standards have come, and some have gone:
- • The original PC had an 8 bit bus. Very few of these cards are still available, but they are compatible with the ISA bus (see the next item).
- • The PC AT, introduced in 1984, had a 16 bit 80286 processor. To support this processor, the bus was widened to 16 bits. This bus came to be known as the Industry Standard Architecture, or ISA.This standard is still not completely dead, and many new mother boards support it. Most older motherboards have a number of ISA slots.
- • The ISA bus has a number of severe limitations, notably poor performance. This became a problem very early. In 1985, IBM introduced the PS/2 system, which addressed this issue with a new bus, the so-called Micro Channel Architecture or MCA. Although successful for IBM, MCA was not adopted by other manufacturers, and FreeBSD does not support it at all IBM no longer produces products based on MCA
- • In parallel to MCA, other manufacturers introduced a bus called the Extended Industry Standard Architecture, or EISA. As the name suggests, it is a higher-performance extension of ISA, and FreeBSD supports it. Like MCA, it is obsolete.
- • EISA still proved to be not fast enough for good graphics performance. In the late 80s, a number of local bus solutions appeared. They had better performance, but some were very unreliable. FreeBSD supported most ol them, but you can't rely on it. It's best to steer clear of them
- • Finally, in the early 1990s, Intel brought out a new bus called Peripheral Component Interconnect, or PCI. PCI is now the dominant bus on a number of architectures. Most modern PC add-on boards are PCI.
- • Compared to earlier buses, PCI is much faster. Most boards have a 32bit wide data bus, but there is also a 64 bit PCI standard. PCI boards also contain enough intelligence to enable the system to configure them, which greatly simplifies installation of the system or of new boards.
- • Modem motherboards also have an AGP (Accelerated Graphics Port) slot specifically designed to support exactly one graphic card. As the name implies, it's faster even than PCI, but its optimized for graphics only. FreeBSD supports it, of course otherwise it couldn't run on modem hardware.
- • Most laptops have provision for external plug-in cards that conform to the PC Card (formerly called PCMCIA) or CardBus standards. These cards are designed to be inserted into and removed from a running system FreeBSD has support for these cards; we'll look at them in more detail on page 30.
- • More and more, the basic serial and parallel ports installed on early PCs are being replaced by a Universal Serial Bus or USB. We’ll look at it on page 31.
How the system detects hardware
When the system starts, each driver in the kernel examines the system to find any hardware that it might be able to control This examination is called probing. Depending on the driver and the nature of the hardware it supports, the probe may be clever enough to set up the hardware itself, or to recognize its hardware no matter how it has been set up, or it may expect the hardware to be set up in a specific manner in order to find it. In general you can expect PCI drivers to be able to set up the card to work correctly. In the case of ISA or EISA cards, you
G. Lehey FreeBSD Operating System
may not be as lucky.
Configuring ISA cards
ISA cards are rapidly becoming obsolete, but sometimes they're still useful:
- • ISA graphics cards are very slow in comparison with modem graphic cards, but if you just want a card for maintenance on a server machine that normally doesn't display anything, this is an economical alternative.
- • Some ISA disk controllers can be useful, but they are sharply limited in performance.
- • ISA Ethernet cards may be a choice for low-volume networking.
- • Many ISA serial cards and built-in modems are still available.
Most ISA cards require some configuration. There are four main parameters that you may need to set for PC controller boards:
1. The port address is the address of the first of possibly several control registers that the driver uses to communicate with the board. It is normally specified in hexadecimal, for example 0x320
If you come from a Microsoft background, you might be more used to the notation 320H. The notation 0x320 comes from the C programming language. You’ll see a lot of it in UNIX
Each board needs its own address or range of addresses. The ISA architecture has a sharply limited address range, and one of the most frequent causes of problems when installing a board is that the port addresses overlap with those of another board
Beware of boards with a large number of registers. Typical port addresses end in (hexadecimal) 0. Don't rely on being able to take any unoccupied address ending in 0, though: some boards, such as Novell NE2000 compatible Ethernet boards, occupy up to 32 registers—or example, from 0x320 to 0x33f. Note also that a number of addresses, such as the serial and parallel ports, often end in 8.
2. Boards use an Interrupt Request, also referred to as IRQ, to get the attention of the driver when a specific event happens. For example, when a serial interface reads a character it generates an interrupt to tell the driver to collect the character. Interrupt requests can sometimes be shared, depending on the driver and the hardware. There are even fewer interrupt requests than port addresses: a total of 15, of which a number are reserved by the motherboard. You can usually expect to be able to use IRQs 3, 4, 5, 7, 9, 10, 11 and 12. IRQ 2 is special: due to the design of the original IBM PC/AT, it is the same thing as IRQ 9. FreeBSD refers to this interrupt as IRQ 9
As if the available interrupts weren't already restricted enough, ISA and PCI boards use the same set of interrupt lines. PCI cards can share interrupt lines between multiple boards, and in fact the PCI standard only supports four interrupts, called INTA, INTB, INTC and INTD. In the PC architecture they map to four of the 15 ISA interrupts. PCI cards are selfconfiguring, so all you need to do is to ensure that PCI and ISA interrupts don't conflict. You normally set this up in a BIOS setup menu.
- 3. Some high-speed devices perform Direct Memory Access, also known as DMA, to transfer data to or from memory without CPU intervention. To transfer data, they assert a DMA Request (DRQ) and wait for the bus to reply with a DMA Acknowledge (DACK). The combination of DRQ and DACK is sometimes called a DMA Channel The ISA architecture supplies 7 DMA channels, numbered 0 to 3 (8 bit) and 5 to 7 (16 bit). The floppy driver uses DMA channel 2. DMA channels may not be shared.
- 4. Finally, controllers may have on-board memory, sometimes referred to as I/O memory or lOmem It is usually located at addresses between OxaOOOO and Oxeffff.
If the driver only looks at specific board configurations, you can set the board to match what the driver expects, typically by setting jumpers or using a vendor-supplied diagnostic program to set on-board configuration memory, or you can build a kernel to match the board settings.
PCMCIA, PC Card and CardBus
Laptops don't have enough space for normal PCI expansion slots, though many use a smaller PCI card format. It's more common to see PC Card or CardBus cards, though. PC Card was originally called PCMCIA, which stands for Persona] Computer Memory Card International Association: the first purpose of the bus was to expand memory. Nowadays memory expansion is handled by other means, and PC Card cards are usually peripherals such as network cards, modems or disks. It's true that you can insert compact flash memory for digital cameras into a PC Card adapter and access it from FreeBSD, but even in this case, the card looks like a disk, not a memory card.
The original PC Card standard already has one foot in the grave: it’s a 16 bit bus that doesn't work well with modern laptops. The replacement standard has a 32 bit wide bus and is called CardBus.The cards look almost identical, and most modem laptops support both standards. In this book ÃÏ use use the term PC Card to include CardBus unless otherwise stated. FreeBSD Release 5 includes completely new PC Card code. It now supports both 16 bit PC Card and 32 bit CardBus cards.
PC Card offers one concept that conventional cards don't: the cards are hot swappable. You can insert them and remove them in a running system This poses a number of potential problems, some of which are only partially solved.
PC Card and CardBus cards
PC Card and CardBus both use the same form factor cards: they are 54 mm wide and at least 85 mm long, though some cards, noticeably wireless networking cards, are up to 120 mm long and project beyond the casing of the laptop. The wireless cards contain an antenna in the part of the card that projects from the machine.
PC Card cards can have one of three standard thicknesses:
- • Type 1 cards are 3.3 mm thick. They're very uncommon.
- • Type 2 cards are 5 mm thick. These are the most common type, and most laptops take two of them
- • Type 3 cards are 10.5 mm thick. In most laptops you can normally insert either one type 3 card or two type 2 cards.
The GENERIC FreeBSD kernel contains support for PC Card, so you don't need to build a new kernel
G. Lehey FreeBSD Operating System
Universal Serial Bus
The Universal Serial Bus (USB) is a new way of connecting external peripherals, typically those that used to be connected by serial or parallel ports. It's much faster than the old components: the old serial interface had a maximum speed oi 115,200 bps, and the maximum you can expect to transfer over the parallel port is about 1 MB/s. By comparison, current USB implementations transfer data at up to 12 Mb/s, and a version with 480 Mb/s is in development.
As the name states, USB is a bus: you can connect multiple devices to a bus. Currently the most common devices are mid-speed devices such as printers and scanners, but you can connect just about anything, including keyboards, mice, Ethernet cards and mass storage devices.
Disks
A number of different disks have been used on PCs:
- • ST-506 disks are the oldest. You can recognize them by the fact that they have two cables: a control cable that usually has connections for two disks, and a thinner data cable that is not shared with any other disk. They're just about completely obsolete by now, but FreeBSD Release 3 still supports them with the wd driver. These disks are sometimes called by their modulation format, Modified Frequency Modulation or MFM. A variant of MFM that offers about 50% more storage is RLL or Run Length Limited modulation. From the operating system point of view, there is no difference between MFM and RLL.
- • ESDI (Enhanced Small Device Interface) disks were designed to work around some of the limitations of ST-506 drives. They also use the same cabling as ST-506, but they are not hardware compatible, though most ESDI controllers understand ST-506 commands. They are also obsolete, but the wd driver in FreeBSD Release 3 supports them, too.
- • IDE (Integrated Device Electronics) , now frequently called AIA (AT Attachment) , is the current low-cost PC disk interface. It supports two disks connected by a single 40 or 80 conductor fat cable. The connectors for both cables are the same, but the 80 conductor cable is needed for the 66 MHz, 100 MHz and 133 MHz transfer rates supported by recent disk drives
G. Lehey FreeBSD Operating System
All modem IDE disks are so-called EIDE (Enhanced IDE) drives. The original IDE disks were limited by the PC BIOS standard to a size of 504 MB (1024 [1] 16 1 63 1 512, or 528,482,304 bytes). EIDE drives exceed this limit by several orders of magnitude
A problem with older IDE controllers was that they used programmed I/O or PIO to perform the transfer. In this mode, the CPU is directly involved in the transfer to or from the disk. Older controllers transferred a byte at a time, but more modem controllers can transfer in units of 32 bits. Either way, disk transfers use a large amount of CPU time with programmed I/O, and it's difficult to achieve the transfer rates of modem IDE drives, which can be as high as 100 MB/s. During such transfers, the system appears to be unbearably slow: it " grinds to a halt. "
To solve this problem, modern chipsets offer DMA transfers, which almost completely eliminate CPU overhead. There are two kinds of DMA, each with multiple possible transfer modes. The older DMA mode is no longer in use. It handled transfer rates between 2.1 MB/s and 16.7 MB/s. The newer UDMA (Ultra DMA) mode supports transfer rates between 16.7 MB/s and 133 MB/s. Current disks use UDMA33 (33 MHz transfer rate), which is the fastest rate you can use with a 40 conductor cable, and UDMA66 (66 MHz), UDMA100 (100 MHz) and UDMA-133 (133 MHz) with an 80 conductor cable. To get this transfer rate, both the disk and the disk controller must support the rate. FreeBSD supports all UDMA modes.
Another factor influencing IDE performance is the fact that most IDE controllers and disks can only perform one transfer at a time. If you have two disks on a controller, and you want to access both, the controller serializes the requests so that a request to one drive completes before the other starts. This results in worse performance than on a SCSI chain, which does not have this restriction. If you have two disks and two controllers, it's better to put one disk on each controller. This situation is gradually changing, so when choosing hardware it's worth checking on current support for tagged queueing, which allows concurrent transfers.
G. Lehey FreeBSD Operating System devices are connected by a single fat cable, with 50 conductors (" narrow SCSI," which connects a total of 8 devices) or 68 conductors ("wide SCSI," which also connects up to 16 devices). Some SCSI devices have subdevices, for example CD-ROM changers. SCSI drives have a reputation for much higher performance than IDE. This is mainly because nearly all SCSI host adapters support DMA, whereas in the past IDE controllers usually used programmed I/O. In addition, SCSI host adapters can perform transfers from multiple units at the same time, whereas IDE controllers can only perform one transfer at a time. Typical SCSI drives are still faster than IDE drives, but the difference is nowhere near as large as it used to be. Narrow SCSI can support transfer rates oi up to 40 MB/s (Ultra 2), and wide SCSI can support rates of up to 320 MB/s (Ultra 320). These speeds are not necessarily faster than IDE: you can connect more than seventies as many devices to a wide SCSI chain. Disk data layout Before you install FreeBSD, you need to decide how you want to use the disk space available to you. If desired, FreeBSD can coexist with other operating systems on the Intel platform In this section, we'll look at the way data is laid out on disk, and what we need to do to create FreeBSD file systems on disk. PC BIOS and disks The basics of disk drives are relatively straightforward: data is stored on one or more rotating disks with a magnetic coating similar in function to the coating on an audio tape. Unlike a tape, however, disk heads do not touch the surface: the rotating disk produces an air pressure against the head, which keeps it floating very close to the surface. The disk has (usually) one read/write head for each surface to transfer data to and from the system. People frequently talk about the number of heads, not the number of surfaces, though strictly speaking this is incorrect: if there are two heads per surface (to speed up access), you're still interested in the number of surfaces, not the number of heads. While transferring data, the heads are stationary, so data is written on disks in a number of concentric circular tracks. Logically, each track is divided into a number G. Lehey FreeBSD Operating System of sectors, which nowadays almost invariably contain 512 bytes. A single positioning mechanism moves the heads from one track to another, so at any one time all the tracks under the current head position can be accessed without repositioning. This group of tracks is called a cylinder. Since the diameter of the track differs from one track to the other, so does the storage capacity per track. Nevertheless, for the sake of simplicity, older drives, such as ST-506 (MFM and RLL) drives, had a fixed number of sectors per track. To perform a data transfer, you needed to tell the drive which cylinder, head and sector to address. This mode of addressing is thus called CHS addressing. Modern disks have a varying number of sectors per track on different parts of the disk to optimize the storage space, and for the same reason they normally store data on the disk in much larger units than sectors. Externally, they translate the data into units of sectors, and they also optionally maintain the illusion of "tracks" and "heads," though the values have nothing to do with the internal organization of the disk. Nevertheless, BIOS setup routines still give you the option of specifying information about disk drives in terms of the numbers of cylinders, heads and sectors, and some insist on it. In reality, modern disk drives address sectors sequentially, so-called Logical Block Addressing or LB A. CHS addressing has an additional problem: various standards have limited the size of disks to 504 MB or 8 GB. We'll look at that in more detail on page 39. SCSI drives are a different matter: the system BIOS normally doesn't know anything about them. They are always addressed in LBA mode. It's up to the host adapter to interrogate the drive and find out how much space is on it. Typically, the host adapter has a BIOS that interrogates the drive and finds its dimensions. The values it determines may not be correct: the PC BIOS 1 GB address limit (see page 39) might bite you. Check your host adapter documentation for details. Disk partitioning The PC BIOS divides the space on a disk into up to four partitions, headed by a partition table. For Microsoft systems, each partition may be either a primary partition that contains a file system (a "drive" in Microsoft terminology), or an extended partition that contains multiple file systems (or 'logical partitions"). FreeBSD does not use the PC BIOS partition table directly. It maintains its own G. Lehey FreeBSD Operating System partitioning scheme with its own partition table. On the PC platform, it places this partition table in a single PC BIOS partition, rather in the same way that a PC BIOS extended partition contains multiple "logical partitions." It refers to PC BIOS partitions as "slices." This double usage of the word partition is really confusing. In this book, I follow BSD usage, but I continue to refer to the PC BIOS partition table by that name. Partitioning offers the flexibility that other operating systems need, so it has been adopted by all operating systems that run on the PC platform Figure 2-1 shows a disk with all four slices allocated. The Partition Table is the most important data structure. It contains information about the size, location and type of the slices (PC partitions). The PC BIOS allows one of these slices to be designated as active: at system startup time, its bootstrap record is used to start the system The partition table of a boot disk also contains a Master Boot Record (MBR), which is responsible for finding the correct slice and booting it. The MBR and the partition table take up the first sector on disk, and many people consider them to be the same thing. You only need an MBR on disks from which you boot the system Master Boot Record Partition Table Partition (slice) 1 /dev/daOsl Partition (slice) 2 /dev/da0s2 Partition (slice) 3 /dev/daOsJ Partition (slice) 4 /dev/da0s4 Ðèñ.2.1. Partition table G. Lehey FreeBSD Operating System PC usage designates at least one slice as the primary partition, the C : drive. Another slice may be designated as an extended partition that contains the other "drives" (all together in one slice). UNIX systems have their own form of partitioning which predates the PC and is not compatible with the PC method. As a result, all versions of UNIX that can coexist with Microsoft implement their own partitioning within a single slice (PC BIOS partition). This is conceptually similar to an extended partition. FreeBSD systems define up to eight partitions per slice. They can be used for the following purposes: Block and character devices Traditional UNIX treats disk devices in two different ways. As we have seen, you can think of a disk as a large number of sequential blocks of data. Looking at it like this doesn't give you a file system—it's more like treating it as a tape. UNIX calls this kind of access raw access. You'll also hear the term character device. Normally, of course, you want files on your disk: you don't care where they are, you just want to be able to open them and manipulate them In addition, for performance reasons the system keeps recently accessed data in a buffer cache. This involves a whole lot more work than raw devices. These devices are called block devices. G. Lehey FreeBSD Operating System By contrast with UNIX, Linux originally did not have character disk devices. Starting with Release 4.0, FreeBSD has taken the opposite approach: there are now no user-accessible block devices anymore. There are a number of reasons for this: • Having two different names for devices is confusing. In older releases of FreeBSD, you could recognize block and character devices in an 1 s -1 listing by the letters b and c at the beginning of the permissions. For example, in FreeBSD 3.1 you might have seen: $ Is -1/dev/rwdOsla /dev/wdOsla crw-r— 1 root operator 3, 131072 Oct 31 19:59 /dev/rwdOsla brw-r— 1 root operator 0, 131072 Oct 31 19:59 /dev/wdOsla wd is the old name for the current ad disks. The question is: when do you use which one? Even compared to UNIX System V, the rules were different. The removal of block devices caused significant changes to device naming. In older releases of FreeBSD, the device name was the name of the block device, and the raw (character) device had the letter r at the beginning of the name, as shown in the example above. Let's look more carefully at how BSD names its partitions: The original releases of FreeBSD had the abbreviation wd for IDE drives. This abbreviation arose because the most popular of the original MFM controllers were made by Western Digital Others claim, however, that it's an abbreviation for & Winchester Disk.& SCSI disks were originally abbreviated sd The name da comes from the CAM standard and is short for direct access. BSD/OS, NetBSD and OpenBSD still use the old names. • Next comes the unit number, generally a single digit. For example, the first SCSI disk on the system would normally be called /dev/daO. Generally, the numbers are assigned during the boot probes, but you can reserve numbers for SCSI disks if you want. This prevents the removal of a single disk from changing the numbers of all subsequent drives. See page 575 for more details. • Next comes the partition information. The so-called strict slice name is specified by adding the letter s (for slice) and the slice number (1 to 4) to the disk name. BSD systems name partitions by appending the letters a to h to the disk name. Thus, the first partition of the first slice of our disk above (which would typically be a root file system) would be called /dev/daOsla. Some other versions of BSD do not have the same support for slices, so they use a simpler terminology for the partition name. Instead of calling the root file system /dev/daOsla, they refer to it as /dev/daOa. FreeBSD supports this method as well— it's called compatibility slice naming. The compatibility slice is simply the first FreeBSD slice found on the disk, and the partitions in this slice have two different names, for example /dev/adOsla and /dev/adOa. Figure 2-2 shows a typical layout on a system with a single SCSI disk, shared between Microsoft and FreeBSD. You'H note that partition /dev/da0s3c is missing from the FreeBSD slice, since it isn't a real partition. Like the PC BIOS partition table, the disk label contains information necessary for FreeBSD to manage the FreeBSD slice, such as the location and the lengths of the individual partitions. The bootstrap is used to load the kernel into memory. We’ll look at the boot process in more detail in Chapter 29 . Ðèñ. 2.2. Partition table with FreeBSD file system Table 2-1 gives you an overview of the devices that FreeBSD defines for this disk. Òàáëèöà 2.1. Disk partition terminology Slice name Usage /dev/daOsl First slice (PC BIOS C: partition) /dev/da0s2 Second slice (PC BIOS extended partition) /dev/da0s3 Third slice (PC BIOS partition), FreeBSD G. Lehey FreeBSD Operating System /dev/da0s5 First drive in extended PC BIOS partition (D:) /dev/da0s6 Second drive in extended PC BIOS partition (E:) /dev/da0s3a Third slice (PC BIOS partition), partition a (root file system) /dev/da0s3b Third slice (PC BIOS partition), partition b (swap space) /dev/da0s3c Third slice (PC BIOS partition), entire partition /dev/da0s3e Third slice (PC BIOS partition), partition e (/usr file system) /dev/daOa Compatibility partition, root file system, same as /dev/daOsla /dev/daOb Compatibility partition, swap partition, same as /dev/daOslb /dev/daOc Whole BSD slice, same as /dev/daOslc /dev/daOe Compatibility partition, usr file system, same as /dev/daOsle Making the file systems Armed with this knowledge, we can now proceed to make some decisions about how to install our systems. First, we need to answer some questions: If you already have another system installed on the disk, it is best to use that system's tools for manipulating the partition table. FreeBSD does not normally have difficulty with partition tables created by other systems, so you can be reasonably sure that the other system will understand what it has left. If the other system is Microsoft, and you have a slice that you don't need, use the MS-DOS FDISK program to free up enough space to install FreeBSD. If you don't have a slice to delete, you can use the FIPS program to create one—see Chapter 5 , Installing FreeBSD, page 52. If for some reason you can't use MS-DOS FDISK, for example because you're installing FreeBSD by itself, FreeBSD also supplies a program called fdisk that manipulates the partition table. Normally you invoke it indirectly via the sysinstall program—see page 63. Disk size limitations G. Lehey FreeBSD Operating System Disk storage capacity has grown by several orders of magnitude since FreeBSD was first released. As it did so, a number of limits became apparent: Other systems, including many versions of UNIX System V, have problems with this limit because 231 is the largest number that can be represented in a 32 bit signed integer. FreeBSD does not have this limitation, as file sizes are represented in 64 bit quantities. None of these problems affect FreeBSD directly. The FreeBSD bootstrap no longer uses the system BIOS, so it is not bound by the restrictions of the BIOS and the controller. If you use another operating system's loader, however, you could have problems. If you have the choice, use LBA addressing. Unfortunately, you can't do so if the disk already contains software that uses CHS addressing. Other things to consider are: Display hardware For years, UNIX users have worked with a single 80x25 character mode display. Many people consider this extremely old-fashioned, but in fact the flexibility of the UNIX system made this quite a good way to work. Still, there's no doubt of the advantage of a system that offers the possibility of performing multiple operations at once, and this is one of the particular advantages of UNIX. But you normally need a terminal to interact with each task. The best way to do this is with the X Window System. You might also want to use a desktop, a set of programs that offer commonly used functionality. In many other environments, the GUI and the graphical display are the same thing, and in some systems, notably Microsoft, there is no clear distinction between the operating system and the GUI. In UNIX, there are at least four levels of abstraction: Why do it this way? Because it gives you more choice. There are dozens ol window managers available, and also several desktops. You're not locked in to a single product. This has its down side, though: you must make the choice, and so setting up X requires a little more thought than installing Microsoft. The hardware X runs on almost any hardware. That doesn't mean that aft hardware is equal, of course. Here are some considerations: The keyboard X uses the keyboard a lot more than Microsoft. Make sure you get a good one. The mouse X prefers a three-button mouse, though it has provisions for up to five buttons. It can support newer mice with rollers and side buttons, but most software does not use them. Some mice, such as the Logitech wireless mouse, require undocumented sequences to enable some buttons (the thumb button in the case of Logitech). X does not support this button. Get the best mouse you can. Prefer a short, light switch. It must have at least three buttons. Accept no substitutes. Look for one with an easy-to-use middle button. Frequently mice with both a middle button and a roller make it difficult to use the G. Lehey FreeBSD Operating System middle button: it's either misplaced, too heavy in action, or requires pressing on the roller (and thus possibly turning it). All of these prove to be a nuisance over time. Older mice connected via the serial port or a special card (&bus mouse&). Nowadays most mice are so-called PS/2 mice, and USB mice are becoming more popular. The display board and monitor X enables you to do a lot more in parallel than other windowing environments. As a result, screen real estate is at a premium. Use as big a monitor as you can afford, and as high a resolution as your monitor can handle. You should be able to display a resolution of 1600x1200 on a 21" monitor, 1280x1024 on a 17" monitor, and 1024x768 on a 14" monitor. Premium quality 21" monitors can display 2048x1536. If that’s not enough, we'll look at multiple monitor configurations on page 523. Laptop hardware If you have a laptop, you don't get any choice. The display has a native resolution which you can't change. Most laptops display lower resolutions by interpolation, but the result looks much worse than the native resolution. LCD screens look crisper than CRT monitors, so you can choose higher resolutions modem laptops have display resolutions of up to 1600x1200. If you're going to use your laptop for presentations with overhead projectors, make sure you find one that can display both on the internal screen and also on the external output at the same time, while maintaining a display resolution of 1024x768: not many over head projectors can display at a higher resolution. Compaq/Digital Alpha machines FreeBSD also supports computers based on the Compaq (previously Digital) AXP processor, commonly called Alpha. Much of the information above also applies to the Alpha; notable exceptions are: In this section we'll look at some additional topics that only apply to the Alpha. FreeBSD requires the SRM console firmware, which is used by Tru64 (formerly known as Digital UNIX). It does not work with the ARC firmware (sometimes called AlphaBIOS) used with Microsoft NT. The SRM firmware runs the machine in 64 bit mode, which is required to run FreeBSD, while the ARC firmware sets 32 bit mode. If your system is currendy running Tru64, you should be able to use the existing SRM console. The SRM console commands differ from one version to another. The commands supported by your version are described in the hardware manual that was shipped with your system. The console help command lists all supported console commands. If your system has been set to boot automatically, you must type Ctrl-C to interrupt the boot process and get to the SRM console prompt (»>). If the system is not set to boot automatically, it displays the SRM console prompt after performing system checks. AH SRM console versions support the set and show commands, which operate on environment variables that are stored in non-volatile memory. The show command lists all environment variables, including those that are read-only. Alpha's SRM is picky about which hardware it supports. For example, it recognizes NCR SCSI boards, but it doesn't recognize Adaptec boards. There are reports of some Alphas not booting with particular video boards. The GENERIC kernel configuration (/usr/src/sys/alpha/conf/GENERIC) shows what the kernel supports, but that doesn't mean that the SRM supports all the devices. In addition, the SRM support varies from one machine to the next, so there's a danger that what's described here won't work for you. Other differences for Alpha include: The CD-ROM distribution The easiest way to install FreeBSD is from CD-ROM. You can buy them at a discount with the order form at the back of the book, or you can download an ISO image from ññûëêà: ftp://ftp.FreeBSD.org and create your own CD-ROM. There are a number of CD-ROMs in a FreeBSD distribution, but the only essential one is the first one, the Installation CD-ROM. It contains everything you need to install the system itself. The other CD-ROMs contain mainly installable packages. Individual releases may contain other data, such as a copy of the source code repository. We'H take a more detailed look at the installation CD-ROM here. Installation CD-ROM The Installation CD-ROM contains everything you need to install FreeBSD on your system It supplies two categories of installable software: G. Lehey FreeBSD Operating System packages/Latest contains the latest versions of the packages. packages/All contains a large subset of the Ports Collection. To make it easier for you to find your way around them, symbolic links to appropriate packages have been placed in the directories archivers, astro, audio, benchmarks, biology, cad, Chinese, comms, converters, databases, deskutils, devel, editors, emulators, french, ftp, games, german, graphics, hebrew, ire, Japanese, java, korean, lang, mail, math, mbone, misc, net, news, palm, picobsd, plan9, print, russian, science, security, shells, sysutils, templates, textproc, Ukrainian, Vietnamese, www, xll, xll-clocks, xll-frn, xll-fonts, xll-servers, xll-toolkits and xll-wm. Don't get the impression that these are different packages—they are realty pointers to the packages in Aft You will find a list of the currently available packages in the file packages/INDEX. We'll look at the Ports Collection in more detail in Chapter 9. Òàáëèöà 2.2. lists typical files in the main directory of the installation CD-ROM File Contents ERRATA.TXT Alist of last-minute changes. Read this file. It can save you a lot of headaches. HARDWARE.TXT Alist of supported hardware. INSTALL.TXT Information about installing FreeBSD. README.TXT The traditional first file to read. It describes how to use the other files. RELNOTES.TXT Release notes. base Installation directory: the base distribution of the system. This is the onty required directory for installation. See Chapter 5, Installing FreeBSD, for more detail boot Files related to booting, including the installation kernel catpages Pre-formatted man pages. See page 13 for more detail edrominf Machine-readable file describing the CD-ROM contents for the benefit of sysinstaft compatlx Directory containing libraries to maintain compatibility with Release l.X of FreeBSD compat20 Directory containing libraries to maintain compatibility with Release 2.0 of FreeBSD. compat21 Directory containing libraries to maintain compatibility with Release 2.1 of FreeBSD. compat22 Directory containing libraries to maintain compatibility with Release 2.2 of FreeBSD. compat3x Directory containing libraries to maintain compatibility with Release 3 of FreeBSD. compat4x Directory containing libraries to maintain compatibility with Release 4 of FreeBSD. crypto Installation directory: cryptographic software. diet Installation directory: dictionaries. doc Installation directory: documentation. docbook.css Style sheet for documentation. filename.txt A list of all the files on this CD-ROM. floppies A directory containing installation floppy disk images. games Installation directory: games. info Installation directory: GNU info documents. kernel The boot kernel manpages A directory containing the man pages for installation. packages A directory containing installable versions of the Ports Collection. See page 168. ports The sources for the Ports Collection. See Chapter 9 , The Ports Collection, page 167. proflibs A directory containing profiled libraries, useful for identifying performance problems when programming. sre A directory containing the system source files. tools A directory containing tools to prepare for installation from another operating system The .TXT files are also supplied in HTML format with a .HTM suffix. The contents of the CD-ROM will almost certainly change from one release to another. Read README.TXT for details of the changes. G. Lehey FreeBSD Operating System Live File System CD-ROM Although the installation CD-ROM contains everything you need to install FreeBSD, the format isn't what you'd like to handle every day. The distribution may include a Live File System CD-ROM, which solves this problem: it contains substantially the same data stored in file system format in much the same way as you would install it on a hard disk. You can access the files directly from this CD-ROM. CVS Repository CD-ROM One of the disks may also contain the &CVS Repository.&The repository is the master source tree of all source code, including all update information. We'll look at it in more detail in Chapter 31, Keeping up to date,page 581. The Ports Collection CD-ROM An important part of FreeBSD is the Ports Collection, which comprises many housand popular programs. The Ports Collection automates the process of porting software to FreeBSD. A combination of various programming tools already available in the base FreeBSD installation allows you to simply type make to install a given package. The ports mechanism does the rest, so you need only enough disk space to build the ports you want. We'll look at the Ports Collection in more detail in Chapter 9 . The files are spread over a number of CD-ROMs: G. Lehey FreeBSD Operating System ports, on the Installation CD-ROM. A full distribution contains a number of other CD-ROMs with most of the remaining packages. 6i G. Lehey FreeBSD Operating System