kboot: Move _start out of kboot and into libkboot

Move the startup code from kboot/kboot to kboot/libkboot and add the
necessary infrastructure for it to build. move start_arch.h, a private
header for libkboot, over as well.

Sponsored by:		Netflix

(cherry picked from commit a03411e84728e9b267056fd31c7d1d9d1dc1b01e)
This commit is contained in:
Warner Losh 2024-01-28 11:53:59 -07:00
parent f20b349448
commit 93fa71ab24
8 changed files with 19 additions and 4 deletions

View file

@ -2,6 +2,6 @@ NO_OBJ=t
.include <bsd.init.mk>
SUBDIR+= kboot
SUBDIR+= libkboot .WAIT kboot
.include <bsd.subdir.mk>

View file

@ -1 +1,7 @@
# Bring in the mini-libc that we wrote
KBOOTSRC=${BOOTSRC}/kboot
CFLAGS+=-I${KBOOTSRC}/include
LIBKBOOT=${BOOTOBJ}/kboot/libkboot/libkboot.a
.include "../Makefile.inc"

View file

@ -21,7 +21,6 @@ INSTALLFLAGS= -b
SRCS= \
bootinfo.c \
conf.c \
crt1.c \
gfx_fb_stub.c \
host_syscalls.c \
hostcons.c \
@ -63,7 +62,7 @@ CFLAGS+= -I${.CURDIR} -I${.CURDIR}/arch/${MACHINE_ARCH}
CFLAGS+= -Wall
DPADD= ${LDR_INTERP} ${LIBOFW} ${LIBSAFDT} ${LIBSA}
LDADD= ${LDR_INTERP} ${LIBOFW} ${LIBSAFDT} ${LIBSA}
DPADD= ${LDR_INTERP} ${LIBOFW} ${LIBSAFDT} ${LIBSA} ${LIBKBOOT}
LDADD= ${LDR_INTERP} ${LIBOFW} ${LIBSAFDT} ${LIBSA} ${LIBKBOOT}
.include <bsd.prog.mk>

View file

@ -0,0 +1,10 @@
.include <bsd.init.mk>
LIB= kboot
WARNS?= 4
CFLAGS+=-I${.CURDIR} -I${.CURDIR}/arch/${MACHINE_ARCH}
SRCS= crt1.c
.include <bsd.lib.mk>