Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
CONF=rb
2
CONFLIST=rb
3
# no rb with nvram on bovril (outside)
4
EXTRACOPIES=piestand lookout boundary 
5
 
6
objtype=mips
7
</$objtype/mkfile
8
p=9
9
# must match mem.h
10
KTZERO=0x80020000
11
PHYSKTZERO=0x20000
12
# must match mem.h
13
UTZERO=0x4020
14
# must match mem.h
15
BY2PG=4096
16
# must match mem.h
17
MAXBY2PG=16384
18
 
19
# CFLAGS=$CFLAGS -DFPEMUDEBUG
20
 
21
DEVS=`{rc ../port/mkdevlist $CONF}
22
 
23
PORT=\
24
	alarm.$O\
25
	alloc.$O\
26
	allocb.$O\
27
	auth.$O\
28
	cache.$O\
29
	chan.$O\
30
	dev.$O\
31
	edf.$O\
32
	fault.$O\
33
	latin1.$O\
34
	mul64fract.$O\
35
	page.$O\
36
	parse.$O\
37
	pgrp.$O\
38
	portclock.$O\
39
	print.$O\
40
	proc.$O\
41
	qio.$O\
42
	qlock.$O\
43
	rdb.$O\
44
	rebootcmd.$O\
45
	segment.$O\
46
	swap.$O\
47
	sysfile.$O\
48
	sysproc.$O\
49
	taslock.$O\
50
	tod.$O\
51
	xalloc.$O\
52
 
53
OBJ=\
54
	l.$O\
55
	clock.$O\
56
	faultmips.$O\
57
	main.$O\
58
	mmu.$O\
59
	random.$O\
60
	syscallfmt.$O\
61
	trap.$O\
62
	$CONF.root.$O\
63
	$CONF.rootc.$O\
64
	$DEVS\
65
	$PORT\
66
 
67
LIB=\
68
	/mips/lib/libauth.a\
69
	/mips/lib/libsec.a\
70
	/mips/lib/libmp.a\
71
	/mips/lib/libip.a\
72
	/mips/lib/libc.a\
73
 
74
# generate ELF format for pxe booting via RouterBOOT
75
$p$CONF:Q:	$OBJ $CONF.c $LIB
76
	$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
77
	echo linking kernel
78
	# -a for debugging
79
	$LD -a -o $target -H5 -l -R$BY2PG -T$KTZERO -P$PHYSKTZERO -S $OBJ $CONF.$O $LIB >$target.list
80
	# -H1 is plan 9 boot image with rounded segments
81
	# $LD -o $target -H1 -l -R$BY2PG -T$KTZERO $OBJ $CONF.$O $LIB
82
	size $target
83
 
84
install:V:	$p$CONF
85
	cp $p$CONF /$objtype/
86
	echo installed.
87
	for(i in $EXTRACOPIES)
88
		{ 9fs $i && cp $p$CONF /n/$i/$objtype/ && echo -n $i... & }
89
	wait
90
	echo
91
 
92
<../boot/bootmkfile
93
<../port/portmkfile
94
<|../port/mkbootrules $CONF
95
 
96
init.h:	init9.s ../port/initcode.c /sys/src/libc/9syscall/sys.h
97
	va init9.s
98
	vc ../port/initcode.c
99
	vl -T$UTZERO -R4 -o init.out init9.$O initcode.$O
100
	{echo 'uchar initcode[]={'
101
	 xd -r -1x init.out |
102
		sed -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
103
	 echo '};'} > init.h
104
 
105
reboot.h:D:	initreboot.s rebootcode.c mem.h
106
	$AS initreboot.s
107
	$CC -FTVw rebootcode.c
108
	# -lc is only for memmove.  -T arg is REBOOTADDR.
109
	$LD -l -a -s -T0x80001000 -R4 -o reboot.out initreboot.$O rebootcode.$O -lc >reboot.list
110
	{echo 'uchar rebootcode[]={'
111
	 xd -1x reboot.out |
112
		sed -e '1,2d' -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
113
	 echo '};'} > reboot.h
114
 
115
l.$O: mips.s
116
arch.$O clock.$O fpimips.$O faultmips.$O mmu.$O syscall.$O \
117
	trap.$O: /$objtype/include/ureg.h
118
main.$O:	/$objtype/include/ureg.h errstr.h init.h reboot.h
119
fpi.$O fpiarm.$O fpimem.$O: ../port/fpi.h
120
devether.$O: 		../port/netif.h etherif.h
121
 
122
%.clean:V:
123
	rm -f $stem.c [9bz]$stem [9bz]$stem.gz boot$stem.* reboot.h apbootstrap.h init.h *.list
124
 
125
# override ../port/portmkfile
126
# create /boot/boot
127
boot$CONF.out: $CONF print.$O $BOOTDIR/boot.c $BOOTLIB
128
	$BOOTDIR/mkboot $CONF > boot$CONF.c
129
	$CC $CFLAGS boot$CONF.c ../boot/printstub.c
130
	$AS c_fcr0.s
131
	$LD -o boot$CONF.out -T$UTZERO -R$MAXBY2PG boot$CONF.$O $BOOTLIB printstub.$O c_fcr0.$O