Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/stand Cleanup of i386 bootloader building:



details:   https://anonhg.NetBSD.org/src/rev/9fb11ba2e58b
branches:  trunk
changeset: 522332:9fb11ba2e58b
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Feb 17 20:03:05 2002 +0000

description:
Cleanup of i386 bootloader building:
* Add separate directories for the individual netboot ROMs and
  always build them.
* Each bootloader Makefile explicitly specifies the start file
  and link address it wishes to use.
* genprom becomes a proper host program.
* Make sure all generated files get cleaned up.
* Set BINDIR in Makefile.inc
* Add compressed image support to pxeboot.
* Make pxeboot use the default serial console speed (9600).

diffstat:

 sys/arch/i386/stand/Makefile                      |  20 ++++++-
 sys/arch/i386/stand/Makefile.booters              |  53 +++++++++++++---------
 sys/arch/i386/stand/Makefile.inc                  |   3 +
 sys/arch/i386/stand/biosboot/Makefile             |   6 +-
 sys/arch/i386/stand/biosboot_ser/Makefile         |   6 +-
 sys/arch/i386/stand/dosboot/Makefile              |   6 +-
 sys/arch/i386/stand/genprom/Makefile              |  12 +---
 sys/arch/i386/stand/installboot/Makefile          |   3 +-
 sys/arch/i386/stand/lib/netif/Makefile.inc        |  32 ++++++++-----
 sys/arch/i386/stand/netboot/Makefile              |  47 +++----------------
 sys/arch/i386/stand/netboot_3c509/Makefile        |   5 ++
 sys/arch/i386/stand/netboot_3c590/Makefile        |  13 +++++
 sys/arch/i386/stand/netboot_3c90xb/Makefile       |  10 ++++
 sys/arch/i386/stand/netboot_i82557/Makefile       |   7 +++
 sys/arch/i386/stand/netboot_ne2000_isa/Makefile   |   7 +++
 sys/arch/i386/stand/netboot_pcnet_isapnp/Makefile |   7 +++
 sys/arch/i386/stand/netboot_pcnet_pci/Makefile    |   7 +++
 sys/arch/i386/stand/netboot_wd80x3/Makefile       |   8 +++
 sys/arch/i386/stand/pxeboot/Makefile              |  11 ++--
 19 files changed, 160 insertions(+), 103 deletions(-)

diffs (truncated from 509 to 300 lines):

diff -r d5bbe4704b73 -r 9fb11ba2e58b sys/arch/i386/stand/Makefile
--- a/sys/arch/i386/stand/Makefile      Sun Feb 17 19:53:44 2002 +0000
+++ b/sys/arch/i386/stand/Makefile      Sun Feb 17 20:03:05 2002 +0000
@@ -1,10 +1,22 @@
-#      $NetBSD: Makefile,v 1.15 2002/02/16 03:37:39 thorpej Exp $
+#      $NetBSD: Makefile,v 1.16 2002/02/17 20:03:05 thorpej Exp $
 
-SUBDIR=                biosboot installboot
-SUBDIR+=       dosboot
+SUBDIR=                genprom installboot .WAIT
+
+SUBDIR+=       biosboot
 SUBDIR+=       biosboot_com0
 SUBDIR+=       biosboot_resetvideo
-#SUBDIR+=      genprom netboot
+
+SUBDIR+=       dosboot
+
+SUBDIR+=       netboot_3c509
+SUBDIR+=       netboot_3c590
+SUBDIR+=       netboot_3c90xb
+SUBDIR+=       netboot_i82557
+SUBDIR+=       netboot_ne2000_isa
+SUBDIR+=       netboot_pcnet_isapnp
+SUBDIR+=       netboot_pcnet_pci
+SUBDIR+=       netboot_wd80x3
+
 SUBDIR+=       pxeboot
 
 .include <bsd.subdir.mk>
diff -r d5bbe4704b73 -r 9fb11ba2e58b sys/arch/i386/stand/Makefile.booters
--- a/sys/arch/i386/stand/Makefile.booters      Sun Feb 17 19:53:44 2002 +0000
+++ b/sys/arch/i386/stand/Makefile.booters      Sun Feb 17 20:03:05 2002 +0000
@@ -1,6 +1,7 @@
-#      $NetBSD: Makefile.booters,v 1.31 2002/02/16 03:37:39 thorpej Exp $
+#      $NetBSD: Makefile.booters,v 1.32 2002/02/17 20:03:06 thorpej Exp $
 
-BINDIR= /usr/mdec
+.include <bsd.own.mk>
+
 STRIPFLAG=
 BINMODE=444
 
@@ -9,19 +10,25 @@
 I386_STAND_DIR?= $S/arch/i386/stand
 
 .PATH: ${I386_STAND_DIR}/lib/crt/bootsect ${I386_STAND_DIR}/lib
-BSSTART= start_bootsect.o fraglist.o bootsectmain.o biosdisk_ll.o bios_disk.o diskbuf.o
+BSSTART= start_bootsect.o fraglist.o bootsectmain.o biosdisk_ll.o \
+       bios_disk.o diskbuf.o
+
 .PATH: ${I386_STAND_DIR}/lib/crt/rom
 ROMSTART= start_rom.o
 GENPROMDIR= ${I386_STAND_DIR}/genprom
+GENPROMOBJDIR!= cd ${GENPROMDIR} && ${PRINTOBJDIR}
+GENPROM= ${GENPROMOBJDIR}/genprom
+
 .PATH: ${I386_STAND_DIR}/lib/crt/dos
 DOSSTART= start_dos.o doscommain.o
+
 .PATH: ${I386_STAND_DIR}/lib/crt/pxe
 PXESTART= start_pxe.o
 
 CPPFLAGS += -nostdinc -I${.OBJDIR} -I$S -I${I386_STAND_DIR}/lib -I$S/lib/libsa
 CPPFLAGS+= -D_STANDALONE
 
-CLEANFILES+= vers.c ${BASE}.list
+CLEANFILES+= ${STARTFILE} vers.c ${BASE}.list
 SRCS+= vers.c
 
 .if !make(obj) && !make(clean) && !make(cleandir)
@@ -59,8 +66,6 @@
 .include "${I386DIR}/Makefile.inc"
 LIBI386=               ${I386LIB}
 
-.include <bsd.own.mk>
-
 cleandir distclean: cleanlibdir
 
 cleanlibdir:
@@ -78,26 +83,30 @@
 vers.c: ${VERSIONFILE}
        sh ${S}conf/newvers_stand.sh ${.ALLSRC} 'i386' ${NEWVERSWHAT}
 
-${BASE}.sym: ${BSSTART} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
-       ${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext 0 ${BSSTART} ${OBJS} \
-       ${LIBLIST} >${BASE}.list
+CLEANFILES+= ${BASE}.sym
+${BASE}.sym: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
+       ${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext ${RELOC} ${STARTFILE} ${OBJS} \
+           ${LIBLIST} >${BASE}.list
 
-${BASE}.rom: ${GENPROM} ${ROMSTART} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
-       ${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext ${RELOC} ${ROMSTART} ${OBJS} \
-       ${LIBLIST} >${BASE}.list
-       ${OBJCOPY} --output-target=binary ${BASE}.sym ${BASE}.bin
-       (cd ${GENPROMDIR}; ${MAKE} rom BINFILE=${.OBJDIR:Q}/${BASE:Q}.bin \
-               ROMFILE=${.OBJDIR:Q}/${BASE:Q}.rom ROM_SIZE=${ROM_SIZE:Q})
+CLEANFILES+= ${BASE}.rom
+${BASE}.rom: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
+       ${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext ${RELOC} ${STARTFILE} ${OBJS} \
+           ${LIBLIST} >${BASE}.list
+       ${OBJCOPY} -O binary ${BASE}.sym ${BASE}.bin
+       ${GENPROM} ${ROM_SIZE} < ${BASE}.bin > ${BASE}.rom || \
+           rm -f ${BASE}.rom
        rm -f ${BASE}.bin
 
-${BASE}.com: ${DOSSTART} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
-       ${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext 0x100 ${DOSSTART} ${OBJS} \
-       ${LIBLIST} >${BASE}.list
-       ${OBJCOPY} --output-target=binary ${BASE}.sym ${BASE}.com
+CLEANFILES+= ${BASE}.com
+${BASE}.com: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
+       ${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext ${RELOC} ${STARTFILE} ${OBJS} \
+           ${LIBLIST} >${BASE}.list
+       ${OBJCOPY} -O binary ${BASE}.sym ${BASE}.com
 
-${BASE}.pxe: ${PXESTART} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
-       ${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext 0 ${PXESTART} ${OBJS} \
+CLEANFILES+= ${BASE}.bin
+${BASE}.bin: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
+       ${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext ${RELOC} ${STARTFILE} ${OBJS} \
            ${LIBLIST} > ${BASE}.list
-       ${OBJCOPY} --output-target=binary ${BASE}.sym ${BASE}.pxe
+       ${OBJCOPY} -O binary ${BASE}.sym ${BASE}.bin
 
 .include <bsd.prog.mk>
diff -r d5bbe4704b73 -r 9fb11ba2e58b sys/arch/i386/stand/Makefile.inc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/i386/stand/Makefile.inc  Sun Feb 17 20:03:05 2002 +0000
@@ -0,0 +1,3 @@
+#      $NetBSD: Makefile.inc,v 1.1 2002/02/17 20:03:06 thorpej Exp $
+
+BINDIR=        /usr/mdec
diff -r d5bbe4704b73 -r 9fb11ba2e58b sys/arch/i386/stand/biosboot/Makefile
--- a/sys/arch/i386/stand/biosboot/Makefile     Sun Feb 17 19:53:44 2002 +0000
+++ b/sys/arch/i386/stand/biosboot/Makefile     Sun Feb 17 20:03:05 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.38 2001/12/12 01:49:43 tv Exp $
+#      $NetBSD: Makefile,v 1.39 2002/02/17 20:03:08 thorpej Exp $
 
 S=     ${.CURDIR}/../../../../
 
@@ -6,6 +6,8 @@
 PROG= ${BASE}.sym
 NOMAN= # defined
 NEWVERSWHAT=   "BIOS Boot"
+STARTFILE=     ${BSSTART}
+RELOC=         0x0
 
 .if (${BASE} != "biosboot")
 .PATH.c: ${.CURDIR}/../biosboot/
@@ -13,8 +15,6 @@
 
 SRCS= main.c devopen.c conf.c exec.c
 
-CLEANFILES+= ${BSSTART}
-
 CPPFLAGS+= -DCOMPAT_386BSD_MBRPART -DSUPPORT_PS2
 
 .if (${BASE} == "biosboot")
diff -r d5bbe4704b73 -r 9fb11ba2e58b sys/arch/i386/stand/biosboot_ser/Makefile
--- a/sys/arch/i386/stand/biosboot_ser/Makefile Sun Feb 17 19:53:44 2002 +0000
+++ b/sys/arch/i386/stand/biosboot_ser/Makefile Sun Feb 17 20:03:05 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.8 2001/12/12 01:49:44 tv Exp $
+#      $NetBSD: Makefile,v 1.9 2002/02/17 20:03:08 thorpej Exp $
 
 S=     ${.CURDIR}/../../../../
 
@@ -6,12 +6,12 @@
 PROG= ${BASE}.sym
 NOMAN= # defined
 NEWVERSWHAT=   "BIOS Boot"
+STARTFILE=     ${BSSTART}
+RELOC=         0x0
 
 .PATH: ${.CURDIR}/../biosboot/
 SRCS= main.c devopen.c conf.c exec.c
 
-CLEANFILES+= ${BSSTART}
-
 CPPFLAGS+= -DCOMPAT_386BSD_MBRPART -DDEBUG
 
 #Sample use of serial line debugger
diff -r d5bbe4704b73 -r 9fb11ba2e58b sys/arch/i386/stand/dosboot/Makefile
--- a/sys/arch/i386/stand/dosboot/Makefile      Sun Feb 17 19:53:44 2002 +0000
+++ b/sys/arch/i386/stand/dosboot/Makefile      Sun Feb 17 20:03:05 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.19 2001/12/12 01:49:44 tv Exp $
+#      $NetBSD: Makefile,v 1.20 2002/02/17 20:03:09 thorpej Exp $
 
 S=     ${.CURDIR}/../../../../
 
@@ -6,11 +6,11 @@
 PROG= ${BASE}.com
 NOMAN= # defined
 NEWVERSWHAT=   "DOS Boot"
+STARTFILE=     ${DOSSTART}
+RELOC=         0x100
 
 SRCS= main.c devopen.c exec.c
 
-CLEANFILES+= ${DOSSTART} ${BASE}.sym
-
 CPPFLAGS+= -DCOMPAT_386BSD_MBRPART
 CPPFLAGS+= -DXMS
 #uncomment if there are problems with memory detection
diff -r d5bbe4704b73 -r 9fb11ba2e58b sys/arch/i386/stand/genprom/Makefile
--- a/sys/arch/i386/stand/genprom/Makefile      Sun Feb 17 19:53:44 2002 +0000
+++ b/sys/arch/i386/stand/genprom/Makefile      Sun Feb 17 20:03:05 2002 +0000
@@ -1,12 +1,6 @@
-#      $NetBSD: Makefile,v 1.5 2001/12/12 01:49:44 tv Exp $
+#      $NetBSD: Makefile,v 1.6 2002/02/17 20:03:10 thorpej Exp $
 
-PROG= genprom
+HOSTPROG= genprom
 NOMAN= # defined
 
-CFLAGS+= -Wall
-
-.include <bsd.prog.mk>
-
-#to be used from netboot's Makefile
-rom: ${PROG} ${BINFILE}
-       ./${PROG} ${ROM_SIZE} <${BINFILE} >${ROMFILE} || (rm ${ROMFILE}; false)
+.include <bsd.hostprog.mk>
diff -r d5bbe4704b73 -r 9fb11ba2e58b sys/arch/i386/stand/installboot/Makefile
--- a/sys/arch/i386/stand/installboot/Makefile  Sun Feb 17 19:53:44 2002 +0000
+++ b/sys/arch/i386/stand/installboot/Makefile  Sun Feb 17 20:03:05 2002 +0000
@@ -1,11 +1,10 @@
-#      $NetBSD: Makefile,v 1.22 2001/12/12 12:24:24 lukem Exp $
+#      $NetBSD: Makefile,v 1.23 2002/02/17 20:03:10 thorpej Exp $
 
 NOMAN= # defined
 
 # XXX: bsd.own.mk included so LDSTATIC can be overwridden
 .include <bsd.own.mk>
 
-BINDIR=        /usr/mdec
 PROG=  installboot
 LIBSA=${.CURDIR}/../../../../lib/libsa
 
diff -r d5bbe4704b73 -r 9fb11ba2e58b sys/arch/i386/stand/lib/netif/Makefile.inc
--- a/sys/arch/i386/stand/lib/netif/Makefile.inc        Sun Feb 17 19:53:44 2002 +0000
+++ b/sys/arch/i386/stand/lib/netif/Makefile.inc        Sun Feb 17 20:03:05 2002 +0000
@@ -1,28 +1,36 @@
-##     $NetBSD: Makefile.inc,v 1.5 2001/11/01 09:37:17 yamt Exp $
+##     $NetBSD: Makefile.inc,v 1.6 2002/02/17 20:03:11 thorpej Exp $
 
-SRCS += netif_small.c
+SRCS+= netif_small.c
+
 .if (${USE_NETIF} == "3c509")
-SRCS += 3c509.c elink3.c
+SRCS+= 3c509.c elink3.c
 .endif
+
 .if (${USE_NETIF} == "3c590")
-SRCS += 3c590.c elink3.c
+SRCS+= 3c590.c elink3.c
 .endif
+
 .if (${USE_NETIF} == "wd80x3")
-SRCS += wd80x3.c dp8390.c
+SRCS+= wd80x3.c dp8390.c
 .endif
+
 .if (${USE_NETIF} == "pcnet_pci")
-SRCS += pcnet_pci.c am7990.c
+SRCS+= pcnet_pci.c am7990.c
 .endif
+
 .if (${USE_NETIF} == "pcnet_isapnp")
-SRCS += pcnet_isapnp.c am7990.c
+SRCS+= pcnet_isapnp.c am7990.c
 .endif
+
 .if (${USE_NETIF} == "i82557")
-SRCS += i82557.c
+SRCS+= i82557.c
 .endif
+
 .if (${USE_NETIF} == "3c90xb")
-SRCS += 3c90xb.c
+SRCS+= 3c90xb.c
 .endif
-.if (${USE_NETIF} == "ne2000")
-SRCS += ne.c dp8390.c
-CPPFLAGS += -DSUPPORT_NE2000
+
+.if (${USE_NETIF} == "ne2000_isa")
+SRCS+= ne.c dp8390.c
+CPPFLAGS+= -DSUPPORT_NE2000
 .endif
diff -r d5bbe4704b73 -r 9fb11ba2e58b sys/arch/i386/stand/netboot/Makefile
--- a/sys/arch/i386/stand/netboot/Makefile      Sun Feb 17 19:53:44 2002 +0000
+++ b/sys/arch/i386/stand/netboot/Makefile      Sun Feb 17 20:03:05 2002 +0000
@@ -1,16 +1,18 @@
-#      $NetBSD: Makefile,v 1.24 2001/12/12 01:49:45 tv Exp $



Home | Main Index | Thread Index | Old Index