head 1.24; access; symbols netbsd-11-0-RC5:1.23 netbsd-11-0-RC4:1.23 netbsd-11-0-RC3:1.23 netbsd-11-0-RC2:1.23 netbsd-11-0-RC1:1.23 perseant-exfatfs-base-20250801:1.23 netbsd-11:1.23.0.4 netbsd-11-base:1.23 netbsd-10-1-RELEASE:1.19.4.2 perseant-exfatfs-base-20240630:1.23 perseant-exfatfs:1.23.0.2 perseant-exfatfs-base:1.23 netbsd-8-3-RELEASE:1.9.2.6 netbsd-9-4-RELEASE:1.15.2.2 netbsd-10-0-RELEASE:1.19.4.1 netbsd-10-0-RC6:1.19.4.1 netbsd-10-0-RC5:1.19.4.1 netbsd-10-0-RC4:1.19.4.1 netbsd-10-0-RC3:1.19.4.1 netbsd-10-0-RC2:1.19.4.1 thorpej-ifq:1.22.0.4 thorpej-ifq-base:1.22 thorpej-altq-separation:1.22.0.2 thorpej-altq-separation-base:1.22 netbsd-10-0-RC1:1.19.4.1 netbsd-10:1.19.0.4 netbsd-10-base:1.19 bouyer-sunxi-drm:1.19.0.2 bouyer-sunxi-drm-base:1.19 netbsd-9-3-RELEASE:1.15.2.1 thorpej-i2c-spi-conf2:1.18.0.16 thorpej-i2c-spi-conf2-base:1.18 thorpej-futex2:1.18.0.14 thorpej-futex2-base:1.18 thorpej-cfargs2:1.18.0.12 thorpej-cfargs2-base:1.18 cjep_sun2x-base1:1.18 cjep_sun2x:1.18.0.10 cjep_sun2x-base:1.18 cjep_staticlib_x-base1:1.18 netbsd-9-2-RELEASE:1.15.2.1 cjep_staticlib_x:1.18.0.8 cjep_staticlib_x-base:1.18 thorpej-i2c-spi-conf:1.18.0.6 thorpej-i2c-spi-conf-base:1.18 thorpej-cfargs:1.18.0.4 thorpej-cfargs-base:1.18 thorpej-futex:1.18.0.2 thorpej-futex-base:1.18 netbsd-9-1-RELEASE:1.15.2.1 bouyer-xenpvh-base2:1.17 phil-wifi-20200421:1.17 bouyer-xenpvh-base1:1.17 phil-wifi-20200411:1.17 bouyer-xenpvh:1.17.0.2 bouyer-xenpvh-base:1.17 is-mlppp:1.16.0.4 is-mlppp-base:1.16 phil-wifi-20200406:1.17 netbsd-8-2-RELEASE:1.9.2.5 ad-namecache-base3:1.16 netbsd-9-0-RELEASE:1.15.2.1 netbsd-9-0-RC2:1.15.2.1 ad-namecache-base2:1.16 ad-namecache-base1:1.16 ad-namecache:1.16.0.2 ad-namecache-base:1.16 netbsd-9-0-RC1:1.15.2.1 phil-wifi-20191119:1.16 netbsd-9:1.15.0.2 netbsd-9-base:1.15 phil-wifi-20190609:1.14 netbsd-8-1-RELEASE:1.9.2.3 netbsd-8-1-RC1:1.9.2.3 isaki-audio2:1.14.0.2 isaki-audio2-base:1.14 pgoyette-compat-merge-20190127:1.9.10.5 pgoyette-compat-20190127:1.14 pgoyette-compat-20190118:1.14 pgoyette-compat-1226:1.14 pgoyette-compat-1126:1.14 pgoyette-compat-1020:1.14 pgoyette-compat-0930:1.14 pgoyette-compat-0906:1.14 pgoyette-compat-0728:1.14 netbsd-8-0-RELEASE:1.9.2.3 phil-wifi:1.13.0.2 phil-wifi-base:1.13 pgoyette-compat-0625:1.13 netbsd-8-0-RC2:1.9.2.3 pgoyette-compat-0521:1.12 pgoyette-compat-0502:1.12 pgoyette-compat-0422:1.12 netbsd-8-0-RC1:1.9.2.3 pgoyette-compat-0415:1.12 pgoyette-compat-0407:1.11 pgoyette-compat-0330:1.11 pgoyette-compat-0322:1.10 pgoyette-compat-0315:1.10 pgoyette-compat:1.9.0.10 pgoyette-compat-base:1.9 tls-maxphys:1.9.0.8 tls-maxphys-base-20171202:1.9 matt-nb8-mediatek:1.9.0.6 matt-nb8-mediatek-base:1.9 nick-nhusb-base-20170825:1.9 perseant-stdc-iso10646:1.9.0.4 perseant-stdc-iso10646-base:1.9 netbsd-8:1.9.0.2 netbsd-8-base:1.9 prg-localcount2-base3:1.9 prg-localcount2-base2:1.9 prg-localcount2-base1:1.9 prg-localcount2:1.8.0.6 prg-localcount2-base:1.8 pgoyette-localcount-20170426:1.8 bouyer-socketcan:1.8.0.4 bouyer-socketcan-base1:1.8 jdolecek-ncq:1.8.0.2 jdolecek-ncq-base:1.8 pgoyette-localcount:1.7.0.2 pgoyette-localcount-20170320:1.7 nick-nhusb:1.5.0.2 nick-nhusb-base-20170204:1.2; locks; strict; comment @# @; 1.24 date 2026.02.14.23.28.56; author christos; state Exp; branches; next 1.23; commitid smokFZP9Z1AEUouG; 1.23 date 2024.06.29.07.52.16; author rin; state Exp; branches; next 1.22; commitid Lni42ULaLx58RQfF; 1.22 date 2023.07.24.01.56.59; author rin; state Exp; branches; next 1.21; commitid gY5qQEXhVxqTQZxE; 1.21 date 2023.06.03.08.52.56; author lukem; state Exp; branches; next 1.20; commitid JFrjk5m11qFkNtrE; 1.20 date 2022.12.25.22.14.05; author christos; state Exp; branches; next 1.19; commitid qVwE70ZGF8AklZ6E; 1.19 date 2021.11.18.16.17.40; author manu; state Exp; branches 1.19.4.1; next 1.18; commitid V9XOd5QBc7y6jihD; 1.18 date 2020.09.06.07.20.29; author mrg; state Exp; branches; next 1.17; commitid IFqEYW6MZdeXkXmC; 1.17 date 2020.04.04.15.30.46; author christos; state Exp; branches; next 1.16; commitid EBsbFC7EYzQz753C; 1.16 date 2019.09.13.02.19.45; author manu; state Exp; branches; next 1.15; commitid wG34NSXnYQKwfNCB; 1.15 date 2019.07.26.11.30.31; author nonaka; state Exp; branches 1.15.2.1; next 1.14; commitid 8Tsw8cMShIZlVxwB; 1.14 date 2018.07.25.23.45.32; author kamil; state Exp; branches; next 1.13; commitid Lcj3I3cyT8RYJzLA; 1.13 date 2018.06.02.14.30.07; author christos; state Exp; branches 1.13.2.1; next 1.12; commitid GfAZHbOeqzIVnIEA; 1.12 date 2018.04.11.10.32.09; author nonaka; state Exp; branches; next 1.11; commitid ksmZBzDLXOIKJ0yA; 1.11 date 2018.03.27.14.15.05; author nonaka; state Exp; branches; next 1.10; commitid PM7LVWij09fis6wA; 1.10 date 2018.03.08.10.34.33; author nonaka; state Exp; branches; next 1.9; commitid APgI9haoZcOtQDtA; 1.9 date 2017.04.29.00.05.35; author nonaka; state Exp; branches 1.9.2.1 1.9.8.1 1.9.10.1; next 1.8; commitid guyPeZ8yvZOwqmPz; 1.8 date 2017.04.08.19.53.21; author christos; state Exp; branches 1.8.4.1 1.8.6.1; next 1.7; commitid mAo8FJwd588QFLMz; 1.7 date 2017.02.11.10.13.46; author nonaka; state Exp; branches 1.7.2.1; next 1.6; commitid 9bzbjJ3CZWDHgwFz; 1.6 date 2017.02.06.10.32.35; author nonaka; state Exp; branches; next 1.5; commitid Xtmama55Mkj9xSEz; 1.5 date 2017.02.05.10.13.18; author joerg; state Exp; branches 1.5.2.1; next 1.4; commitid UPpof71iUngwsKEz; 1.4 date 2017.02.04.16.14.04; author christos; state Exp; branches; next 1.3; commitid zQjVIqGhBHy9uEEz; 1.3 date 2017.02.04.13.36.07; author roy; state Exp; branches; next 1.2; commitid VPgo0ILR4NqQBDEz; 1.2 date 2017.02.03.17.24.43; author roy; state Exp; branches; next 1.1; commitid vNbjCUb4IZPwUwEz; 1.1 date 2017.01.24.11.09.14; author nonaka; state Exp; branches; next ; commitid BVmLyuu73R5U7dDz; 1.19.4.1 date 2023.09.11.13.25.42; author martin; state Exp; branches; next 1.19.4.2; commitid Ud54eKwvrPUD5mEE; 1.19.4.2 date 2024.09.20.11.31.32; author martin; state Exp; branches; next ; commitid Bk07aU2srcK7pxqF; 1.15.2.1 date 2019.09.17.19.32.00; author martin; state Exp; branches; next 1.15.2.2; commitid SifblX55NJSXSoDB; 1.15.2.2 date 2023.09.15.15.40.22; author martin; state Exp; branches; next ; commitid 3opDDuxfWf4SHSEE; 1.13.2.1 date 2019.06.10.22.06.21; author christos; state Exp; branches; next 1.13.2.2; commitid jtc8rnCzWiEEHGqB; 1.13.2.2 date 2020.04.08.14.07.41; author martin; state Exp; branches; next 1.13.2.3; commitid Qli2aW9E74UFuA3C; 1.13.2.3 date 2020.04.13.08.03.54; author martin; state Exp; branches; next ; commitid X01YhRUPVUDaec4C; 1.9.2.1 date 2018.03.13.14.54.52; author martin; state Exp; branches; next 1.9.2.2; commitid CILWjzu6AEBY7juA; 1.9.2.2 date 2018.04.02.08.50.33; author martin; state Exp; branches; next 1.9.2.3; commitid yIn4rJSCWDt8tQwA; 1.9.2.3 date 2018.04.11.14.51.43; author martin; state Exp; branches; next 1.9.2.4; commitid goRuGb8h8ek6b2yA; 1.9.2.4 date 2019.08.01.13.22.48; author martin; state Exp; branches; next 1.9.2.5; commitid 7lJMtaadY5dZlkxB; 1.9.2.5 date 2019.09.18.17.30.05; author martin; state Exp; branches; next 1.9.2.6; commitid 2kCUF3NLaJz9bwDB; 1.9.2.6 date 2023.09.15.15.44.20; author martin; state Exp; branches; next ; commitid zyf1UrzfR01eJSEE; 1.9.8.1 date 2017.04.29.00.05.35; author jdolecek; state dead; branches; next 1.9.8.2; commitid XcIYRZTAh1LmerhA; 1.9.8.2 date 2017.12.03.11.36.18; author jdolecek; state Exp; branches; next ; commitid XcIYRZTAh1LmerhA; 1.9.10.1 date 2018.03.15.09.12.03; author pgoyette; state Exp; branches; next 1.9.10.2; commitid lb7w3QtkrVH4axuA; 1.9.10.2 date 2018.03.30.06.20.11; author pgoyette; state Exp; branches; next 1.9.10.3; commitid h5ZWTFXyqL8kJrwA; 1.9.10.3 date 2018.04.16.01.59.54; author pgoyette; state Exp; branches; next 1.9.10.4; commitid qk3nktk0szmTIByA; 1.9.10.4 date 2018.06.25.07.25.42; author pgoyette; state Exp; branches; next 1.9.10.5; commitid 8PtAu9af7VvhiDHA; 1.9.10.5 date 2018.07.28.04.37.35; author pgoyette; state Exp; branches; next ; commitid 1UP1xAIUxv1ZgRLA; 1.8.4.1 date 2017.04.08.19.53.21; author christos; state dead; branches; next 1.8.4.2; 1.8.4.2 date 2017.04.08.19.53.22; author christos; state Exp; branches; next ; 1.8.6.1 date 2017.05.02.03.19.17; author pgoyette; state Exp; branches; next ; commitid oFKELrgrBgUNoLPz; 1.7.2.1 date 2017.02.11.10.13.46; author pgoyette; state dead; branches; next 1.7.2.2; commitid jjw7cAwgyKq7RfKz; 1.7.2.2 date 2017.03.20.06.57.15; author pgoyette; state Exp; branches; next 1.7.2.3; commitid jjw7cAwgyKq7RfKz; 1.7.2.3 date 2017.04.26.02.53.03; author pgoyette; state Exp; branches; next ; commitid ojV02aOSdzvBqZOz; 1.5.2.1 date 2017.02.05.10.13.18; author skrll; state dead; branches; next 1.5.2.2; commitid 8hwpk1aHl2UuyLEz; 1.5.2.2 date 2017.02.05.13.40.12; author skrll; state Exp; branches; next 1.5.2.3; commitid 8hwpk1aHl2UuyLEz; 1.5.2.3 date 2017.08.28.17.51.41; author skrll; state Exp; branches; next ; commitid UQQpnjvcNkUZn05A; desc @@ 1.24 log @Don't use --target, because this sets both the input and the output format, and now 2.46 does not auto-recognize the input anymore. use --output-target \ instead. @ text @# $NetBSD: Makefile.efiboot,v 1.23 2024/06/29 07:52:16 rin Exp $ S= ${.CURDIR}/../../../../.. NOMAN= # defined NOPIE= # defined NOLIBCSANITIZER=# defined NOSANITIZER= # defined NORELRO= # defined PROG?= boot.efi NEWVERSWHAT?= "EFI Boot" AFLAGS.start.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:} SOURCES= start.S boot.c conf.c devopen.c dev_net.c self_reloc.c panic.c SOURCES+= efiboot.c efichar.c eficons.c efidelay.c efidev.c SOURCES+= eficpufunc.c SOURCES+= efidisk.c efidisk_ll.c efigetsecs.c efimemory.c SOURCES+= efinet.c efipxe.c LIBI386SRCS= biosdisk.c bootinfo.c bootinfo_biosgeom.c bootmenu.c LIBI386SRCS+= comio_direct.c LIBI386SRCS+= diskbuf.c exec.c menuutils.c parseutils.c pread.c LIBI386SRCS+= exec_multiboot1.c exec_multiboot2.c SRCS= ${SOURCES} ${EXTRA_SOURCES} ${LIBI386SRCS} .include STRIPFLAG= # nothing LIBCRT0= # nothing LIBCRTI= # nothing LIBCRTBEGIN= # nothing LIBCRTEND= # nothing LIBC= # nothing BINDIR=/usr/mdec BINMODE=444 .PATH: ${.CURDIR} ${.CURDIR}/.. .PATH: ${.CURDIR}/../../lib .PATH: ${.CURDIR}/../../libsa LDSCRIPT?= ${.CURDIR}/ldscript LDFLAGS+= --no-dynamic-linker --noinhibit-exec -z nocombreloc LDFLAGS+= -nostdlib -T${LDSCRIPT} -Bsymbolic -shared CPPFLAGS+= -I$S -I${.CURDIR} -I${.CURDIR}/.. -I$S/lib/libsa CPPFLAGS+= -I${.OBJDIR} CPPFLAGS+= -I${.CURDIR}/../../lib COPTS+= -ffreestanding -fPIC -fshort-wchar -fno-strict-aliasing -fno-builtin COPTS+= -fno-stack-protector COPTS+= ${${ACTIVE_CC} == "gcc":? -Wno-error=unused-but-set-variable :} CPPFLAGS+= -nostdinc -D_STANDALONE CPPFLAGS+= -DEFIBOOT CPPFLAGS+= -Wall -Wmissing-prototypes CPPFLAGS+= -Wno-pointer-sign CPPFLAGS+= -DEFI_ALLOCATE_MAX_ADDRESS=0x100000000ULL CPPFLAGS+= -DHEAP_VARIABLE CPPFLAGS+= -DSUPPORT_CD9660 CPPFLAGS+= -D"devb2cdb(bno)=(bno)" CPPFLAGS+= -DSUPPORT_DOSFS CPPFLAGS+= -DSUPPORT_EXT2FS CPPFLAGS+= -DSUPPORT_BOOTP CPPFLAGS+= -DSUPPORT_DHCP CPPFLAGS+= -DSUPPORT_NFS CPPFLAGS+= -DSUPPORT_TFTP # Recent macs report garbage geometry #CPPFLAGS+= -DPASS_BIOSGEOM CPPFLAGS+= -DBIOSDISK_DEFAULT_SECSIZE=2048 # for bootinfo_biosgeom.c CPPFLAGS+= -DLIBSA_ENABLE_LS_OP #CPPFLAGS+= -DARP_DEBUG #CPPFLAGS+= -DBOOTP_DEBUG #CPPFLAGS+= -DNET_DEBUG #CPPFLAGS+= -DNETIF_DEBUG #CPPFLAGS+= -DNFS_DEBUG #CPPFLAGS+= -DRARP_DEBUG #CPPFLAGS+= -DRPC_DEBUG EFIDIR= ${S}/external/bsd/gnu-efi/dist GNUEFIARCH?= ${MACHINE_CPU} CPPFLAGS+= -I${EFIDIR}/inc -I${EFIDIR}/inc/${GNUEFIARCH} CPPFLAGS+= -I${EFIDIR}/inc/protocol SAMISCCPPFLAGS+= -DLIBSA_NFS_IMPLICIT_MOUNT SAMISCCPPFLAGS+= -DLIBSA_PRINTF_LONGLONG_SUPPORT SAMISCCPPFLAGS+= -DLIBSA_PRINTF_WIDTH_SUPPORT SAMISCCPPFLAGS+= -D"cdb2devb(bno)=(bno)" ### find out what to use for libsa SA_AS= library SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes" SAMISCMAKEFLAGS+="SA_USE_CREAD=yes" SAMISCMAKEFLAGS+="SA_INCLUDE_NET=yes" SAMISCMAKEFLAGS+="SA_ENABLE_LS_OP=yes" .include "${S}/lib/libsa/Makefile.inc" LIBSA= ${SALIB} ### find out what to use for libkern KERN_AS= library LIBKERN_ARCH?= ${MACHINE_ARCH} KERNMISCMAKEFLAGS+="LIBKERN_ARCH=${LIBKERN_ARCH}" .include "${S}/lib/libkern/Makefile.inc" LIBKERN= ${KERNLIB} ### find out what to use for libz Z_AS= library .include "${S}/lib/libz/Makefile.inc" LIBZ= ${ZLIB} ### find out what to use for libgnuefi GNUEFI_AS= library LIBGNUEFI_ARCH?= ${MACHINE_ARCH} GNUEFIMISCMAKEFLAGS+="LIBGNUEFI_ARCH=${LIBGNUEFI_ARCH}" GNUEFIMISCCPPFLAGS+= -I${EFIDIR}/lib .include "${S}/lib/libgnuefi/Makefile.inc" LIBGNUEFI= ${GNUEFILIB} cleandir distclean: .WAIT cleanlibdir cleanlibdir: -rm -rf lib LIBLIST= ${LIBGNUEFI} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBSA} VERSIONMACHINE=x86 .include "${S}/conf/newvers_stand.mk" CLEANFILES+= ${PROG}.so ${PROG}.tmp ${PROG}: ${PROG}.so ${OBJCOPY} -j .text -j .sdata -j .data -j .dynamic -j .dynsym \ -j .rel -j .rel.* -j .rela -j .rela.* -j .reloc \ --subsystem efi-app --output-target=${OBJFMT} ${PROG}.so ${.TARGET} .include ${PROG}.so: ${OBJS} ${LIBLIST} ${LDSCRIPT} ${.CURDIR}/../Makefile.efiboot ${LD} ${LDFLAGS} -o ${.TARGET}.tmp ${OBJS} ${LIBLIST} @@if ${OBJDUMP} -t ${.TARGET}.tmp | grep 'UND'; then \ (echo Undefined symbols; false); \ fi rm -f ${.TARGET} mv ${.TARGET}.tmp ${.TARGET} CWARNFLAGS.gcc+= ${CC_WNO_ADDRESS_OF_PACKED_MEMBER} KLINK_MACHINE?= ${MACHINE} .include @ 1.23 log @i386: stand: Retire its own nfs.c, and switch to libsa/nfs.c. NFC @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.22 2023/07/24 01:56:59 rin Exp $ d136 1 a136 1 --subsystem efi-app --target=${OBJFMT} ${PROG}.so ${.TARGET} @ 1.22 log @efiboot/x86: Add serial console support via raw I/O port access Unfortunately, some (most?) UEFI implementations do not support com ports by ``Serial I/O Protocol''. ``PNP0501-0'' and friends are not recognized also. In this case, if user explicitly requires to switch to serial console by ``consdev'' command, try to use raw I/O port access. Ugly, but what FreeBSD does, at least. Proposed as PR port-amd64/57523 @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.21 2023/06/03 08:52:56 lukem Exp $ d24 1 a24 3 # use our own nfs implementation LIBSASRCS+= nfs.c SRCS= ${SOURCES} ${EXTRA_SOURCES} ${LIBI386SRCS} ${LIBSASRCS} d87 1 @ 1.21 log @bsd.own.mk: rename to CC_WNO_ADDRESS_OF_PACKED_MEMBER Provide a single variable CC_WNO_ADDRESS_OF_PACKED_MEMBER with options for both clang and gcc, to replace CLANG_NO_ADDR_OF_PACKED_MEMBER CC_NO_ADDR_OF_PACKED_MEMBER GCC_NO_ADDR_OF_PACKED_MEMBER Using the convention CC_compilerflag, where compilerflag is based on the full compiler flag name. @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.20 2022/12/25 22:14:05 christos Exp $ d17 1 d21 1 @ 1.20 log @Fix broken flag -nocombreloc, 2.34 did not complain for not understanding it, but 2.39 wants -z nocombreloc. Is it really needed? @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.19 2021/11/18 16:17:40 manu Exp $ d147 1 a147 1 CWARNFLAGS.gcc+= ${GCC_NO_ADDR_OF_PACKED_MEMBER} @ 1.19 log @Do not pass BIOS geometry when booting using EFI Recent Mac return garbage data that will crash the code handling it, and EFI boot does not need it anyway. @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.18 2020/09/06 07:20:29 mrg Exp $ d44 2 a45 2 LDFLAGS+= --no-dynamic-linker --noinhibit-exec LDFLAGS+= -nostdlib -T${LDSCRIPT} -Bsymbolic -shared -nocombreloc @ 1.19.4.1 log @Pull up following revision(s) (requested by rin in ticket #361): sys/arch/i386/stand/efiboot/Makefile.efiboot: revision 1.22 sys/arch/i386/stand/efiboot/eficpufunc.c: revision 1.1 sys/arch/i386/stand/efiboot/eficpufunc.h: revision 1.1 sys/arch/i386/stand/efiboot/eficons.c: revision 1.13 efiboot/x86: Add serial console support via raw I/O port access Unfortunately, some (most?) UEFI implementations do not support com ports by ``Serial I/O Protocol''. ``PNP0501-0'' and friends are not recognized also. In this case, if user explicitly requires to switch to serial console by ``consdev'' command, try to use raw I/O port access. Ugly, but what FreeBSD does, at least. Proposed as PR port-amd64/57523 @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.19 2021/11/18 16:17:40 manu Exp $ a16 1 SOURCES+= eficpufunc.c a19 1 LIBI386SRCS+= comio_direct.c @ 1.19.4.2 log @Pull up following revision(s) (requested by rin in ticket #894): sys/arch/i386/stand/Makefile.booters: revision 1.98 sys/lib/libsa/nfsv3.h: revision 1.1 sys/lib/libsa/rpcv2.h: revision 1.4 sys/arch/i386/stand/efiboot/Makefile.efiboot: revision 1.23 sys/lib/libsa/nfsv2.h: revision 1.5 sys/lib/libsa/nfs.c: revision 1.51 sys/lib/libsa/nfs.c: revision 1.52 sys/arch/i386/stand/libsa/nfs.c: file removal sys/lib/libsa/nfs.c: revision 1.53 sys/arch/i386/stand/libsa/nfs.c: revision 1.20 sys/arch/i386/stand/libsa/nfs.c: revision 1.21 sys/arch/i386/stand/pxeboot/Makefile: revision 1.29 Add NFSv3 support. Try NFSv3 and fall back to NFSv2. Merge with generic libsa NFS code to minimize differences and to learn NFSv3. libsa: nfs: Fix NFS_NOSYMLINK option for previous Used only by mvme68k. Align again with libsa (NFS_NOSYMLINK fix). libsa/nfs.c: Add `LIBSA_NFS_IMPLICIT_MOUNT` compile-time option by which nfs_mount() is automatically called from nfs_open(), as done for nfs.c in i386/stand. This is only functional difference b/w two copies of nfs.c. Now, we can safely retire the latter. XXX It would be really nice to drop this option also. However, unfortunately, it is too much for me at the very moment... i386: stand: Retire its own nfs.c, and switch to libsa/nfs.c. NFC @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.19.4.1 2023/09/11 13:25:42 martin Exp $ d24 3 a26 1 SRCS= ${SOURCES} ${EXTRA_SOURCES} ${LIBI386SRCS} a88 1 SAMISCCPPFLAGS+= -DLIBSA_NFS_IMPLICIT_MOUNT @ 1.18 log @add support for new GCC 9 warnings that may be too much to fix right now. new address-of-packed-member and format-overflow warnings have new GCC_NO_ADDR_OF_PACKED_MEMBER amd GCC_NO_FORMAT_OVERFLOW variables to remove these warnings. apply to a bunch of the tree. mostly, these are real bugs that should be fixed, but in many cases, only by removing the 'packed' attribute from some structure that doesn't really need it. (i looked at many different ones, and while perhaps 60-80% were already properly aligned, it wasn't clear to me that the uses were always coming from sane data vs network alignment, so it doesn't seem safe to remove packed without careful research for each affect struct.) clang already warned (and was not erroring) for many of these cases, but gcc picked up dozens more. @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.17 2020/04/04 15:30:46 christos Exp $ d69 2 a70 1 CPPFLAGS+= -DPASS_BIOSGEOM @ 1.17 log @Add --noinhibit-exec and --no-dynamic-linker @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.16 2019/09/13 02:19:45 manu Exp $ d146 2 @ 1.16 log @Add multiboot 2 support to x86 bootloaders multiboot 2 is required to boot Xen on an EFI system. This also require a kernel patch for properly discovering the ACPI RSDP, which is available after 20190912, in src/sys/arch/x86/acpi/acpi_machdep.c 1.26-1.28 There are a few missing bit in this multiboot 2 implementation (which are unused by Xen): - Header tags Address, Freambuffer, and Relocatable are ignored - Tags APM and Network are not provided - Tags ACPI old and ACP new are only provided for ACPI boot - Tag boot device does not provides the subpart (BSD disklabel partition) Notes: - multiboot2 is disabled in dosboot, otherwise the binary gets too big and build fails. - in src/sys/arch/i386/stand/efiboot, consinit() is renamed as efi_consinit() to avoid prototype conflicts in src/sys/sys/systm.h @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.15 2019/07/26 11:30:31 nonaka Exp $ d44 1 @ 1.15 log @Added tftp support to x86 efiboot. @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.14 2018/07/25 23:45:32 kamil Exp $ d21 1 @ 1.15.2.1 log @Pull up following revision(s) (requested by manu in ticket #203): sys/arch/i386/include/multiboot2.h: revision 1.1 sys/arch/i386/stand/lib/exec.c: revision 1.74 sys/arch/i386/stand/efiboot/efiboot.c: revision 1.11 sys/arch/i386/stand/efiboot/bootia32/multiboot32.S: revision 1.1 sys/arch/i386/stand/lib/biosdisk.c: revision 1.52 sys/arch/i386/stand/efiboot/bootx64/efibootx64.c: revision 1.5 sys/arch/i386/stand/efiboot/eficons.c: revision 1.7 sys/arch/i386/stand/efiboot/bootia32/efibootia32.c: revision 1.5 sys/arch/i386/stand/lib/libi386.h: revision 1.45 sys/arch/i386/stand/lib/bootinfo_memmap.c: revision 1.6 sys/arch/i386/stand/lib/pread.c: revision 1.8 sys/arch/i386/stand/efiboot/efiboot.h: revision 1.10 sys/arch/i386/stand/efiboot/bootia32/Makefile: revision 1.3 sys/arch/i386/stand/lib/Makefile: revision 1.47 sys/arch/i386/stand/efiboot/bootx64/Makefile: revision 1.2 sys/arch/i386/stand/lib/multiboot.S: revision 1.3 sys/arch/i386/stand/efiboot/bootx64/multiboot64.S: revision 1.1 sys/arch/i386/stand/efiboot/efimemory.c: revision 1.9 sys/arch/i386/stand/efiboot/boot.c: revision 1.16 sys/arch/i386/include/Makefile: revision 1.50 sys/arch/i386/stand/efiboot/Makefile.efiboot: revision 1.16 share/man/man8/man8.x86/boot.8: revision 1.20 sys/arch/i386/stand/boot/Makefile.boot: revision 1.73 sys/arch/i386/stand/pxeboot/Makefile: revision 1.26 sys/arch/i386/stand/lib/exec_multiboot1.c: revision 1.1 sys/arch/i386/stand/netboot/Makefile.netboot: revision 1.11 sys/arch/i386/stand/lib/exec_multiboot2.c: revision 1.1 sys/arch/i386/stand/lib/biosdisk.h: revision 1.12 sys/arch/i386/stand/lib/exec_multiboot2.c: revision 1.2 sys/arch/i386/stand/dosboot/Makefile: revision 1.32 Add multiboot 2 support to x86 bootloaders multiboot 2 is required to boot Xen on an EFI system. This also require a kernel patch for properly discovering the ACPI RSDP, which is available after 20190912, in src/sys/arch/x86/acpi/acpi_machdep.c 1.26-1.28 There are a few missing bit in this multiboot 2 implementation (which are unused by Xen): - Header tags Address, Freambuffer, and Relocatable are ignored - Tags APM and Network are not provided - Tags ACPI old and ACP new are only provided for ACPI boot - Tag boot device does not provides the subpart (BSD disklabel partition) Notes: - multiboot2 is disabled in dosboot, otherwise the binary gets too big and build fails. - in src/sys/arch/i386/stand/efiboot, consinit() is renamed as efi_consinit() to avoid prototype conflicts in src/sys/sys/systm.h Remove debug define. It remained there unseen because it was misspelled! Remove obsoeolete BUGS note that UEFI bootloader does not support multiboot @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.15 2019/07/26 11:30:31 nonaka Exp $ a20 1 LIBI386SRCS+= exec_multiboot1.c exec_multiboot2.c @ 1.15.2.2 log @Pull up following revision(s) (requested by rin in ticket #1732): sys/arch/i386/stand/efiboot/Makefile.efiboot: revision 1.22 sys/arch/i386/stand/efiboot/eficpufunc.c: revision 1.1 sys/arch/i386/stand/efiboot/eficpufunc.h: revision 1.1 sys/arch/i386/stand/efiboot/eficons.c: revision 1.13 sys/arch/i386/stand/efiboot/eficons.c: revision 1.14 efiboot/x86: Add serial console support via raw I/O port access Unfortunately, some (most?) UEFI implementations do not support com ports by ``Serial I/O Protocol''. ``PNP0501-0'' and friends are not recognized also. In this case, if user explicitly requires to switch to serial console by ``consdev'' command, try to use raw I/O port access. Ugly, but what FreeBSD does, at least. Proposed as PR port-amd64/57523 efiboot/x86: eficons.c: Explicitly include params.h for howmany() NFC for -current and netbsd-10, but necessary for netbsd-[89] to pull up raw IO serial port support (PR port-amd64/57523). @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.15.2.1 2019/09/17 19:32:00 martin Exp $ a16 1 SOURCES+= eficpufunc.c a19 1 LIBI386SRCS+= comio_direct.c @ 1.14 log @Specify NOLIBCSANITIZER in x86 bootloader-like code under sys/arch/ Set NOLIBCSANITIZER for i386 and amd64 specific bootloader-like code. @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.13 2018/06/02 14:30:07 christos Exp $ d21 3 a23 1 SRCS= ${SOURCES} ${EXTRA_SOURCES} ${LIBI386SRCS} d40 1 d66 1 a66 1 #CPPFLAGS+= -DSUPPORT_TFTP @ 1.13 log @- Disable MKSANITIZER - Redo using NOPIE - Add NORELRO @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.12 2018/04/11 10:32:09 nonaka Exp $ d7 1 @ 1.13.2.1 log @Sync with HEAD @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.14 2018/07/25 23:45:32 kamil Exp $ a6 1 NOLIBCSANITIZER=# defined @ 1.13.2.2 log @Merge changes from current as of 20200406 @ text @d1 1 a1 1 # $NetBSD$ a39 1 LDFLAGS+= --no-dynamic-linker --noinhibit-exec @ 1.13.2.3 log @Mostly merge changes from HEAD upto 20200411 @ text @d21 1 a21 4 LIBI386SRCS+= exec_multiboot1.c exec_multiboot2.c # use our own nfs implementation LIBSASRCS+= nfs.c SRCS= ${SOURCES} ${EXTRA_SOURCES} ${LIBI386SRCS} ${LIBSASRCS} a37 1 .PATH: ${.CURDIR}/../../libsa d64 1 a64 1 CPPFLAGS+= -DSUPPORT_TFTP @ 1.12 log @efiboot: Added network boot support. @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.11 2018/03/27 14:15:05 nonaka Exp $ d6 3 d22 1 a22 5 PIE_CFLAGS= PIE_LDFLAGS= PIE_AFLAGS= .include @ 1.11 log @efiboot: Added serial console support. @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.10 2018/03/08 10:34:33 nonaka Exp $ d11 6 a16 6 SOURCES?= start.S conf.c devopen.c efiboot.c self_reloc.c LIBI386SRCS= boot.c biosdisk.c bootinfo.c bootinfo_biosgeom.c LIBI386SRCS+= bootmenu.c diskbuf.c exec.c menuutils.c LIBI386SRCS+= panic.c parseutils.c pread.c LIBI386SRCS+= efichar.c eficons.c efidelay.c efidev.c efidisk.c efidisk_ll.c LIBI386SRCS+= efigetsecs.c efimemory.c d60 4 d68 8 a83 2 SAMISCMAKEFLAGS+= SA_USE_CREAD=yes # Read compressed kernels SAMISCMAKEFLAGS+= SA_INCLUDE_NET=no # Netboot via TFTP, NFS d88 2 @ 1.10 log @efiboot: system can boot from CD/DVD-ROM media. @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.9 2017/04/29 00:05:35 nonaka Exp $ d15 1 a15 1 LIBI386SRCS+= eficons.c efidelay.c efidev.c efidisk.c efidisk_ll.c @ 1.9 log @efiboot: Boot parameters can be set via installboot(8). @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.8 2017/04/08 19:53:21 christos Exp $ d15 2 a16 2 LIBI386SRCS+= eficons.c efidelay.c efidisk.c efidisk_ll.c efigetsecs.c LIBI386SRCS+= efimemory.c d57 1 d61 1 d71 1 @ 1.9.10.1 log @Synch with HEAD @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.10 2018/03/08 10:34:33 nonaka Exp $ d15 2 a16 2 LIBI386SRCS+= eficons.c efidelay.c efidev.c efidisk.c efidisk_ll.c LIBI386SRCS+= efigetsecs.c efimemory.c a56 1 CPPFLAGS+= -D"devb2cdb(bno)=(bno)" a59 1 CPPFLAGS+= -DBIOSDISK_DEFAULT_SECSIZE=2048 # for bootinfo_biosgeom.c a68 1 SAMISCCPPFLAGS+= -D"cdb2devb(bno)=(bno)" @ 1.9.10.2 log @Resolve conflicts between branch and HEAD @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.11 2018/03/27 14:15:05 nonaka Exp $ d15 1 a15 1 LIBI386SRCS+= efichar.c eficons.c efidelay.c efidev.c efidisk.c efidisk_ll.c @ 1.9.10.3 log @Sync with HEAD, resolve some conflicts @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.12 2018/04/11 10:32:09 nonaka Exp $ d11 6 a16 6 SOURCES= start.S boot.c conf.c devopen.c dev_net.c self_reloc.c panic.c SOURCES+= efiboot.c efichar.c eficons.c efidelay.c efidev.c SOURCES+= efidisk.c efidisk_ll.c efigetsecs.c efimemory.c SOURCES+= efinet.c efipxe.c LIBI386SRCS= biosdisk.c bootinfo.c bootinfo_biosgeom.c bootmenu.c LIBI386SRCS+= diskbuf.c exec.c menuutils.c parseutils.c pread.c a59 4 CPPFLAGS+= -DSUPPORT_BOOTP CPPFLAGS+= -DSUPPORT_DHCP CPPFLAGS+= -DSUPPORT_NFS #CPPFLAGS+= -DSUPPORT_TFTP a63 8 #CPPFLAGS+= -DARP_DEBUG #CPPFLAGS+= -DBOOTP_DEBUG #CPPFLAGS+= -DNET_DEBUG #CPPFLAGS+= -DNETIF_DEBUG #CPPFLAGS+= -DNFS_DEBUG #CPPFLAGS+= -DRARP_DEBUG #CPPFLAGS+= -DRPC_DEBUG d72 2 a77 2 SAMISCMAKEFLAGS+="SA_USE_CREAD=yes" SAMISCMAKEFLAGS+="SA_INCLUDE_NET=yes" @ 1.9.10.4 log @Sync with HEAD @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.13 2018/06/02 14:30:07 christos Exp $ a5 3 NOPIE= # defined NOSANITIZER= # defined NORELRO= # defined d19 5 a23 1 .include @ 1.9.10.5 log @Sync with HEAD @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.14 2018/07/25 23:45:32 kamil Exp $ a6 1 NOLIBCSANITIZER=# defined @ 1.9.2.1 log @Pull up following revision(s) (requested by nonaka in ticket #625): sys/arch/i386/stand/efiboot/efidisk.c: revision 1.2 sys/arch/i386/stand/efiboot/devopen.c: revision 1.2 sys/arch/i386/stand/efiboot/efidisk.h: revision 1.2 sys/arch/i386/stand/efiboot/boot.c: revision 1.6 sys/arch/i386/stand/efiboot/efidisk_ll.c: revision 1.2 sys/arch/i386/stand/efiboot/efidev.c: revision 1.1 sys/arch/i386/stand/lib/biosdisk_ll.h: revision 1.16 sys/arch/i386/stand/lib/biosdisk.h: revision 1.9 sys/lib/libsa/cd9660.c: revision 1.31 sys/arch/i386/stand/efiboot/efiboot.c: revision 1.5 sys/arch/i386/stand/efiboot/efiboot.h: revision 1.6 sys/arch/i386/stand/lib/biosdisk.c: revision 1.47 sys/arch/i386/stand/efiboot/Makefile.efiboot: revision 1.10 sys/arch/i386/stand/efiboot/TODO.efiboot: revision 1.4 efiboot: system can boot from CD/DVD-ROM media. Add missed file in previous commit. @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.9 2017/04/29 00:05:35 nonaka Exp $ d15 2 a16 2 LIBI386SRCS+= eficons.c efidelay.c efidev.c efidisk.c efidisk_ll.c LIBI386SRCS+= efigetsecs.c efimemory.c a56 1 CPPFLAGS+= -D"devb2cdb(bno)=(bno)" a59 1 CPPFLAGS+= -DBIOSDISK_DEFAULT_SECSIZE=2048 # for bootinfo_biosgeom.c a68 1 SAMISCCPPFLAGS+= -D"cdb2devb(bno)=(bno)" @ 1.9.2.2 log @Pull up following revision(s) (requested by nonaka in ticket #685): sys/arch/i386/stand/efiboot/efidisk.c: revision 1.4 sys/arch/i386/stand/efiboot/bootx64/efibootx64.c: revision 1.4 sys/arch/i386/stand/efiboot/eficons.c: revision 1.5 sys/arch/i386/stand/efiboot/efichar.c: revision 1.1 sys/arch/i386/stand/efiboot/bootia32/efibootia32.c: revision 1.4 sys/arch/i386/stand/efiboot/boot.c: revision 1.8 sys/arch/i386/stand/efiboot/efimemory.c: revision 1.5 sys/arch/i386/stand/efiboot/efiboot.c: revision 1.6 sys/arch/i386/stand/efiboot/efidelay.c: revision 1.2 sys/arch/i386/stand/efiboot/efiboot.h: revision 1.7 sys/arch/i386/stand/efiboot/Makefile.efiboot: revision 1.11 efiboot: Added serial console support. @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.9.2.1 2018/03/13 14:54:52 martin Exp $ d15 1 a15 1 LIBI386SRCS+= efichar.c eficons.c efidelay.c efidev.c efidisk.c efidisk_ll.c @ 1.9.2.3 log @Pull up following revision(s) (requested by nonaka in ticket #739): sys/arch/i386/stand/efiboot/efinet.h: revision 1.1 sys/arch/i386/stand/efiboot/efinet.c: revision 1.1 sys/arch/i386/stand/efiboot/conf.c: revision 1.2 sys/arch/i386/stand/efiboot/devopen.c: revision 1.5 sys/arch/i386/stand/efiboot/efidisk.c: revision 1.6 sys/arch/i386/stand/efiboot/devopen.h: revision 1.3 sys/arch/i386/stand/efiboot/efipxe.c: revision 1.1 sys/arch/i386/stand/efiboot/efiboot.c: revision 1.7 sys/arch/i386/stand/efiboot/boot.c: revision 1.10 sys/arch/i386/stand/efiboot/efiboot.h: revision 1.8 sys/arch/i386/stand/efiboot/Makefile.efiboot: revision 1.12 sys/arch/i386/stand/efiboot/dev_net.c: revision 1.1 efiboot: Added network boot support. @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.9.2.2 2018/04/02 08:50:33 martin Exp $ d11 6 a16 6 SOURCES= start.S boot.c conf.c devopen.c dev_net.c self_reloc.c panic.c SOURCES+= efiboot.c efichar.c eficons.c efidelay.c efidev.c SOURCES+= efidisk.c efidisk_ll.c efigetsecs.c efimemory.c SOURCES+= efinet.c efipxe.c LIBI386SRCS= biosdisk.c bootinfo.c bootinfo_biosgeom.c bootmenu.c LIBI386SRCS+= diskbuf.c exec.c menuutils.c parseutils.c pread.c a59 4 CPPFLAGS+= -DSUPPORT_BOOTP CPPFLAGS+= -DSUPPORT_DHCP CPPFLAGS+= -DSUPPORT_NFS #CPPFLAGS+= -DSUPPORT_TFTP a63 8 #CPPFLAGS+= -DARP_DEBUG #CPPFLAGS+= -DBOOTP_DEBUG #CPPFLAGS+= -DNET_DEBUG #CPPFLAGS+= -DNETIF_DEBUG #CPPFLAGS+= -DNFS_DEBUG #CPPFLAGS+= -DRARP_DEBUG #CPPFLAGS+= -DRPC_DEBUG d72 2 a77 2 SAMISCMAKEFLAGS+="SA_USE_CREAD=yes" SAMISCMAKEFLAGS+="SA_INCLUDE_NET=yes" @ 1.9.2.4 log @Pull up following revision(s) (requested by nonaka in ticket #1309): sys/arch/i386/stand/lib/exec.c: revision 1.73 sys/arch/i386/stand/efiboot/efiboot.c: revision 1.10 sys/arch/i386/stand/lib/libi386.h: revision 1.44 sys/arch/i386/stand/efiboot/efimemory.c: revision 1.6 sys/arch/i386/stand/efiboot/efimemory.c: revision 1.7 sys/arch/i386/stand/efiboot/efimemory.c: revision 1.8 sys/arch/i386/stand/efiboot/efiboot.c: revision 1.9 sys/arch/i386/stand/efiboot/boot.c: revision 1.12 sys/arch/i386/stand/efiboot/boot.c: revision 1.13 sys/arch/i386/stand/efiboot/efiboot.h: revision 1.9 sys/arch/i386/stand/efiboot/Makefile.efiboot: revision 1.15 sys/arch/i386/stand/efiboot/dev_net.c: revision 1.2 Added tftp support to x86 efiboot. Pre-allocate memory for the kernel space at startup. Added BTINFO_EFIMEMMAP compaction support to x86 efiboot. Sync the output of memmap command to the output of stand/efiboot mem command. Added missing efi_memory_probe() call. @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.9.2.3 2018/04/11 14:51:43 martin Exp $ d17 1 a17 3 # use our own nfs implementation LIBSASRCS+= nfs.c SRCS= ${SOURCES} ${EXTRA_SOURCES} ${LIBI386SRCS} ${LIBSASRCS} a37 1 .PATH: ${.CURDIR}/../../libsa d63 1 a63 1 CPPFLAGS+= -DSUPPORT_TFTP @ 1.9.2.5 log @Pull up following revision(s) [adapted, via patch] (requested by manu in ticket #1382): sys/arch/i386/include/multiboot2.h: revision 1.1 sys/arch/i386/stand/lib/exec.c: revision 1.74 sys/arch/i386/stand/efiboot/efiboot.c: revision 1.11 sys/arch/i386/stand/efiboot/bootia32/multiboot32.S: revision 1.1 sys/arch/i386/stand/lib/biosdisk.c: revision 1.52 sys/arch/i386/stand/efiboot/bootx64/efibootx64.c: revision 1.5 distrib/sets/lists/comp/md.amd64: revision 1.273 sys/arch/i386/stand/efiboot/eficons.c: revision 1.7 sys/arch/i386/stand/efiboot/bootia32/efibootia32.c: revision 1.5 distrib/sets/lists/comp/md.i386: revision 1.191 sys/arch/i386/stand/lib/libi386.h: revision 1.45 sys/arch/i386/stand/lib/bootinfo_memmap.c: revision 1.6 sys/arch/i386/stand/lib/pread.c: revision 1.8 sys/arch/i386/stand/efiboot/efiboot.h: revision 1.10 sys/arch/i386/stand/efiboot/bootia32/Makefile: revision 1.3 sys/arch/i386/stand/lib/Makefile: revision 1.47 sys/arch/i386/stand/efiboot/bootx64/Makefile: revision 1.2 sys/arch/i386/stand/lib/multiboot.S: revision 1.3 sys/arch/i386/stand/efiboot/bootx64/multiboot64.S: revision 1.1 sys/arch/i386/stand/efiboot/efimemory.c: revision 1.9 sys/arch/i386/stand/efiboot/boot.c: revision 1.16 sys/arch/i386/include/Makefile: revision 1.50 sys/arch/i386/stand/efiboot/Makefile.efiboot: revision 1.16 share/man/man8/man8.x86/boot.8: revision 1.20 sys/arch/i386/stand/boot/Makefile.boot: revision 1.73 sys/arch/i386/stand/pxeboot/Makefile: revision 1.26 sys/arch/i386/stand/lib/exec_multiboot1.c: revision 1.1 sys/arch/i386/stand/netboot/Makefile.netboot: revision 1.11 sys/arch/i386/stand/lib/exec_multiboot2.c: revision 1.1 sys/arch/i386/stand/lib/biosdisk.h: revision 1.12 sys/arch/i386/stand/lib/exec_multiboot2.c: revision 1.2 sys/arch/i386/stand/dosboot/Makefile: revision 1.32 sys/external/bsd/gnu-efi/dist/inc/efiapi.h (apply patch) Add multiboot 2 support to x86 bootloaders multiboot 2 is required to boot Xen on an EFI system. This also require a kernel patch for properly discovering the ACPI RSDP, which is available after 20190912, in src/sys/arch/x86/acpi/acpi_machdep.c 1.26-1.28 There are a few missing bit in this multiboot 2 implementation (which are unused by Xen): - Header tags Address, Freambuffer, and Relocatable are ignored - Tags APM and Network are not provided - Tags ACPI old and ACP new are only provided for ACPI boot - Tag boot device does not provides the subpart (BSD disklabel partition) Notes: - multiboot2 is disabled in dosboot, otherwise the binary gets too big and build fails. - in src/sys/arch/i386/stand/efiboot, consinit() is renamed as efi_consinit() to avoid prototype conflicts in src/sys/sys/systm.h Remove debug define. It remained there unseen because it was misspelled! Remove obsoeolete BUGS note that UEFI bootloader does not support multiboot Add new multiboot2.h header. @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.16 2019/09/13 02:19:45 manu Exp $ a16 1 LIBI386SRCS+= exec_multiboot1.c exec_multiboot2.c @ 1.9.2.6 log @Pull up following revision(s) (requested by rin in ticket #1897): sys/arch/i386/stand/efiboot/Makefile.efiboot: revision 1.22 sys/arch/i386/stand/efiboot/eficpufunc.c: revision 1.1 sys/arch/i386/stand/efiboot/eficpufunc.h: revision 1.1 sys/arch/i386/stand/efiboot/eficons.c: revision 1.13 sys/arch/i386/stand/efiboot/eficons.c: revision 1.14 efiboot/x86: Add serial console support via raw I/O port access Unfortunately, some (most?) UEFI implementations do not support com ports by ``Serial I/O Protocol''. ``PNP0501-0'' and friends are not recognized also. In this case, if user explicitly requires to switch to serial console by ``consdev'' command, try to use raw I/O port access. Ugly, but what FreeBSD does, at least. Proposed as PR port-amd64/57523 efiboot/x86: eficons.c: Explicitly include params.h for howmany() NFC for -current and netbsd-10, but necessary for netbsd-[89] to pull up raw IO serial port support (PR port-amd64/57523). @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.9.2.5 2019/09/18 17:30:05 martin Exp $ a12 1 SOURCES+= eficpufunc.c a15 1 LIBI386SRCS+= comio_direct.c @ 1.9.8.1 log @file Makefile.efiboot was added on branch tls-maxphys on 2017-12-03 11:36:18 +0000 @ text @d1 127 @ 1.9.8.2 log @update from HEAD @ text @a0 127 # $NetBSD$ S= ${.CURDIR}/../../../../.. NOMAN= # defined PROG?= boot.efi NEWVERSWHAT?= "EFI Boot" AFLAGS.start.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:} SOURCES?= start.S conf.c devopen.c efiboot.c self_reloc.c LIBI386SRCS= boot.c biosdisk.c bootinfo.c bootinfo_biosgeom.c LIBI386SRCS+= bootmenu.c diskbuf.c exec.c menuutils.c LIBI386SRCS+= panic.c parseutils.c pread.c LIBI386SRCS+= eficons.c efidelay.c efidisk.c efidisk_ll.c efigetsecs.c LIBI386SRCS+= efimemory.c SRCS= ${SOURCES} ${EXTRA_SOURCES} ${LIBI386SRCS} PIE_CFLAGS= PIE_LDFLAGS= PIE_AFLAGS= .include STRIPFLAG= # nothing LIBCRT0= # nothing LIBCRTI= # nothing LIBCRTBEGIN= # nothing LIBCRTEND= # nothing LIBC= # nothing BINDIR=/usr/mdec BINMODE=444 .PATH: ${.CURDIR} ${.CURDIR}/.. .PATH: ${.CURDIR}/../../lib LDSCRIPT?= ${.CURDIR}/ldscript LDFLAGS+= -nostdlib -T${LDSCRIPT} -Bsymbolic -shared -nocombreloc CPPFLAGS+= -I$S -I${.CURDIR} -I${.CURDIR}/.. -I$S/lib/libsa CPPFLAGS+= -I${.OBJDIR} CPPFLAGS+= -I${.CURDIR}/../../lib COPTS+= -ffreestanding -fPIC -fshort-wchar -fno-strict-aliasing -fno-builtin COPTS+= -fno-stack-protector COPTS+= ${${ACTIVE_CC} == "gcc":? -Wno-error=unused-but-set-variable :} CPPFLAGS+= -nostdinc -D_STANDALONE CPPFLAGS+= -DEFIBOOT CPPFLAGS+= -Wall -Wmissing-prototypes CPPFLAGS+= -Wno-pointer-sign CPPFLAGS+= -DEFI_ALLOCATE_MAX_ADDRESS=0x100000000ULL CPPFLAGS+= -DHEAP_VARIABLE CPPFLAGS+= -DSUPPORT_CD9660 CPPFLAGS+= -DSUPPORT_DOSFS CPPFLAGS+= -DSUPPORT_EXT2FS CPPFLAGS+= -DPASS_BIOSGEOM CPPFLAGS+= -DLIBSA_ENABLE_LS_OP EFIDIR= ${S}/external/bsd/gnu-efi/dist GNUEFIARCH?= ${MACHINE_CPU} CPPFLAGS+= -I${EFIDIR}/inc -I${EFIDIR}/inc/${GNUEFIARCH} CPPFLAGS+= -I${EFIDIR}/inc/protocol SAMISCCPPFLAGS+= -DLIBSA_PRINTF_LONGLONG_SUPPORT SAMISCCPPFLAGS+= -DLIBSA_PRINTF_WIDTH_SUPPORT SAMISCMAKEFLAGS+= SA_USE_CREAD=yes # Read compressed kernels SAMISCMAKEFLAGS+= SA_INCLUDE_NET=no # Netboot via TFTP, NFS ### find out what to use for libsa SA_AS= library SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes" SAMISCMAKEFLAGS+="SA_ENABLE_LS_OP=yes" .include "${S}/lib/libsa/Makefile.inc" LIBSA= ${SALIB} ### find out what to use for libkern KERN_AS= library LIBKERN_ARCH?= ${MACHINE_ARCH} KERNMISCMAKEFLAGS+="LIBKERN_ARCH=${LIBKERN_ARCH}" .include "${S}/lib/libkern/Makefile.inc" LIBKERN= ${KERNLIB} ### find out what to use for libz Z_AS= library .include "${S}/lib/libz/Makefile.inc" LIBZ= ${ZLIB} ### find out what to use for libgnuefi GNUEFI_AS= library LIBGNUEFI_ARCH?= ${MACHINE_ARCH} GNUEFIMISCMAKEFLAGS+="LIBGNUEFI_ARCH=${LIBGNUEFI_ARCH}" GNUEFIMISCCPPFLAGS+= -I${EFIDIR}/lib .include "${S}/lib/libgnuefi/Makefile.inc" LIBGNUEFI= ${GNUEFILIB} cleandir distclean: .WAIT cleanlibdir cleanlibdir: -rm -rf lib LIBLIST= ${LIBGNUEFI} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBSA} VERSIONMACHINE=x86 .include "${S}/conf/newvers_stand.mk" CLEANFILES+= ${PROG}.so ${PROG}.tmp ${PROG}: ${PROG}.so ${OBJCOPY} -j .text -j .sdata -j .data -j .dynamic -j .dynsym \ -j .rel -j .rel.* -j .rela -j .rela.* -j .reloc \ --subsystem efi-app --target=${OBJFMT} ${PROG}.so ${.TARGET} .include ${PROG}.so: ${OBJS} ${LIBLIST} ${LDSCRIPT} ${.CURDIR}/../Makefile.efiboot ${LD} ${LDFLAGS} -o ${.TARGET}.tmp ${OBJS} ${LIBLIST} @@if ${OBJDUMP} -t ${.TARGET}.tmp | grep 'UND'; then \ (echo Undefined symbols; false); \ fi rm -f ${.TARGET} mv ${.TARGET}.tmp ${.TARGET} KLINK_MACHINE?= ${MACHINE} .include @ 1.8 log @centralize vers.c building for standalone programs. @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.7 2017/02/11 10:13:46 nonaka Exp $ d13 1 a13 1 LIBI386SRCS+= bootmenu.c boot_params.S diskbuf.c exec.c menuutils.c @ 1.8.4.1 log @file Makefile.efiboot was added on branch bouyer-socketcan on 2017-04-08 19:53:22 +0000 @ text @d1 127 @ 1.8.4.2 log @1249242 @ text @a0 127 # $NetBSD: Makefile.efiboot,v 1.8 2017/04/08 19:53:21 christos Exp $ S= ${.CURDIR}/../../../../.. NOMAN= # defined PROG?= boot.efi NEWVERSWHAT?= "EFI Boot" AFLAGS.start.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:} SOURCES?= start.S conf.c devopen.c efiboot.c self_reloc.c LIBI386SRCS= boot.c biosdisk.c bootinfo.c bootinfo_biosgeom.c LIBI386SRCS+= bootmenu.c boot_params.S diskbuf.c exec.c menuutils.c LIBI386SRCS+= panic.c parseutils.c pread.c LIBI386SRCS+= eficons.c efidelay.c efidisk.c efidisk_ll.c efigetsecs.c LIBI386SRCS+= efimemory.c SRCS= ${SOURCES} ${EXTRA_SOURCES} ${LIBI386SRCS} PIE_CFLAGS= PIE_LDFLAGS= PIE_AFLAGS= .include STRIPFLAG= # nothing LIBCRT0= # nothing LIBCRTI= # nothing LIBCRTBEGIN= # nothing LIBCRTEND= # nothing LIBC= # nothing BINDIR=/usr/mdec BINMODE=444 .PATH: ${.CURDIR} ${.CURDIR}/.. .PATH: ${.CURDIR}/../../lib LDSCRIPT?= ${.CURDIR}/ldscript LDFLAGS+= -nostdlib -T${LDSCRIPT} -Bsymbolic -shared -nocombreloc CPPFLAGS+= -I$S -I${.CURDIR} -I${.CURDIR}/.. -I$S/lib/libsa CPPFLAGS+= -I${.OBJDIR} CPPFLAGS+= -I${.CURDIR}/../../lib COPTS+= -ffreestanding -fPIC -fshort-wchar -fno-strict-aliasing -fno-builtin COPTS+= -fno-stack-protector COPTS+= ${${ACTIVE_CC} == "gcc":? -Wno-error=unused-but-set-variable :} CPPFLAGS+= -nostdinc -D_STANDALONE CPPFLAGS+= -DEFIBOOT CPPFLAGS+= -Wall -Wmissing-prototypes CPPFLAGS+= -Wno-pointer-sign CPPFLAGS+= -DEFI_ALLOCATE_MAX_ADDRESS=0x100000000ULL CPPFLAGS+= -DHEAP_VARIABLE CPPFLAGS+= -DSUPPORT_CD9660 CPPFLAGS+= -DSUPPORT_DOSFS CPPFLAGS+= -DSUPPORT_EXT2FS CPPFLAGS+= -DPASS_BIOSGEOM CPPFLAGS+= -DLIBSA_ENABLE_LS_OP EFIDIR= ${S}/external/bsd/gnu-efi/dist GNUEFIARCH?= ${MACHINE_CPU} CPPFLAGS+= -I${EFIDIR}/inc -I${EFIDIR}/inc/${GNUEFIARCH} CPPFLAGS+= -I${EFIDIR}/inc/protocol SAMISCCPPFLAGS+= -DLIBSA_PRINTF_LONGLONG_SUPPORT SAMISCCPPFLAGS+= -DLIBSA_PRINTF_WIDTH_SUPPORT SAMISCMAKEFLAGS+= SA_USE_CREAD=yes # Read compressed kernels SAMISCMAKEFLAGS+= SA_INCLUDE_NET=no # Netboot via TFTP, NFS ### find out what to use for libsa SA_AS= library SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes" SAMISCMAKEFLAGS+="SA_ENABLE_LS_OP=yes" .include "${S}/lib/libsa/Makefile.inc" LIBSA= ${SALIB} ### find out what to use for libkern KERN_AS= library LIBKERN_ARCH?= ${MACHINE_ARCH} KERNMISCMAKEFLAGS+="LIBKERN_ARCH=${LIBKERN_ARCH}" .include "${S}/lib/libkern/Makefile.inc" LIBKERN= ${KERNLIB} ### find out what to use for libz Z_AS= library .include "${S}/lib/libz/Makefile.inc" LIBZ= ${ZLIB} ### find out what to use for libgnuefi GNUEFI_AS= library LIBGNUEFI_ARCH?= ${MACHINE_ARCH} GNUEFIMISCMAKEFLAGS+="LIBGNUEFI_ARCH=${LIBGNUEFI_ARCH}" GNUEFIMISCCPPFLAGS+= -I${EFIDIR}/lib .include "${S}/lib/libgnuefi/Makefile.inc" LIBGNUEFI= ${GNUEFILIB} cleandir distclean: .WAIT cleanlibdir cleanlibdir: -rm -rf lib LIBLIST= ${LIBGNUEFI} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBSA} VERSIONMACHINE=x86 .include "${S}/conf/newvers_stand.mk" CLEANFILES+= ${PROG}.so ${PROG}.tmp ${PROG}: ${PROG}.so ${OBJCOPY} -j .text -j .sdata -j .data -j .dynamic -j .dynsym \ -j .rel -j .rel.* -j .rela -j .rela.* -j .reloc \ --subsystem efi-app --target=${OBJFMT} ${PROG}.so ${.TARGET} .include ${PROG}.so: ${OBJS} ${LIBLIST} ${LDSCRIPT} ${.CURDIR}/../Makefile.efiboot ${LD} ${LDFLAGS} -o ${.TARGET}.tmp ${OBJS} ${LIBLIST} @@if ${OBJDUMP} -t ${.TARGET}.tmp | grep 'UND'; then \ (echo Undefined symbols; false); \ fi rm -f ${.TARGET} mv ${.TARGET}.tmp ${.TARGET} KLINK_MACHINE?= ${MACHINE} .include @ 1.8.6.1 log @Sync with HEAD - tag prg-localcount2-base1 @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.9 2017/04/29 00:05:35 nonaka Exp $ d13 1 a13 1 LIBI386SRCS+= bootmenu.c diskbuf.c exec.c menuutils.c @ 1.7 log @efiboot: pass memory map after ExitBootService is called to kernel. @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.6 2017/02/06 10:32:35 nonaka Exp $ a7 1 VERSIONFILE?= ${.CURDIR}/../version a17 3 .if !make(depend) SRCS+= vers.c .endif d106 2 a107 4 CLEANFILES+= vers.c vers.c: ${VERSIONFILE} ${SOURCES} ${LIBLIST} ${.CURDIR}/../Makefile.efiboot ${HOST_SH} ${S}/conf/newvers_stand.sh ${VERSIONFILE} x86 ${NEWVERSWHAT} @ 1.7.2.1 log @file Makefile.efiboot was added on branch pgoyette-localcount on 2017-03-20 06:57:15 +0000 @ text @d1 133 @ 1.7.2.2 log @Sync with HEAD @ text @a0 133 # $NetBSD: Makefile.efiboot,v 1.7 2017/02/11 10:13:46 nonaka Exp $ S= ${.CURDIR}/../../../../.. NOMAN= # defined PROG?= boot.efi NEWVERSWHAT?= "EFI Boot" VERSIONFILE?= ${.CURDIR}/../version AFLAGS.start.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:} SOURCES?= start.S conf.c devopen.c efiboot.c self_reloc.c LIBI386SRCS= boot.c biosdisk.c bootinfo.c bootinfo_biosgeom.c LIBI386SRCS+= bootmenu.c boot_params.S diskbuf.c exec.c menuutils.c LIBI386SRCS+= panic.c parseutils.c pread.c LIBI386SRCS+= eficons.c efidelay.c efidisk.c efidisk_ll.c efigetsecs.c LIBI386SRCS+= efimemory.c SRCS= ${SOURCES} ${EXTRA_SOURCES} ${LIBI386SRCS} .if !make(depend) SRCS+= vers.c .endif PIE_CFLAGS= PIE_LDFLAGS= PIE_AFLAGS= .include STRIPFLAG= # nothing LIBCRT0= # nothing LIBCRTI= # nothing LIBCRTBEGIN= # nothing LIBCRTEND= # nothing LIBC= # nothing BINDIR=/usr/mdec BINMODE=444 .PATH: ${.CURDIR} ${.CURDIR}/.. .PATH: ${.CURDIR}/../../lib LDSCRIPT?= ${.CURDIR}/ldscript LDFLAGS+= -nostdlib -T${LDSCRIPT} -Bsymbolic -shared -nocombreloc CPPFLAGS+= -I$S -I${.CURDIR} -I${.CURDIR}/.. -I$S/lib/libsa CPPFLAGS+= -I${.OBJDIR} CPPFLAGS+= -I${.CURDIR}/../../lib COPTS+= -ffreestanding -fPIC -fshort-wchar -fno-strict-aliasing -fno-builtin COPTS+= -fno-stack-protector COPTS+= ${${ACTIVE_CC} == "gcc":? -Wno-error=unused-but-set-variable :} CPPFLAGS+= -nostdinc -D_STANDALONE CPPFLAGS+= -DEFIBOOT CPPFLAGS+= -Wall -Wmissing-prototypes CPPFLAGS+= -Wno-pointer-sign CPPFLAGS+= -DEFI_ALLOCATE_MAX_ADDRESS=0x100000000ULL CPPFLAGS+= -DHEAP_VARIABLE CPPFLAGS+= -DSUPPORT_CD9660 CPPFLAGS+= -DSUPPORT_DOSFS CPPFLAGS+= -DSUPPORT_EXT2FS CPPFLAGS+= -DPASS_BIOSGEOM CPPFLAGS+= -DLIBSA_ENABLE_LS_OP EFIDIR= ${S}/external/bsd/gnu-efi/dist GNUEFIARCH?= ${MACHINE_CPU} CPPFLAGS+= -I${EFIDIR}/inc -I${EFIDIR}/inc/${GNUEFIARCH} CPPFLAGS+= -I${EFIDIR}/inc/protocol SAMISCCPPFLAGS+= -DLIBSA_PRINTF_LONGLONG_SUPPORT SAMISCCPPFLAGS+= -DLIBSA_PRINTF_WIDTH_SUPPORT SAMISCMAKEFLAGS+= SA_USE_CREAD=yes # Read compressed kernels SAMISCMAKEFLAGS+= SA_INCLUDE_NET=no # Netboot via TFTP, NFS ### find out what to use for libsa SA_AS= library SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes" SAMISCMAKEFLAGS+="SA_ENABLE_LS_OP=yes" .include "${S}/lib/libsa/Makefile.inc" LIBSA= ${SALIB} ### find out what to use for libkern KERN_AS= library LIBKERN_ARCH?= ${MACHINE_ARCH} KERNMISCMAKEFLAGS+="LIBKERN_ARCH=${LIBKERN_ARCH}" .include "${S}/lib/libkern/Makefile.inc" LIBKERN= ${KERNLIB} ### find out what to use for libz Z_AS= library .include "${S}/lib/libz/Makefile.inc" LIBZ= ${ZLIB} ### find out what to use for libgnuefi GNUEFI_AS= library LIBGNUEFI_ARCH?= ${MACHINE_ARCH} GNUEFIMISCMAKEFLAGS+="LIBGNUEFI_ARCH=${LIBGNUEFI_ARCH}" GNUEFIMISCCPPFLAGS+= -I${EFIDIR}/lib .include "${S}/lib/libgnuefi/Makefile.inc" LIBGNUEFI= ${GNUEFILIB} cleandir distclean: .WAIT cleanlibdir cleanlibdir: -rm -rf lib LIBLIST= ${LIBGNUEFI} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBSA} CLEANFILES+= vers.c vers.c: ${VERSIONFILE} ${SOURCES} ${LIBLIST} ${.CURDIR}/../Makefile.efiboot ${HOST_SH} ${S}/conf/newvers_stand.sh ${VERSIONFILE} x86 ${NEWVERSWHAT} CLEANFILES+= ${PROG}.so ${PROG}.tmp ${PROG}: ${PROG}.so ${OBJCOPY} -j .text -j .sdata -j .data -j .dynamic -j .dynsym \ -j .rel -j .rel.* -j .rela -j .rela.* -j .reloc \ --subsystem efi-app --target=${OBJFMT} ${PROG}.so ${.TARGET} .include ${PROG}.so: ${OBJS} ${LIBLIST} ${LDSCRIPT} ${.CURDIR}/../Makefile.efiboot ${LD} ${LDFLAGS} -o ${.TARGET}.tmp ${OBJS} ${LIBLIST} @@if ${OBJDUMP} -t ${.TARGET}.tmp | grep 'UND'; then \ (echo Undefined symbols; false); \ fi rm -f ${.TARGET} mv ${.TARGET}.tmp ${.TARGET} KLINK_MACHINE?= ${MACHINE} .include @ 1.7.2.3 log @Sync with HEAD @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.8 2017/04/08 19:53:21 christos Exp $ d8 1 d19 3 d110 4 a113 2 VERSIONMACHINE=x86 .include "${S}/conf/newvers_stand.mk" @ 1.6 log @Remove unnecessary flag. @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.5 2017/02/05 10:13:18 joerg Exp $ a63 1 CPPFLAGS+= -DPASS_MEMMAP @ 1.5 log @Unbreak clang again. @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.4 2017/02/04 16:14:04 christos Exp $ a51 1 COPTS+= ${${ACTIVE_CC} == "gcc":? -falign-functions=16 :} @ 1.5.2.1 log @file Makefile.efiboot was added on branch nick-nhusb on 2017-02-05 13:40:12 +0000 @ text @d1 135 @ 1.5.2.2 log @Sync with HEAD @ text @a0 135 # $NetBSD: Makefile.efiboot,v 1.2 2017/02/03 17:24:43 roy Exp $ S= ${.CURDIR}/../../../../.. NOMAN= # defined PROG?= boot.efi NEWVERSWHAT?= "EFI Boot" VERSIONFILE?= ${.CURDIR}/../version AFLAGS.start.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:} SOURCES?= start.S conf.c devopen.c efiboot.c self_reloc.c LIBI386SRCS= boot.c biosdisk.c bootinfo.c bootinfo_biosgeom.c LIBI386SRCS+= bootmenu.c boot_params.S diskbuf.c exec.c menuutils.c LIBI386SRCS+= panic.c parseutils.c pread.c LIBI386SRCS+= eficons.c efidelay.c efidisk.c efidisk_ll.c efigetsecs.c LIBI386SRCS+= efimemory.c SRCS= ${SOURCES} ${EXTRA_SOURCES} ${LIBI386SRCS} .if !make(depend) SRCS+= vers.c .endif PIE_CFLAGS= PIE_LDFLAGS= PIE_AFLAGS= .include STRIPFLAG= # nothing LIBCRT0= # nothing LIBCRTI= # nothing LIBCRTBEGIN= # nothing LIBCRTEND= # nothing LIBC= # nothing BINDIR=/usr/mdec BINMODE=444 .PATH: ${.CURDIR} ${.CURDIR}/.. .PATH: ${.CURDIR}/../../lib LDSCRIPT?= ${.CURDIR}/ldscript LDFLAGS+= -nostdlib -T${LDSCRIPT} -Bsymbolic -shared -nocombreloc CPPFLAGS+= -I$S -I${.CURDIR} -I${.CURDIR}/.. -I$S/lib/libsa CPPFLAGS+= -I${.OBJDIR} CPPFLAGS+= -I${.CURDIR}/../../lib CWARNFLAGS.clang+= -Wno-invalid-noreturn #panic.c COPTS+= -ffreestanding -fPIC -fshort-wchar -fno-strict-aliasing -fno-builtin COPTS+= -fno-stack-protector COPTS+= ${${ACTIVE_CC} == "gcc":? -falign-functions=16 :} CPPFLAGS+= -nostdinc -D_STANDALONE CPPFLAGS+= -DEFIBOOT CPPFLAGS+= -Wall -Wmissing-prototypes CPPFLAGS+= -Wno-pointer-sign CPPFLAGS+= -DEFI_ALLOCATE_MAX_ADDRESS=0x100000000ULL CPPFLAGS+= -DHEAP_VARIABLE CPPFLAGS+= -DSUPPORT_CD9660 CPPFLAGS+= -DSUPPORT_DOSFS CPPFLAGS+= -DSUPPORT_EXT2FS CPPFLAGS+= -DPASS_BIOSGEOM CPPFLAGS+= -DPASS_MEMMAP CPPFLAGS+= -DLIBSA_ENABLE_LS_OP EFIDIR= ${S}/external/bsd/gnu-efi/dist GNUEFIARCH?= ${MACHINE_CPU} CPPFLAGS+= -I${EFIDIR}/inc -I${EFIDIR}/inc/${GNUEFIARCH} CPPFLAGS+= -I${EFIDIR}/inc/protocol SAMISCCPPFLAGS+= -DLIBSA_PRINTF_LONGLONG_SUPPORT SAMISCCPPFLAGS+= -DLIBSA_PRINTF_WIDTH_SUPPORT SAMISCMAKEFLAGS+= SA_USE_CREAD=yes # Read compressed kernels SAMISCMAKEFLAGS+= SA_INCLUDE_NET=no # Netboot via TFTP, NFS ### find out what to use for libsa SA_AS= library SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes" SAMISCMAKEFLAGS+="SA_ENABLE_LS_OP=yes" .include "${S}/lib/libsa/Makefile.inc" LIBSA= ${SALIB} ### find out what to use for libkern KERN_AS= library LIBKERN_ARCH?= ${MACHINE_ARCH} KERNMISCMAKEFLAGS+="LIBKERN_ARCH=${LIBKERN_ARCH}" .include "${S}/lib/libkern/Makefile.inc" LIBKERN= ${KERNLIB} ### find out what to use for libz Z_AS= library .include "${S}/lib/libz/Makefile.inc" LIBZ= ${ZLIB} ### find out what to use for libgnuefi GNUEFI_AS= library LIBGNUEFI_ARCH?= ${MACHINE_ARCH} GNUEFIMISCMAKEFLAGS+="LIBGNUEFI_ARCH=${LIBGNUEFI_ARCH}" GNUEFIMISCCPPFLAGS+= -I${EFIDIR}/lib .include "${S}/lib/libgnuefi/Makefile.inc" LIBGNUEFI= ${GNUEFILIB} cleandir distclean: .WAIT cleanlibdir cleanlibdir: -rm -rf lib LIBLIST= ${LIBGNUEFI} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBSA} CLEANFILES+= vers.c vers.c: ${VERSIONFILE} ${SOURCES} ${LIBLIST} ${.CURDIR}/../Makefile.efiboot ${HOST_SH} ${S}/conf/newvers_stand.sh ${VERSIONFILE} x86 ${NEWVERSWHAT} CLEANFILES+= ${PROG}.so ${PROG}.tmp ${PROG}: ${PROG}.so ${OBJCOPY} -j .text -j .sdata -j .data -j .dynamic -j .dynsym \ -j .rel -j .rel.* -j .rela -j .rela.* -j .reloc \ --subsystem efi-app --target=${OBJFMT} ${PROG}.so ${.TARGET} .include ${PROG}.so: ${OBJS} ${LIBLIST} ${LDSCRIPT} ${.CURDIR}/../Makefile.efiboot ${LD} ${LDFLAGS} -o ${.TARGET}.tmp ${OBJS} ${LIBLIST} @@if ${OBJDUMP} -t ${.TARGET}.tmp | grep 'UND'; then \ (echo Undefined symbols; false); \ fi rm -f ${.TARGET} mv ${.TARGET}.tmp ${.TARGET} KLINK_MACHINE?= ${MACHINE} .include @ 1.5.2.3 log @Sync with HEAD @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.5.2.2 2017/02/05 13:40:12 skrll Exp $ d8 1 d14 1 a14 1 LIBI386SRCS+= bootmenu.c diskbuf.c exec.c menuutils.c d19 3 d49 1 d52 1 a52 1 COPTS+= ${${ACTIVE_CC} == "gcc":? -Wno-error=unused-but-set-variable :} d65 1 d112 4 a115 2 VERSIONMACHINE=x86 .include "${S}/conf/newvers_stand.mk" @ 1.4 log @Don't error out for set but unused variables for now. @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.3 2017/02/04 13:36:07 roy Exp $ d51 1 a51 1 COPTS+= -Wno-error=unused-but-set-variable @ 1.3 log @Mark reboot() and _rtt() as __dead. Use __builtin_unreachable() to ensure Panic really is marked dead. Thanks to joerg@@ @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.2 2017/02/03 17:24:43 roy Exp $ d51 1 @ 1.2 log @Fix build with clang. @ text @d1 1 a1 1 # $NetBSD: Makefile.efiboot,v 1.1 2017/01/24 11:09:14 nonaka Exp $ a48 1 CWARNFLAGS.clang+= -Wno-invalid-noreturn #panic.c @ 1.1 log @Initial commit of native amd64 EFI boot loader. @ text @d1 1 a1 1 # $NetBSD$ d49 1 d51 2 a52 1 COPTS+= -fno-stack-protector -falign-functions=16 @