# FreeBSD 8.4 and Adaptec 6405 driver



## Randi (Jul 14, 2014)

The problem is that FreeBSD 8.4 _has_ no driver for Adaptec 6405. Now *I* can install _the_ driver in _the_ following steps:


Put _the_ driver for Adaptec 6405 in install*a*tion disk (boot/modules _and_ loader.conf). So *I* can boot from _the_ install disk and start _the_ install*a*tion.
After _the_ install*a*tion is complete sysinstall will put on _the_ system that driver for Adpatec Adapted that can see _the_ disk with 6405. And in this case *I* have _a_ solution with `load aacu.ko`  after `load kernel` from Escape to Loader Prompt. And it is works fine.
But *I* think about creat_ing_ _my_ own install*a*tion disk, that will install _the_ correct driver for Freebsd FreeBSD 8.4. 
So, *I* take _the_ Freebsd FreeBSD 8.4 install*a*tion disk:

`cd /mnt/iso/8.4-RELEASE/src && ./install.sh all`
`cd /usr/src/sys/dev/aac && ls`

```
aac.c
 aac_cam.c
 aac_debug.c
 aac_disk.c
 aac_linux.c
 aac_pci.c
 aac_tables.h
 aacreg.h
 aacvar.h
```

`rm *`
Download _the_ driver from Adaptec at http://www.adaptec.com/en-us/speed/raid ... 42_tgz.htm
`tar -xzf aac8x-amd64.tgz && ls`

```
+CONTENTS
 +COMMENT
 +DESC
 +POST-INSTALL
 +POST-DEINSTALL
 aacu.ko
 aac.c
 aac_cam.c
 aac_compat.h
 aac_debug.c
 aac_ioctl.h
 aac_linux.c
 aac_pci.c
 aac_tables.h
 aacreg.h
 aacvar.h
 aac_fwdb.c
 aac_fwdb.h
```

In /usr/src/sys/conf/files
Delet line:

```
dev/aac/aac_disk.c               optional aac
```
Add:

```
dev/aac/aac_fwdb.c             optional aac
```

create _a_ file for _the_ new kernel named RAID (copy from GENERIC)
`cd /usr/src/ && make buildkernel KERNCONF=RAID`

```
rm -f .newdep
make -V CFILES -V SYSTEM_CFILES -V GEN_CFILES |  MKDEP_CPP="cc -E" CC="cc" xargs mkdep -a -f .newdep -O2 -frename-registers -pipe -fno-strict-aliasing  -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc  -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/ipfilter -I/usr/src/sys/contrib/pf -I/usr/src/sys/dev/ath -I/usr/src/sys/dev/ath/ath_hal -I/usr/src/sys/contrib/ngatm -I/usr/src/sys/dev/twa -I/usr/src/sys/gnu/fs/xfs/FreeBSD -I/usr/src/sys/gnu/fs/xfs/FreeBSD/support -I/usr/src/sys/gnu/fs/xfs -I/usr/src/sys/dev/cxgb -I/usr/src/sys/dev/cxgbe -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000  -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone  -mfpmath=387 -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow  -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
make -V SFILES |  MKDEP_CPP="cc -E" xargs mkdep -a -f .newdep -x assembler-with-cpp -DLOCORE -O2 -frename-registers -pipe -fno-strict-aliasing  -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc  -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/ipfilter -I/usr/src/sys/contrib/pf -I/usr/src/sys/dev/ath -I/usr/src/sys/dev/ath/ath_hal -I/usr/src/sys/contrib/ngatm -I/usr/src/sys/dev/twa -I/usr/src/sys/gnu/fs/xfs/FreeBSD -I/usr/src/sys/gnu/fs/xfs/FreeBSD/support -I/usr/src/sys/gnu/fs/xfs -I/usr/src/sys/dev/cxgb -I/usr/src/sys/dev/cxgbe -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000  -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone  -mfpmath=387 -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow  -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
rm -f .depend
mv .newdep .depend
cd /usr/src/sys/modules; MAKEOBJDIRPREFIX=/usr/obj/usr/src/sys/RAID/modules KMODDIR=/boot/kernel DEBUG_FLAGS="-g" MACHINE=amd64 KERNBUILDDIR="/usr/obj/usr/src/sys/RAID" SYSDIR="/usr/src/sys" make  depend
===> aac (depend)
@ -> /usr/src/sys
machine -> /usr/src/sys/amd64/include
make: don't know how to make aac_disk.c. Stop
*** Error code 2

Stop in /usr/src/sys/modules.
*** Error code 1

Stop in /usr/obj/usr/src/sys/RAID.
*** Error code 1

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.
```

As *I* understand correctly, this driver can't be add_ed_ in GENERIC with this method? Can *I* try to find another way?


----------

