Plan 9 from Bell Labs’s /usr/web/sources/plan9/sys/src/9/pcboot/bootmkfile

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


# make 9boot(pbs) and 9load(usb)
# inherit KTZERO, START, CONF, BASE and SFX from mkfile
x=`{bindpc $BASE $SFX}
CONFLIST=$CONF
EXTRACOPIES=piestand lookout bovril boundary 

objtype=386
</$objtype/mkfile
p=9

DEVS=`{rc ../port/mkdevlist $CONF}

PORT=\
	alarm.$O\
	alloc.$O\
	allocb.$O\
	auth.$O\
	chan.$O\
	dev.$O\
	edf.$O\
	latin1.$O\
	page.$O\
	parse.$O\
	pgrp.$O\
	portclock.$O\
	print.$O\
	proc.$O\
	qio.$O\
	qlock.$O\
	rdb.$O\
	rebootcmd.$O\
	segment.$O\
	taslock.$O\
	tod.$O\
	watermarks.$O\
	xalloc.$O\

OBJ=\
	ktzero.$O\
	$START\
	l32p.$O\
	l32v.$O\
	l64p.$O\
	realmode0.$O\
	l.$O\
	cga.$O\
	fault.$O\
	i8253.$O\
	i8259.$O\
	kbd.$O\
	main.$O\
	memory.$O\
	mmu.$O\
	multiboot.$O\
	trap.$O\
	warp64.$O\
	$CONF.root.$O\
	$CONF.rootc.$O\
	$DEVS\
	$PORT\

LIB=\
	/$objtype/lib/libflate.a\
	/$objtype/lib/libip.a\
	/$objtype/lib/libc.a\

ETHER=`{echo devether.c ether*.c | sed 's/\.c/.'$O'/g'}

$p$CONF:Q:	$CONF.c $OBJ $LIB
	$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
	echo linking $p$CONF^'*'
	$LD -o $target -H3 -T$KTZERO -l $OBJ $CONF.$O $LIB	# dos .com
	$LD -o $target^debug -T$KTZERO -l $OBJ $CONF.$O $LIB
#	$LD -o $target.elf -H5 -R4096 -T$KTZERO -l $OBJ $CONF.$O $LIB
	size $target^debug

# don't strip the gzipped kernels -- too frustrating when that's all you have!
$p%.gz:D:	$p%
	gzip -9 <$p$stem >$p$stem.gz

install:V:	$p$CONF $p${CONF}debug		# $p$CONF.elf
	cp $p$CONF $p$CONF^debug /$objtype/ &
	for(i in $EXTRACOPIES)
		{ 9fs $i && cp $p$CONF $p$CONF^debug /n/$i/$objtype &&
			echo -n $i... & }
	wait
	echo

<../port/portmkfile
<|../port/mkbootrules $CONF

%.$O:		/$objtype/include/ureg.h /sys/include/pool.h ../port/netif.h
%.$O:		../port/sd.h ../ip/ip.h dosfs.h pxe.h
$ETHER: 	etherif.h ethermii.h
ether2000.$O ether8003.$O ether8390.$O etherec2t.$O: ether8390.h
l.$O l16r.$O l32p.$O l32v.$O l64p.$O: /sys/src/boot/pc/x16.h
sd%.$O:		/sys/include/disk.h
auth.$O:	/sys/include/authsrv.h
bootld.$O:	/sys/include/a.out.h /sys/src/libmach/elf.h
devcons.$O:	/sys/include/authsrv.h
devfloppy.$O:	floppy.h
inflate.$O:	/sys/include/flate.h
main.$O:	reboot.h
sd53c8xx.$O:	sd53c8xx.i
sdiahci.$O:	ahci.h
trap.$O:	/sys/include/tos.h

init.h:
	>$target

reboot.h:D:	rebootcode.s
	$AS rebootcode.s
	$LD -l -s -T0x11000 -R4 -o reboot.out rebootcode.$O
	{echo 'uchar rebootcode[]={'
	 xd -1x reboot.out |
		sed -e '1,2d' -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
	 echo '};'} > reboot.h

acid:V:
	8c -a -w -I. i8253.c>acid

<callsmkfile

%.checkether:VQ:
	for (i in ether*.c){
		x=`{echo $i | sed 's/\.c//'}
		if(! ~ $x ether8390 && ! grep -s '^	'^$x^'([ 	]|$)' $stem)
			echo $x not included in $stem
	}
	exit 0

%.clean:V:
	@ {
		rfork n
		unmount .
		rm -f $stem.c [9bz]$stem [9bz]$stem.gz boot$stem.* reboot.h apbootstrap.h 9boot* 9load*
	}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].