FreeBSD4.6 on a Dell XPS T450

Grenville Armitage, 6/23/02

This documentation is largely for my own benefit - a record of what I did in case I ever need to rebuild the machine. With any luck, this information will be useful to others (like you, if you're reading this page and you aren't me). Early in 2001 I upgraded a Dell XPS T450 (desktop PC) from Windows NT4 to FreeBSD4.x. For the rest of the year it acted as my primary workstation and Samba server. In mid-2002 it was upgraded from FreeBSD4.4 to FreeBSD4.6 and now also acts as my home NAT box/firewall. This page describes the latest FreeBSD4.6 configuration.

Summary
Equipment
Installing FreeBSD
Configuring FreeBSD
FreeBSD boot messages

Summary

An XPS T450 running FreeBSD4.6 + XFree86-4.2.0 + KDE 3.0 provides quite a useable code development environment and web-surfing machine. The 450MHz PIII processor is quite fast enough in this environment.

Equipment

I dropped in a 256MB DIMM to upgraded the memory from 128MB to 384MB, swapped out the original 6GB drive for two 30GB Seagate Barracuda 5400rpm drives, but otherwise left the machine in original condition.

Installing FreeBSD

Assume we have a FreeBSD4.6 installation disc (disc 1 of the four disk ISO set). Reboot the machine with the FreeBSD CDROM installed. The FreeBSD boot process will prompt you for an initial kernel configuration step - skip it, and continue to the main Installation program. Select a Standard Installation, and you'll now be prompted to create the intial partitioning of the hard drive.

Because of its BSD/Unix roots, FreeBSD actually uses the term "slice" to refer to what the PC-world calls "partition". The traditional PC BIOS allows a disk to contain up to four distinct partitions, each containing a different file system (FAT16, NTFS, FreeBSD UFS, Linux, etc). Traditional BSD (from which FreeBSD is derived) uses partitions as key mount points for members of the unix directory tree and the swap space. Since FreeBSD was designed to co-exist on PC platforms and their BIOSes, BSD-style partitions are created inside BIOS partitions. To keep the names distinct, FreeBSD decided that BIOS partitions would be referred to as slices.

The first step in the installation process is the FDISK Partition Editor, which allows you to modify the BIOS partitions of the hard drives. From FreeBSD's perspective, the XPST450's internal IDE drives are device /dev/ad0 (master) and /dev/ad1 (slave). We'll focus on /dev/ad0 here. I deleted the existing partition entries, manually created three slices and set their partition types explicitly:

ad0s1 499MB FAT16 (type 6)
ad0s2 6GB FreeBSD (type 165)
ad0s3 21GB FreeBSD (type 165)
ad0s4 <empty>

[ad0s1 is a spare partition in case I need to install a small, bootable OS later for debugging purposes. ads02 and ads03 allow me to keep my OS installation (in ad0s2) separate from my home directories (in ad0s3). This allows me to simply blow away ad0s2 during upgrades to newer versions of FreeBSD without touching my data, personal files, etc.]

Quit the partition editor ('q' option) and you'll be prompted to install the FreeBSD boot loader in the Master Boot Record (MBR). Do this. (It wont mean much in single-boot mode, but might be useful down the road.) You'll then be taken to the "Disk Label Editor" and offered the chance to set up BSD-style partitions inside the previously assigned FreeBSD slices ad0s2 and ad0s3. Using the 'autodefaults' on ads02, and assigning all of ads03 to /home, results in:

/dev/ad0s2a    /          [128MB]
/dev/ad0s2b    (swap)     [~760MB]
/dev/ad0s2f    /tmp       [256M]
/dev/ad0s2g    /usr       [4.6G]
/dev/ad0s2e    /var       [256MB]
/dev/ad0s3e    /home      [21G]

(ad0s2c conventionally represents the entire slice ad0s2, ad0s2d is unused by default.)

Continue with the FreeBSD installation onto ad0s2. At this point both the local CDROM drive and internal ethernet port are recognized. (Although there's probably no reason not to continue installing from the CDROM, you could choose to continue the installation over NFS or AnonymousFTP from another machine on the local LAN.)

When the installation process prompts you to add additional packages, I found the following to be a useful initial set: The 'ports' collection, X windows, KDE3 (the K desktop environment), linux-compatibility, scanssh, and mtools. KDE3 is a meta-package that pulls in key KDE 3.0 desktop components. [You don't need to pull in too many packages during the installation process, they can be added later from the CD-ROM or over an Internet connection with "pkg_add -r <packagename>"]

A note about X11: During the installation process you'll be prompted on whether to include X windows by default. As of FreeBSD4.6 the default is XFree86-4.2.0, so I advise selecting the "X Windows + " installation option. (If you don't, you can always add XFree86-4.2.0 as a package later.)  However, I chose to keep the installation process simple by declining to configure the X server until after I'd completed the entire FreeBSD4.6 installation process. (The configuration of X is easily performed as 'root' later.)

A caveat about security settings: don't select the highest security setting when prompted during installation, otherwise the X11 server will be unable to start (e.g. when you run "XFree86 -configure" either from console or during the installation process).

A note about modems: Many common PCI-card modems are "winmodems" that need special drivers. FreeBSD4.6 includes a package (ltmdm-1.4) that supports winmodems based on the Lucent chipset. 

Configuring FreeBSD

At boot time you're prompted with a list of three possible boot options "F1 ???, F2 FreeBSD, F3 FreeBSD". You should select F2 to boot FreeBSD from ad0s2. (ad0s3 is not bootable, since it contains only one large partition holding the /home directory. ad0s1 is unlikely to be bootable unless we're debugging some major crash, in which case you're not reading this anyway.)  If you don't make a selection within a small number of seconds the previously selected OS is booted. (If you reboot and get an error message of an invalid partition table then somehown you've marked more than one partition bootable. Go back to FDISK and make sure only ad0s2 is marked bootable.)

Sound: Sound support can be enabled simply by recompiling and reinstalling the FreeBSD kernel with the following option added to the kernel config file:

device pcm

Reboot the machine, go into /dev/ and run "./MAKEDEV snd0"  (the 'sox' package includes a 'play' command that seems capable of driving the sound card). Now "cat /dev/sndstat" should result in something like this to confirm correct installation of sound driver and recognition of the internal card:

FreeBSD Audio Driver (newpcm)
Installed devices:
pcm0: <Yamaha DS-1E (YMF724F)> at memory 0xf4000000 irq 9 (4p/2r/0v channels duplex)

[When recompiling the kernel for sound support, it is probably useful to edit the kernel config file to remove support for cpu support 386, 486 and 586 processors, since the XPST450 is a 686-class processor.]

XFree86-4.2.0

Run "Xfree86 -configure" as root to generate the initial XF86Config.new file, then copy it to /etc/X11/XF86Config. XFree86 seemed to have no problem recognizing my ATI Mach64-GB graphics accelerator. However, it might get confused about the type of mouse you're using. If you see the following line in your XF86Config file:

        Option     "Protocol" "MouseSystems"

then replace it with:

         Option      "Protocol" "auto"

Also add this line to the mouse input device section to enable support for wheel-mice:

    Option "ZAxisMapping"    "4 5"

Finally, add the imwheel-0.9.9 package and make sure imwheel is started from your .xinitrc.

KDE 3.0

The last line of your .xinitrc should be startkde. KDE will take care of the rest.


NAT

I added a dual-port ethernet card (fxp0 and fxp1) alongside the original (xl0) and activated NAT forwarding between fxp0 and xl0. This required a fairly simple config file and five lines in /etc/rc.conf

To /etc/rc.conf add these lines:

ifconfig_xl0="DHCP"
ifconfig_fxp0="inet 192.168.0.1"
ifconfig_fxp1="down"
gateway_enable="YES"
ipfilter_enable="YES"
ipnat_enable="YES"


This configures xl0 as the port attached to my broadband ISP service (running DHCP for address assignment) and fxp0 as the port attached to my home LAN. fxp1 is currently unused. Forwarding and NAT functionality is turned on.

To /etc/ipnat.rules add these lines:

map xl0 192.168.0.0/24 -> 0.0.0.0/32 portmap tcp/udp 40000:65000
map xl0 192.168.0.0/24 -> 0.0.0.0/32


DHCP autoconfiguration of xl0 installs a default route out of xl0 towards my ISP. The rules in /etc/ipnat.rules cause NAT translation to be applied to packets arriving on fxp0 from my local LAN that are destined to be forwarded out xl0 (towards the wider Internet). Specifically, TCP and UDP traffic will have their ports translated up into the 40000 to 65000 range.

[Despite what I'd read elsewhere, the kernel did not have to be recompiled to enable support for the above NAT functionality.]

Protecting local services

By default inetd 'wraps' applications according to the 'tcp wrapper' filter rules in /etc/hosts.allow [see hosts_options(5) man page]. This allows me to customise the host's reaction to TCP connection requests coming in over xl0.

My simple /etc/hosts.allow contains:

fingerd: 192.168. : allow
fingerd: ALL  \
        : twist /bin/echo Sorry %h, you cannot finger me
telnetd: 192.168. : allow
telnetd: ALL  \
        : twist /bin/echo Sorry %h, you cannot telnet to me
portmap : 192.168.0. : allow
portmap : ALL : deny
ALL : ALL : allow


This essentially prevents people from running finger or telnet to my host from outside, and actively tells them what's going on. The portmapper is silently blocked. All other services are either disabled (e.g. ftp) or have their own mechanisms for rejecting outside access (e.g. samba).


FreeBSD boot messages

I didn't tweak IRQs or search for conflicts. Here's what FreeBSD4.6 reported when booting.


Copyright (c) 1992-2002 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD 4.6-RELEASE #0: Tue Jun 11 06:14:12 GMT 2002
    murray@builder.freebsdmall.com:/usr/src/sys/compile/GENERIC
Timecounter "i8254"  frequency 1193182 Hz
CPU: Pentium III/Pentium III Xeon/Celeron (448.97-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x673  Stepping = 3  Features=0x383f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE>
real memory  = 402653184 (393216K bytes)
avail memory = 386551808 (377492K bytes)
Preloaded elf kernel "kernel" at 0xc04d0000.
Pentium Pro MTRR support enabled
md0: Malloc disk
Using $PIR table, 10 entries at 0xc00fdf20
npx0: <math processor> on motherboard
npx0: INT 16 interface
pcib0: <Intel 82443BX (440 BX) host to PCI bridge> on motherboard
pci0: <PCI bus> on pcib0
pcib1: <Intel 82443BX (440 BX) PCI-PCI (AGP) bridge> at device 1.0 on pci0
pci1: <PCI bus> on pcib1
pci1: <ATI Mach64-GB graphics accelerator> at 0.0
isab0: <Intel 82371AB PCI to ISA bridge> at device 7.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel PIIX4 ATA33 controller> port 0x10a0-0x10af at device 7.1 on pci0
ata0: at 0x1f0 irq 14 on atapci0
ata1: at 0x170 irq 15 on atapci0
uhci0: <Intel 82371AB/EB (PIIX4) USB controller> port 0x1080-0x109f irq 9 at device 7.2 on pci0
usb0: <Intel 82371AB/EB (PIIX4) USB controller> on uhci0
usb0: USB revision 1.0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
chip1: <Intel 82371AB Power management controller> port 0x7000-0x700f at device 7.3 on pci0
pcm0: <Yamaha DS-1E (YMF724F)> mem 0xf4000000-0xf4007fff irq 9 at device 12.0 on pci0
xl0: <3Com 3c905C-TX Fast Etherlink XL> port 0x1000-0x107f mem 0xf4008000-0xf400807f irq 11 at device 13.0 on pci0
xl0: Ethernet address: 00:50:04:d6:d3:98
miibus0: <MII bus> on xl0
xlphy0: <3c905C 10/100 internal PHY> on miibus0
xlphy0:  10baseT, 10baseT-FDX, 100baseTX, 100
baseTX-FDX, auto
pcib2: <DEC 21152 PCI-PCI bridge> at device 14.0 on pci0
pci2: <PCI bus> on pcib2
fxp0: <Intel Pro 10/100B/100+ Ethernet> port 0xa000-0xa01f mem 0xf6000000-0xf60fffff,0xfc000000-0xfc000fff irq 10 at device 4.0 on pci2
fxp0: Ethernet address 00:90:27:fc:3f:7e
inphy0: <i82555 10/100 media interface> on miibus1
inphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
fxp1: <Intel Pro 10/100B/100+ Ethernet> port 0xa020-0xa03f mem 0xf6100000-0xf61fffff,0xfc001000-0xfc001fff irq 3 at device 5.0 on pci2
fxp1: Ethernet address 00:90:27:fc:3f:7f
inphy1: <i82555 10/100 media interface> on miibus2
inphy1:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
orm0: <Option ROMs> at iomem 0xc0000-0xc7fff,0xc8000-0xc87ff,0xe0000-0xe3fff,0xe4000-0xeffff on isa0
fdc0: <NEC 72065B or clone> at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0
fdc0: FIFO enabled, 8 bytes threshold
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
atkbd0: <AT Keyboard> flags 0x1 irq 1 on atkbdc0
kbd0 at atkbd0
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: model IntelliMouse, device ID 3
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 16550A
sio1: configured irq 3 not in bitmap of probed irqs 0
ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0
ppc0: Generic chipset (EPP/NIBBLE) in COMPATIBLE mode
plip0: <PLIP network interface> on ppbus0
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0
ad0: 28629MB <ST330621A> [58168/16/63] at ata0-master UDMA33
ad1: 28629MB <ST330621A> [58168/16/63] at ata0-slave UDMA33
acd0: CDROM <CRD-8400B> at ata1-master PIO4
Mounting root from ufs:/dev/ad0s2a
IP Filter: v3.4.27 initialized.  Default = pass all, Logging = enabled