NetBSD/i386 Frequently Asked Questions

It is intended for this to become a repository of frequently asked questions (and answers) specific to NetBSD/i386.

Disk partitioning/booting

Specific hardware issues

Running the X Window System

Other NetBSD/i386 FAQs

Other sources of information


Disk partitioning/booting


Boot floppy is too large to fit (top)

If you download the boot.fs image in 'ascii' mode (the default for the Windows FTP client and Netscape), it will automatically convert any newlines into carriage return/newline pairs, which renders the image useless (in addition to too large to fit onto the floppy).

If you are using the Windows FTP client you should type 'bin' to select binary mode before downloading the files.

If you are using some other method you may find it easier to download the boot.fs.gz file and use winzip to uncompress into boot.fs.

Using large drives on machines with a 540MB BIOS limit (top)

Enter a geometry of 1024/16/63 in the BIOS, and be sure to have your boot partition within the first 540M (so that the kernel can be loaded by BIOS routines). NetBSD will then be able to use the whole disk.

How to determine a "correct" disk geometry (top)

NetBSD uses the PC BIOS to load the boot program. In order for this to work both NetBSD and the BIOS must agree on the disk geometry (at least the part containing the boot partition).

The BIOS in PCs can only cope with a certain number of cylinders, heads, and sectors per disk (see table). (This includes BIOSes on SCSI cards).

Since many drives' real geometry cannot fit within these limitations a modern BIOS will 'translate' the geometry by picking fictitious values that multiply out to the same total size (or slightly less).

If a disk has a valid DOS MBR partition, (created by DOS, Windows, pfdisk, or similar) it will contain the "correct" BIOS geometry. NetBSD will use this as the BIOS geometry during sysinst. Unfortunately on an empty disk, or one without the MBR set up properly, NetBSD will get the BIOS geometry wrong. Ideally this information should be passed in from the boot program, but there is no certain method of determining the mapping of bios disk to netbsd disk, though it should be possible to improve on the current 0% hitrate.

One method of determining the "correct" translated geometry is to use 'pfdisk':

  1. Download pfdisk from ftp.NetBSD.org (or a mirror), in /pub/NetBSD/NetBSD-1.6.1/i386/installation/misc/pfdisk.exe.
  2. Run 'pfdisk 0' (0 is the first disk, 1 the second, etc).
  3. Type 'list'.
  4. Record geometry, reboot, and use for NetBSD.

BIOS disk parameter limits

ParameterBits usedMax value
Cylinders 101023
Heads 8255
Sectors per track 663

(This limits drives to 8GBytes, at least from the BIOS' perspective).

Accessing Microsoft partitions (top)

NetBSD supports a number of different filesystems (for a complete list see fstab(5)) including FAT, FAT32, NTFS4 and NTFS5 from Microsoft. Currently only read support works reliably for NTFS filesystems. Long filenames are supported on both FAT and NTFS.

To access another filesystem you have to set up a correct "disklabel" which tells the system where to find the data on the disk. With a correct "disklabel" you are able to "mount" it for use with NetBSD.

Setting up the disklabel

  1. Determine the disk containing the filesystem
    If you only have a single IDE/ST506 or SCSI disk it will be wd0 or sd0, if you have multiple disks you should check the output from "dmesg | more" to determine the correct disk's name.

  2. Determine the size and offset of the partition.
    Type "fdisk" and you will see the size and offset of the partitions which could be something like:
    NetBSD disklabel disk geometry:
    cylinders: 16938 heads: 15 sectors/track: 63 (945 sectors/cylinder)
    
    BIOS disk geometry:
    cylinders: 1023 heads: 240 sectors/track: 63 (15120 sectors/cylinder)
    
    Partition table:
    0: sysid 7 (OS/2 HPFS or NTFS or QNX2 or Advanced UNIX)
        start 63, size 3190257 (1557 MB), flag 0x80
            beg: cylinder    0, head   1, sector  1
            end: cylinder  210, head 239, sector 63
    1: sysid 169 (NetBSD)
        start 3193155, size 4096575 (2000 MB), flag 0x0
            beg: cylinder  211, head  45, sector  1
            end: cylinder  482, head  29, sector 63
    2: sysid 6 (Primary 'big' DOS, 16-bit FAT (> 32MB))
        start 7302960, size 4596480 (2244 MB), flag 0x0
            beg: cylinder  483, head   0, sector  1
            end: cylinder  786, head 239, sector 63
    3: sysid 15 (Ext. partition - LBA)
        start 11899440, size 4097520 (2000 MB), flag 0x0
            beg: cylinder  787, head   0, sector  1
            end: cylinder 1023, head 239, sector 63
    
    The example is from a disk with 4 partitions:
    0. Windows NT 4.0 NTFS4 partition
    1. NetBSD ffs partition
    2. MS-DOS FAT partition
    3. Windows 2000 NTFS5 inside an "extended" partition

  3. Type "disklabel <DISKNAME>"
    If the disk contains only MS-DOS partitions NetBSD will automatically generate a 'fake' disklabel containing an entry for the first MS-DOS partition.
    The output could look something like this:
    # disklabel wd0
    
    physical disk information
    8 partitions:
    #        size   offset     fstype   [fsize bsize   cpg]
      a:   410130  3193155     4.2BSD     1024  8192    16   # (Cyl. 3379 - 3812)
      b:   409185  3603285       swap                        # (Cyl. 3813 - 4245)
      c:  4096575  3193155     unused        0     0         # (Cyl. 3379 - 7713)
      d: 16006410        0     unused        0     0         # (Cyl.    0 - 16937)
      e:  3274425  4012470     4.2BSD     2048 16384    32   # (Cyl. 4246 - 7710)
    
    If your needed fstypes already are defined (i.e. MSDOS) you can skip down to partition mounting.

    If you do this before the NetBSD installation is up and running, you may want to use the mbrlabel(8) utility to synthesize a temporary in-core disklabel describing all the fdisk partitions on a disk. You can then use that information for creating a new disklabel consisting of the BSD and other-OS partitions.

  4. Prepare to edit the disklabel
    If you prefer to use an editor other than vi type "setenv EDITOR <YOUR_EDITOR>" eg. "setenv EDITOR pico".

  5. Edit the disklabel with "disklabel -e <DISKNAME>"
    Go down to the bottom of the disklabel and you are ready to edit your labels.

    You need two things:

    1. The next unused partition letter (eg: 'f').
    2. The 'start/size' value from fdisk (eg: '63').

    Add a new line at the bottom that for NTFS reads:

      <PARTITION>:   <SIZE>  <OFFSET>   NTFS
    
    A suitable entry for the above example would be (fsize, bsize and cpg are blank):
      f:  3190257       63       NTFS
    
    Add another line for MSDOS:
      <PARTITION>:   <SIZE>  <OFFSET>   MSDOS
    
    From the example the entry would be:
      g:  4596480  7302960      MSDOS
    
    Notes on partitions: NetBSD/i386 currently only supports eight partitions per disk ('a' - 'h'), also the 'number of partitions' line directly above the partition table should be greater or equal to the number of partitions defined.

  6. Save and check the disklabel
    Exit the editor, type "disklabel <DISKNAME>", and confirm your new partition is visible.

Mounting the filesystem

Every disk partition has a device entry in '/dev', the form of such an entry is '/dev/' followed by the diskname, followed by the partition letter. In the above example the device entry for the NTFS and MS-DOS partitions would be '/dev/wd0f' and '/dev/wd0g' respectively.

  1. Create a mountpoint for each partition
    "mkdir <MOUNTPOINT>", eg: "mkdir /msdos" and "mkdir /nt4".

  2. Mount the filesystems
    "mount -t <TYPE> <DEVICE> <MOUNTPOINT>", eg: "mount -t msdos /dev/wd0g /msdos" and "mount -t ntfs /dev/wd0f /nt4".

  3. Check all is ok
    "ls <MOUNTPOINT>", eg: "ls /msdos" and "ls /nt4".

  4. Set filesystems to be automatically mounted on boot
    If you want NetBSD to automatically mount the filesystems every time it boots you should edit /etc/fstab and add lines of the form:
        <DEVICE> <MOUNTPOINT>  msdos   rw
        <DEVICE> <MOUNTPOINT>  ntfs    rw
    
    Again, in the above example this would be:
        /dev/wd0g /msdos  msdos   rw
        /dev/wd0f /nt4    ntfs    rw
    

Booting NetBSD or DOS/Windows/other via a menu (top)

This assumes you have already partitioned your disk, and installed both NetBSD and whichever other OS you intend to use. It uses the OSBS boot selector.

If you have a disk or partition with more than 8GB or NetBSD should be installed at more than 2GB from the start of the disk, you might consider directly using the NetBSD bootmenu.

  1. Download the OSBS boot selector. This can be found on ftp.NetBSD.org as /pub/NetBSD/NetBSD-1.5.2/i386/installation/misc/osbsbeta.exe.
  2. Extract OSBS. Save osbsbeta.exe to a DOS disk, then run it. It will extract 'OS-BS\OSBS20B8.EXE'.
  3. Run 'OS-BS\OSBS20B8.EXE'
  4. Select 'Install' -> 'Boot menu'
  5. Press 'INSERT' for each partition you wish to add to the boot menu.
  6. Press 'ESCAPE' when done. You will be asked to select which OS to boot by default, how long to wait before booting it (10 seconds is reasonable), and whether to modify the start id on boot time (usually no).
  7. Save the boot menu, and quit.
  8. If you booted from floppy disk, remove it.

You should now be presented with the boot menu when the machine boots.

Another way, present since NetBSD 1.4 is to use the new NetBSD bootmenu:

  1. run 'fdisk -i -c /usr/mdec/mbr_bootsel' to install the bootmenu
  2. run 'fdisk -B' afterwards to interactively configure it (this step is not optional)

See also the fdisk(8) manpage.

Adding NetBSD to the Windows NT boot menu (top)

To boot NetBSD using Windows NT bootloader, you need to make a 512 byte bootblock in a file (nbsdX.bb) and put it on your Windows NT's partition, plus a note in the boot.ini file.

First, you need to create the bootblocks with the following command in single user mode

	dd if=/dev/rXXYa of=nbsdY.bb count=1 bs=512
where XX is the disk type (usually sd or wd), and Y is the disk number (usually 0).

Please note that if you don't have NetBSD on your first disk, you'll have to recompile the bootblock and install it, before you can run the above command. (For the recompiling you need some minor tweaking in /usr/src/sys/arch/i386/boot).

Note: We only provide the bootblocks nbsd0.bb(harddisk 0), nbsd1.bb(harddisk 1) and nbsd2.bb(harddisk 2) for old versions of NetBSD. You can't use them for NetBSD 1.4 or later.

Second, put the bootblocks on your Windows NT partition. Note: You can't write the bootblocks to the NT partition from NetBSD.

Finally, add the following to the NT boot menu. E.g. If NetBSD is installed on the second disk (wd1), you only need to add nbsd1.bb to the boot.ini file as follow.

[boot loader]
default=c:\nbsd0.bb
[operating systems]
c:\nbsd0.bb="NetBSD (harddisk 0)"
c:\nbsd1.bb="NetBSD (harddisk 1)"
c:\nbsd2.bb="NetBSD (harddisk 2)"

Installing NetBSD on a disk which currently is entirely used by Dos/Windows (top)

If you have an installation where DOS/Windows currently occupies the whole disk, you can if there is space left on the drive, make the DOS/Windows partition smaller and then build a second partition to use with NetBSD.

The steps involved in this are

Changing the partition sysid from 'old NetBSD or FreeBSD' (top)

From 1.3.3 onwards NetBSD has changed the default partition sysid from 165 to 169. This is to avoid a conflict with FreeBSD. A 1.3.3 (or newer) system will still boot from a partition with sysid 165, it will just give a warning each time it opens the partition. To convert a disk partition from 165 to 169, perform the following steps:

  1. Ensure you have a bootable 1.3.3 (or newer) floppy
    This is just in case something goes wrong. To boot the installed system from the floppy, boot the floppy, press space during the countdown and select 'boot hd0:'.

  2. Ensure you have bootblocks that understand the new ID
    If the system has been installed with a 1.3.3 or later sysinst you should be ok, otherwise run

    • '/usr/mdec/installboot biosboot.sym /dev/r{DISK}a'.

    If your kernel does not have 'options INSECURE' enabled you will need to shutdown to single user mode:

    • 'shutdown now'
    • press ENTER when prompted for a shell
    • 'fsck -p'
    • 'mount -vat ffs'
    • 'cd /usr/mdec ; ./installboot biosboot.sym /dev/r{DISK}a'

    Where {DISK} is wd0 for the first ATA (IDE) disk, sd0 for the first SCSI disk, etc.

  3. Change the partition id
    Run 'fdisk {DISK}'. One partition will be indicated as:
    	X: sysid 165 (FreeBSD or 386BSD or old NetBSD)
    
    Where X will be 0, 1, 2, or most likely 3. Run 'fdisk -u -X {DISK}'

    1. ENTER to : Do you want to change our idea of what BIOS thinks? [n]
    2. y ENTER to : Do you want to change it? [n]
    3. 169 ENTER to : Supply a decimal value for "sysid" [165]
    4. ENTER to : Supply a decimal value for "start" [......]
    5. ENTER to : Supply a decimal value for "size" [.......]
    6. ENTER to : Explicitly specify beg/end address? [n]
    7. y ENTER to : Is this entry okay? [n]
    8. y ENTER to : Should we write new partition table? [n]

  4. Reboot to confirm all works.
    If you hit any problems you can use fdisk on the boot floppy to reset the values back.

  5. Be particularly relieved that NetBSD should not need to change its partition ID again.

After installing, I'm just getting LI when I reboot (top)

A stale LILO is causing your problem. To fix this you'd want to:

  1. Boot from the sysinst floppy
  2. Exit the installation system by selecting 'Run /bin/sh' from the Utility menu.
  3. Type 'fdisk -if'
  4. Reboot

dosboot.com resets the machine after loading the kernel (top)

If dosboot.com resets the machine immediately after loading the kernel, make sure you do not have "himem.sys" loaded. Be sure to check your "config.sys"!

How to get a DOS prompt if you have WinME installed, and all you have is a Win98 CD and no floppy to boot from (top)

The Windows 98 CD is a fine way to get a (real!) MS-DOS prompt if your machine has Windows Millennium Edition (Windows ME) installed, and if booting from floppy is not an option, as it's often the case with modern laptops. You can press shift+F5 to not load any drivers like "highmem.sys" (see above) when asked if you want to start with or without CD-ROM support. You can then access your C: drive where you've put tools like "dosboot.com" (available from ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-1.5.2/i386/installation/misc/dosboot.com) and a kernel before.

How do I make a one-floppy NetBSD system? (top)

Recently Lex Wennmacher added the package fdgw to pkgsrc. The package is a tool to build one-floppy NetBSD systems. One application is to turn a PC without a hard disc into a cheap router.

There are two images that you can download from the main NetBSD ftp site. The ADSL router image has enough on it to provide a basic ADSL router system. The NAT router image is designed to provide a simple NAT router.

The images can be put onto a floppy using the dd command. For example,

dd if=adslrouter.img of=/dev/rfd0a bs=18k

Although both one-floppy NetBSD systems contain all the files required for proper operation, some customization is required (e. g. to define IP addresses and ipf filter rules). Please refer to Ken'ichi Fukamachi's fdgw home page for details.


Specific hardware issues


IRQ 2 and IRQ 9 (top)

On IBM AT and later machines (which includes all PCs capable of running NetBSD) IRQ 2 is mapped to IRQ 9 for various hardware reasons. On cards which feature a setting of "IRQ 2", you should select IRQ 9 in NetBSD kernel configuration files.

Problems with 'ne1: device time out' (top)

Old style ISA cards are configured for a specific address and IRQ. NetBSD can autodetect the address, but does not have a clean way to check for the IRQ, so the autoconfiguration tables contains entries for the most common values. If the address matches but the IRQ does not the device will timeout when used. This does not affect other busses such as PCI, EISA, or ISA-PnP.

If you have this problem, you have three options:

USB problem 'uhci0: couldn't map interrupt' (top)

This can be caused by the "Allocate interrupt for USB" option being disabled in the BIOS, possibly under the "PNP & PCI Setup". When enabled you will usually see the 'Serial Controller' listed with an IRQ on the BIOS screen just before it starts booting NetBSD.

What is 'WARNING: CYRIX 486DLC CACHE UNCHANGED'? (top)

This message indicates the kernel has detected a Cyrix 486DLC and since it does not know if it is safe on this machine, the Cyrix special cache settings have not been touched. This should only affect the Cyrix '386/486 hybrid' upgrade for 386 motherboards, and should not apply in any way to true 486 (or later) processors from any vendor, including Cyrix.

Many 386 motherboards (and CPUs) were too primitive to care about CPU cache coherency, requiring the DLC to flush its cache any time a bus hold was asserted by any bus device (indicating that a bus-master transaction was potentially in progress). This obviously results in a speed cost compared to running with full cache coherency.

There are two kernel options that can be set to affect the Cyrix cache:

By leaving them both undefined, the chip will run with whatever the BIOS sets up. Most BIOSs will not set any of the cache options, which is safest, but will give the least performance boost. If you have a true 486DLC/486DRX motherboard, or a DLC/DRX-aware BIOS, you may automatically get some of the performance boost listed above.

It's worth some experimentation. The system should fail fairly quickly after boot if the motherboard cannot support the option. Then just build a kernel with less aggressive optimizations. (Of course, don't overwrite your non-optimized kernel -- you'll need it to reboot if your new kernel doesn't work!)

My monitor goes into DPMS mode after "setting tty flags" (top)

At least one person has reported that their video card appears to not be probed correctly by the kernel. Specifically, after "setting tty flags" is printed, the screen goes black and the monitor goes into power-saving mode. The reported cause is that some video cards use the same I/O memory as what DOS calls COM4; for this reason, NetBSD's com3 (which corresponds to DOS's COM4) is disabled in the GENERIC kernel.

PCMCIA modem does not appear to work (top)

If you have a PCMCIA modem that does not appear to work, make sure you are using the com(4) device in hardware flow control mode. Many PCMCIA modems only work when using hardware flow control.

Running the X Window System


X will only run with an INSECURE kernel, or in single user mode (top)

When run without 'options INSECURE' NetBSD will disallow direct access to /dev/mem. If you use a graphics board which requires, or can benefit from, linear memory access you should install the Aperture Driver from the NetBSD packages collection (use "make install" in sysutils/aperture). This will permit the X server to directly access the VGA framebuffer even if kernel security level is > 0.

X fails with "Fatal server error: xf86MapVidMem: Could not map /dev/vga (Invalid argument)" (top)

This is a symptom of the problem described above.

X will not recognise a PS/2 mouse (top)

Up until 1.3.3 the default NetBSD/i386 GENERIC kernel does not have PS/2 mouse support enabled. In order to enable PS/2 support you need to build a custom kernel. Follow the instructions given and at stage 4 when you edit <MYCONF> you should search for the line:
   '#pms0    at pckbd? irq 12'
remove the initial '#', then continue building the kernel.
When you boot you should now see a line in the boot messages of the form 'pms0 at pc0' or 'pms0 at vt0'.

When setting up Xfree86 you should select the 'wsmouse' Mouse Device and the 'wsmouse' protocol.

How do I enable a wheel mouse? (top)

To enable wheel mouse operation, edit the /etc/XF86Config configuration file and add

   Option     "Buttons"       "5"
   Option     "ZAxisMapping"  "4 5"

to the

   Section "InputDevice"
      Identifier  "Mouse1"

section of the file.

Other NetBSD/i386 FAQs


Can NetBSD/i386 run Netscape and Mozilla? (top)

Yes. Netscape browsers can run on NetBSD/i386 through binary emulation.

Mozilla, where the source code is publically available, has been ported to run on NetBSD natively, and pre-built binary packages of Mozilla are available through the NetBSD packages collection (see www/mozilla).

The two easiest ways to get Netscape Navigator (stand-alone browser) or Netscape Communicator running on NetBSD/i386 are through BSDi binary emulation or Linux binary emulation. To run a BSDi version, you'll only need the kernel options for BSDi emulation in your kernel configuration file (the GENERIC kernel that gets installed with NetBSD has done this). Linux binary emulation under NetBSD/i386 relies on Linux libraries being under /emul/linux (see compat_linux(8)). The Linux versions are available through the NetBSD packages collection; if you install www/navigator or www/communicator, the dependencies of those packages will set up /emul/linux for you (or you can "make install" in emulators/suse_linux).

If you'd like to run binary-only plug-ins, such as Macromedia Flash, you'll need to have the Linux version of navigator / communicator.

Running Quake II for GNU/LINUX under NetBSD (top)

It is assumed that you already have NetBSD i386 up and running. You may also need to know how to build a kernel. These instructions are relative to the 1.4 (or newer) family of NetBSD releases, Quake II v3.20, and the NetBSD package set called suse_* v6.4 in emulators.

Other (especially later) versions will probably work at least as well.

Some caveats before you start:

Above all, read the instructions that came with Quake II.

  1. If you are not running a GENERIC NetBSD 1.4.x or 1.5.x kernel, you may need to enable COMPAT_LINUX in your kernel config, rebuild, and reboot.
  2. You need to have installed the GNU/LINUX-compatibility package referenced above. N.B.: The linux_* packages do not provide what you need---although you may wish to lift the GNU/LINUX version of BASH from that package. (Because of the way emulation works, having some shell running under emulation may occasionally be useful. But, it is not essential.)
  3. mount(8) the distribution CD.
  4. Change into the CD's root directory.
  5. Run sh(1) /bin/sh setup.
  6. During setup, you will be asked about ``rpm''; this is the Red-Hat Package Manager, which is available from the NetBSD package system. (rpm was designed for GNU/LINUX.) However, when I tried to use it, the setup script refused to take advantage of it. Don't panic, though. I simply accepted the default; if you do this, setup will try to use cpio(1). If you don't use rpm, setup will ask for the location of cpio; under the NetBSD 1.4 family of releases, it is in ``/usr/bin/cpio''.
  7. Things should be fairly smooth, otherwise. Your CD may start and stop several times during setup (mine did). This appears not to be a problem. Looking at my CD, I see distinct track boundaries on the CD-ROM, and assume that it has something to do with how they recorded the master CD-ROM.

Tips and trouble shooting.

Can you get a refund if you do not use Windows (top)

Some PC systems are only available with Microsoft Windows preinstalled. Part of the cost of such a system is for the Windows licence. If you do not want to use Windows, then you may be entitled to a refund from Microsoft. For more details see the Wired article.

The best approach is to find (and support) a reseller who can provide a PC without Windows altogether.

Debugging the NetBSD kernel via a serial line (top)

See the KGDB HOWTO.

Up to NetBSD/i386 Port Page
Home page
Documentation top level

(Contact us) $NetBSD: faq.html,v 1.136 2006/01/29 20:19:51 jschauma Exp $
Copyright © 1996-2004 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.