The NetBSD Operating System

A Guide

Federico Lupi


Table of Contents
Purpose of this guide
1 What is NetBSD
1.1 The story of NetBSD
1.2 NetBSD features
1.3 Supported platforms
1.4 NetBSD's target users
1.5 Applications for NetBSD
1.6 The philosophy of NetBSD
1.7 How to get NetBSD
2 New features in NetBSD 2.0
2.1 What's new in NetBSD 2.0?
2.1.1 Native threads
2.1.2 Kernel events notification framework - kqueue
2.1.3 systrace
2.1.4 UFSv2
2.1.5 Java support
2.1.6 Verified Exec
2.1.7 Cryptographic disk driver
2.1.8 Non-executable stack and heap
2.1.9 New toolchain
2.2 New ports and enhancements to existing ports
2.2.1 amd64
2.2.2 evbsh5
2.2.3 i386
2.2.4 macppc
2.2.5 sparc
2.3 The NetBSD Packages Collection (pkgsrc)
3 Installation
3.1 Documentation
3.2 The layout of a NetBSD installation
3.3 Installation
3.3.1 Keyboard
3.3.2 Geometries
3.3.3 Partitions
3.3.4 Hard disk space requirements
3.3.5 Retry
4 Example Installation
4.1 Installation example
4.1.1 Preparing the installation
4.1.2 Creating the installation floppy
4.1.3 Last preparatory steps
4.1.4 Beginning the installation
4.1.5 Partitions
4.1.6 Disklabel
4.1.7 Creating a disklabel
4.1.8 Final operations
4.1.9 Choosing the installation media
5 The first boot
5.1 If something went wrong
5.2 Login
5.3 Changing the keyboard layout
5.4 The man command
5.5 Changing the root password
5.6 Changing the shell
5.7 System time
5.8 Basic configuration /etc/rc.conf
5.9 Rebooting the system
6 The second boot
6.1 dmesg
6.2 Mounting the CD-ROM
6.3 Mounting the floppy
6.4 Accessing a DOS/Windows partition
6.5 Adding users
6.6 Shadow passwords
6.7 Stopping and rebooting the system
7 Printing
7.1 Enabling the printer daemon
7.2 Configuring /etc/printcap
7.3 Configuring Ghostscript
7.4 Printer management commands
7.5 Remote printing
8 Using the build.sh Front End
8.1 Building the tools
8.2 Cross Compiling a Kernel
8.3 Build & Release
8.4 Environment Variables
8.4.1 Changing the Destination Directory
8.4.2 Static Builds
9 Compiling the kernel
9.1 Installing the kernel sources
9.2 Italian keyboard layout
9.3 Recompiling the kernel
9.4 Build the toolchain
9.5 Creating the kernel configuration file
9.6 Configuring the kernel
9.7 Generating dependencies and recompiling
9.8 If something went wrong
10 The package collection
10.1 Installing the package collection
10.2 Updating the package collection
10.3 Example: installing a program from source
10.3.1 Downloading the sources
10.3.2 Compiling and installing
10.4 Example: installing a binary package
10.5 Package management commands
10.6 Quick Start Packaging Guide
10.6.1 Tools
10.6.2 Getting Started
10.6.3 Filling in the Rest
10.6.4 Checking with pkglint
10.6.5 Running and Checking Build/Installs
10.6.6 Submitting a Package Using send-pr
10.6.7 Final Notes
11 Networking
11.1 Introduction to TCP/IP Networking
11.1.1 Audience
11.1.2 Supported Networking Protocols
11.1.3 Supported Media
11.1.4 TCP/IP Address Format
11.1.5 Subnetting and Routing
11.1.6 Name Service Concepts
11.1.7 Next generation Internet protocol - IPv6
11.2 Practice
11.2.1 A walk throught the kernel configuration
11.2.2 Overview of the network configuration files
11.2.3 Connecting to the Internet
11.2.4 Creating a small home network
11.2.5 Connecting two PCs through a serial line
11.3 Advanced Topics
11.3.1 IPNAT
11.3.2 NFS
11.3.3 Setting up /net with amd
11.3.4 IPv6 Connectivity & Transition via 6to4
Bibliography
12 The Domain Name System
12.1 Notes and Pre-Requisites
12.2 What is DNS?
12.3 The DNS Files
12.3.1 /etc/namedb/named.conf
12.3.2 /etc/namedb/localhost
12.3.3 /etc/named/zone.127.0.0
12.3.4 /etc/namedb/diverge.org
12.3.5 /etc/namedb/1.168.192
12.3.6 /etc/namedb/root.cache
12.4 Using DNS
12.5 Setting up a caching only name server
12.5.1 Testing the server
13 Mail and news
13.1 sendmail
13.1.1 Configuration with genericstable
13.1.2 Testing the configuration
13.1.3 Using an alternative MTA
13.2 fetchmail
13.3 Reading and writing mail with mutt
13.4 Strategy for receiving mail
13.5 Strategy for sending mail
13.6 Advanced mail tools
13.7 News with tin
14 Console drivers
14.1 wscons
14.1.1 50 lines text mode with wscons
14.1.2 wsmouse
14.2 pccons
14.3 pcvt
14.3.1 Changing the screen size
15 Editing
15.1 Introducing vi
15.1.1 The vi interface
15.1.2 Switching to Edit Mode
15.1.3 Switching Modes & Saving Buffers to Files
15.1.4 Yanking and Putting
15.1.5 Navigation in the Buffer
15.1.6 Searching a File, the Alternate Navigational Aid
15.1.7 A Sample Session
15.2 Configuring vi
15.2.1 Extensions to .exrc
15.2.2 Documentation
15.3 Using tags with vi
16 X
16.1 What is X?
16.2 Configuration
16.3 The mouse
16.4 The keyboard
16.5 The monitor
16.6 Video card and X server
16.7 Starting X
16.8 Customizing X
16.9 Other window managers
16.10 Graphical login with xdm
17 Linux emulation
17.1 Emulation setup
17.1.1 Configuring the kernel
17.1.2 Installing the Linux libraries
17.1.3 Installing Acrobat Reader
17.2 Directory structure
18 Audio
18.1 Basic hardware elements
18.2 BIOS settings
18.3 Configuring the audio device
18.4 Configuring the kernel audio devices
18.5 Advanced commands
18.5.1 audioctl
18.5.2 mixerctl
18.5.3 audioplay
18.5.4 audiorecord
19 Obtaining sources by CVS
19.1 Fetching system and userland source
19.2 Fetching pkgsrc
20 CCD Configuration
20.1 Install physical media
20.2 Configure Kernel Support
20.3 Disklabel each volume member of the CCD
20.4 Configure the CCD
20.5 Initialize the CCD device
20.6 Create a 4.4BSD/UFS filesystem on the new CCD device
20.7 Mount the filesystem
21 The cryptographic device driver
21.1 Configuring kernel support
21.2 Setting up a cgd device
21.3 Swap encryption
22 rc.d System
22.1 The rc.d Configuration
22.2 The rc.d Scripts
22.3 The Role of rcorder and rc Scripts
22.4 Additional Reading
23 The Internet Super Server
23.1 Overview
23.2 What is Inetd
23.3 Protocols
23.4 Services
23.5 RPC
23.6 Inetd
23.7 Adding a Service
23.8 When to use or not to use inetd
23.9 Other Resources
23.9.1 NetBSD/i386 Man Pages
23.9.2 Misc. Links
24 Miscellaneous operations
24.1 Creating install boot floppies for i386
24.2 Creating a CD-ROM
24.2.1 Creating the ISO image
24.2.2 Writing the image to the CD
24.2.3 Copying a CD
24.2.4 Creating a bootable CD
24.3 Synchronizing the system clock
24.4 Installing the boot manager
24.5 Deleting the disklabel
24.6 Speaker
24.7 Forgot root password?
24.8 Adding a new hard disk
24.9 Password file is busy?
24.10 How to rebuild the devices in /dev
A. Information
A.1 Guide history
B. Contributing to the NetBSD guide
B.1 Translating the guide
B.1.1 What you need to start a translation
B.1.2 Writing SGML/DocBook
B.2 Sending contributions
B.3 SGML/DocBook template
C. Getting started with XML/DocBook
C.1 What is XML/DocBook
C.2 Jade
C.3 DocBook
C.4 The DSSSL stylesheets
C.5 Using the tools
C.6 An alternative approach to catalog files
C.7 Producing PostScript output
C.7.1 Installing TeX
C.7.2 Enabling hyphenation for the italian language
C.7.3 Creating the hugelatex format
C.7.4 Installing Jadetex
C.8 Links
D. Acknowledgements
List of Figures
3-1. Partitions
4-1. Beginning the installation
4-2. Confirming the installation
4-3. Choosing a hard disk
4-4. BIOS geometry
4-5. Choosing the partitioning scheme
4-6. Choosing a unit of measure
4-7. fdisk
4-8. Deleting a partition
4-9. Deleted partition
4-10. Partitioning completed
4-11. Configuring the boot selector
4-12. Boot selector configuration
4-13. Disklabel
4-14. Standard disklabel
4-15. Modify the disklabel (sec)
4-16. Modifying a BSD partition
4-17. Modified disklabel
4-18. Selecting the sets
4-19. Installation media
4-20. CD-ROM installation
4-21. Congratulations
11-1. Our demo-network
11-2. Attaching one subnet to another one
11-3. Adresses are divided into more significant network- and less significant hostbits
11-4. IPv6-addresses have a similar structure to class B addresses
11-5. Several interfaces attached to a link result in only one scope ID for the link
11-6. Network with gateway
11-7. A frequently used method for transition is tunneling IPv6 in IPv4 packets
11-8. 6to4 derives a IPv6 from an IPv4 address
11-9. Request and reply can be routed via different gateways in 6to4
11-10. Enabling packet forwarding is needed for a 6to4 router
13-1. Structure of the mail system
List of Examples
5-1. Manual sections
7-1. /etc/printcap
7-2. /usr/local/libexec/lpfilter
7-3. /etc/printcap
7-4. /usr/local/libexec/lpfilter-ps
11-1. resolv.conf
11-2. nsswitch.conf
11-3. Connection script
11-4. Chat file
11-5. Chat file with login
11-6. /etc/ppp/options
11-7. ppp-up
11-8. ppp-down
11-9. /etc/hosts
12-1. strider's /etc/hosts file
12-2. localhost