Embedded Handbook

This Handbook is dedicated for all kernel developer beginners. It provides useful snippets of code and use-cases for begginers. This will not cover the theory of FreeBSD's kernel architecture. Please, read the handbooks, given in links section.

Compiling

Environment variables for building kernel/world:

ARCH=arm
TARGET_ARCH=arm
MAKEOBJDIRPREFIX=/home/aleek/obj

Kernel

export MAKEOBJDIRPREFIX=/home/aleek/obj
export ARCH=arm
export TARGET_ARCH=arm
make kernel-toolchain (not necessary, when building world before kernel)
make buildkernel KERNCONF=BEAGLEBOARD-XM
make buildworld

All object files will be written to MAKEOBJDIRPREFIX directory. Kernel config files are stored in sys/$ARCH/conf

Compiler kernel is stored in $MAKEOBJDIRPREFIX/$TARGET_ARCH.$ARCH/usr/$MAKEOBJDIRPREFIX/sys/$KERNCONF/ i.e. /home/aleek/obj/arm.arm/usr/home/aleek/armv6/sys/BEAGLEBOARD-XM. You are interested in 3 of them:

distrib-dirs makes dirs for rootfs (var, etc, usr ), and distribution "populates DESTDIR with various configuration files and scripts, obviously mostly etc, but it will add some files to rootdir, var and probably somewhere else as well"

Running

u-boot with tftp

rootfs via nfs

debugging

kdb

j-tag and gdb

Porting FreeBSD to new boards

Let's see, how to port FreeBSD by example: BeagleBoard-xM. The port is using Flattened Device Tree for describing the software.