enable debugging and add -ffreestanding to gcc cmd line to squash attempts to "optimize" functions by converting them to libc calls, e.g. turning kmzero() calls into memset() calls