# 9.1 RC3: Custom Kernel Build Error 1



## decsis (Dec 9, 2012)

Hello,
I tried making my first own Kernel, but unfortunately, it fails during make buildkernel:

Here is my Kernel config:
http://pastebin.com/dyRes4gi

The problem is, I don't see what's wrong:


```
ar9280.c:(.text+0x144): undefined reference to `ath_hal_free'
ar9280.o: In function `ar9280WriteRegs':
ar9280.c:(.text+0x11d): undefined reference to `ath_hal_ini_write'
ar9287.o: In function `ar9287RfAttach':
ar9287.c:(.text+0x73): undefined reference to `ath_hal_malloc'
ar9287.o: In function `ar9287RfDetach':
ar9287.c:(.text+0x144): undefined reference to `ath_hal_free'
ar9287.o: In function `ar9287SetChannel':
ar9287.c:(.text+0x49f): undefined reference to `ath_hal_ini_write'
ar9287.o: In function `ar9287WriteRegs':
ar9287.c:(.text+0x11d): undefined reference to `ath_hal_ini_write'
sample.o: In function `calc_usecs_unicast_packet':
sample.c:(.text+0x605): undefined reference to `ath_hal_pkt_txtime'
sample.c:(.text+0x6e9): undefined reference to `ath_hal_pkt_txtime'
*** [kernel] Error code 1

Stop in /usr/obj/usr/src/sys/MYKERNEL.
*** [buildkernel] Error code 1

Stop in /usr/src.
*** [buildkernel] Error code 1

Stop in /usr/src.
```


----------



## sk8harddiefast (Dec 10, 2012)

On your kernel config you have commented

```
device         ath             # Atheros NIC's
device         ath_pci         # Atheros pci/cardbus glue
```
Uncomment them and try again


----------



## decsis (Dec 10, 2012)

sk8harddiefast said:
			
		

> On your kernel config you have commented
> 
> ```
> device         ath             # Atheros NIC's
> ...



Thanks a lot, I will try it out!


----------



## morbit (Dec 11, 2012)

The real problem is, you have commented some ath stuff, but not all of it. What you have left depends on stuff you've already commented out. Make your mind about what you want to achieve, and proceed accordingly.


----------



## decsis (Dec 11, 2012)

Thanks, the problem is solved. I just wasn't sure if I can remove all these ath modules...doing this solved the problem.


----------



## morbit (Dec 11, 2012)

Well, as I've said that depends on what you want to achieve, precisely if you already have or plan to use ath hardware, especially if you are not building related modules too (this is only in-kernel config, by default most drivers are also built as modules, and available in /boot/kernel/directory as *ko files to load on boot (editing /boot/loader.conf) or run-time (using kldload). If you want only few modules to bundle in /boot/kernel/ directory, you must define them in MODULES_OVERRIDE=. 

Oh, and most probably, you don't have AC'97 as well as Intel HD, AC'97 is earlier generation of integrated Intel sound, choose what's appropriate in your case, similar with Intel NICs, do you have 3 different ones? See what drivers(s) attach, and comment out not needed ones.


----------

