Using NATA on DragonFlyBSD

In order to use newer ATA controllers, and have full support for e.g. SATA hotplugging, on DragonFlyBSD one must use 'NATA'. NATA is a more recent port of the FreeBSD ATA driver than we already have, and due to the significant changes wrt. the older ATA driver we currently still use as default, it's a separate driver. This howto explains how to use and test NATA.

Bill of materials

To get the best chance of a fully working system ;), it's always best to use a system based on HEAD, i.e., the HEAD of the CVS tree. That's where all changes to the NATA code go, as it isn't the default ATA driver yet. As of this writing, 1.9-DEVELOPMENT is the current HEAD version.

Building a kernel

In order to use NATA, the old ATA driver must be removed from the kernel, as they can't coexist in one system. Now, you have the option of adding the NATA driver(s) to the kernel binary, or using them as modules loaded at boottime. For the former, adjust your kernel config as follows:

# <snip>

device          isa
device          eisa
device          pci
options         PCI_MAP_FIXUP    # Necessary to use ATA controllers in legacy mode with the NATA driver, i.e. on IRQs 14 and 15.

# <snip>
# ATA and ATAPI devices
# remove all references to ata0, ata1, ata, atadisk, atapicd, atapifd, atapist and atapicam here
device          nata
device          natadisk
device          natapicd
# optionally, add devices natapifd, natapist, natapicam (known broken!), natausb and nataraid here

# <snip>

If you wish to use modules, remove all ATA drivers from your kernel config, but do add options PCI_MAP_FIXUP. Then, enable the module build to descend into src/sys/dev/disk/nata by adding nata to the SUBDIR specification in src/sys/dev/disk/Makefile. Don't forget to add the necessary lines to your /boot/loader.conf:

nata_load="YES"
natadisk_load="YES"
natapicd_load="YES"

Now build the fresh kernel:

# make buildkernel KERNCONF=OURNATACONF

Installing the full monty

Now we're ready to install the new kernel, userland and reboot the system:

# make installkernel KERNCONF=OURNATACONF
# make installworld
# reboot

If everything went as it should, you should now have a working NATA system!


CategoryHowTo

HowtoUseNATA (last edited 2008-01-28 04:17:22 by localhost)