# Which is the kernel?



## balanga (Mar 10, 2019)

I've just been building FreeBSD 12.0 for Kirkwood and it seems to have finished without errors, but I'm not sure which file to use as the kernel...

I have a kernel, kernel.bin, kernel.debug and kernel.full under /usr/obj/usr/src/arm.arm/sys/DB-88F6XXX. 

Where would I find any documentation on the purpose of each of these files?


----------



## obsigna (Mar 10, 2019)

Why would a non-developer want to dive into these details when make installkernel would simply do the right thing?

Did you cross build the kernel on a different machine? In this case you want to mount the root-volume of the target device as a nfs share (another option would be to insert the SD card into the build host, and mount its root volume on a mount point). Then given, that the correct environment variables which you used for cross building said kernel is still in place, execute:
`sudo -E make installkernel TARGET_ARCH=arm KERNCONF=[COLOR=rgb(243, 121, 52)]DB-88F6XXX[/COLOR] DESTDIR=$INSTALLDIRPREFIX`

Here $INSTALLDIRPREFIX points to the mount point of said root-volume of the target device.

In case you compiled the kernel on the very machine, simply execute `make installkernel KERNCONF=[COLOR=rgb(243, 121, 52)]DB-88F6XXX[/COLOR]`. Perhaps you need to adjust the name of the kernel configuration file.


----------



## balanga (Mar 11, 2019)

The problem I'm having is that there is a two stage boot process using an SD card with a FAT partition for ubldr and a ufs partition for the rootfs. I know ubldr needs to be on the FAT partition, although I also see a ubldr.bin and ubldr.pie  and don't know what they are for.  Where does the kernel need to go? If it is on the ufs partition, how does ubldr find it?


----------



## aragats (Mar 11, 2019)

All u-boot stuff (MLO, u-boot.img, ubldr*) goes to the FAT partition. The kernel, as usual, resides in /boot.
I believe the recent versions use ubldr.bin instead of ubldr, but that doesn't matter, it's a special version of regular loader which loads the kernel from UFS or whatever partition.


----------

