Training courses

Kernel and Embedded Linux

Bootlin training courses

Embedded Linux, kernel,
Yocto Project, Buildroot, real-time,
graphics, boot time, debugging...

Bootlin logo

Elixir Cross Referencer

# $NetBSD: Makefile.bootxx,v 1.11 2014/08/24 18:27:17 apb Exp $

SRCS = start.S bootxx.c booted_dev.c blkdev.c prom.c prom_disp.S \
       putstr.c panic_putstr.c

# XXX sometimes useful for debugging
# SRCS += putulong.c

BOOT_RELOC = ${PRIMARY_LOAD_ADDRESS}

CPPFLAGS += ${PRIMARY_CPPFLAGS} \
		-DLIBSA_FS_SINGLECOMPONENT -DLIBSA_NO_FS_WRITE \
		-DLIBSA_NO_FS_CLOSE -DLIBSA_NO_FS_SEEK \
		-DLIBSA_SINGLE_DEVICE=blkdev \
		  -D"blkdevioctl(x,y,z)=EINVAL" -D"blkdevclose(f)=0" \
		-DLIBSA_NO_TWIDDLE \
		-DLIBSA_NO_FD_CHECKING \
		-DLIBSA_NO_RAW_ACCESS \
		-DLIBSA_NO_DISKLABEL_MSGS

CLEANFILES+= ${PROG}.sym ${PROG}.map ${PROG}.lds

${PROG}: ${PROG}.sym
	@echo creating ${PROG} from ${PROG}.sym...
	@${OBJCOPY} --output-target=binary ${PROG}.sym ${PROG}
	@chmod 644 ${PROG}
	@ls -l ${PROG}
	@${CHECKSIZE_CMD} ${PROG}.sym ${PROG} ${PRIMARY_MAX_LOAD} \
	    ${PRIMARY_MAX_TOTAL} || (rm -f ${PROG} ; false)

SAMISCMAKEFLAGS= SA_INCLUDE_NET=no SA_USE_CREAD=no
.include "../Makefile.bootprogs"

# We need to strip out the .eh_frame section from the final object.
# To do this, we get the linker's idea of the ldscript, and assign
# any .eh_frame sections to the special "DISCARD" section so that
# they are not included in the final object.

${PROG}.sym: ${OBJS} ${LIBSA} ${LIBKERN}
	${_MKTARGET_LINK}
	@${LD} -Ttext 0x20000000 -N --verbose 2>&1 \
	    | ${TOOL_SED} -n -e '/^==========/,/^===========/{' \
	     -e '/^========/d' \
	     -e 's,^[[:blank:]]*\.eh_frame[[:blank:]]*:,  /DISCARD/ : ,' \
	     -e 'p' -e '}' \
	    > ${PROG}.lds
	${LD} -T ${PROG}.lds -Ttext ${BOOT_RELOC} -N -e start \
	    -o ${PROG}.sym ${OBJS} ${LIBSA} ${LIBKERN} -Map ${PROG}.map
	@chmod 644 ${PROG}.sym
	@${SIZE} ${PROG}.sym