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=pc
2
CONFLIST=pc pccpu pcf pccpuf pcdisk pcfs pccpudisk
3
CRAPLIST=pccd pcflop pcinst pcauth pcall
4
VENTILIST=pccpuf pcf pcfs pcauth
5
EXTRACOPIES=piestand pxe0 lookout bovril boundary
6
 
7
objtype=386
8
</$objtype/mkfile
9
p=9
10
 
11
# must match mem.h
12
KZERO=0xF0000000
13
KTZEROP=0x100020
14
 
15
APBOOTSTRAP=`{echo $KZERO+0x3000'=X' | dbcalc}
16
# this KTZERO sits after the a.out header, unlike mem.h's
17
KTZERO=`{echo $KZERO+$KTZEROP'=X' | dbcalc}
18
 
19
DEVS=`{rc ../port/mkdevlist $CONF}
20
 
21
PORT=\
22
	alarm.$O\
23
	alloc.$O\
24
	allocb.$O\
25
	auth.$O\
26
	cache.$O\
27
	chan.$O\
28
	dev.$O\
29
	edf.$O\
30
	fault.$O\
31
	latin1.$O\
32
	page.$O\
33
	parse.$O\
34
	pgrp.$O\
35
	portclock.$O\
36
	print.$O\
37
	proc.$O\
38
	qio.$O\
39
	qlock.$O\
40
	rdb.$O\
41
	rebootcmd.$O\
42
	segment.$O\
43
	swap.$O\
44
	sysfile.$O\
45
	sysproc.$O\
46
	taslock.$O\
47
	tod.$O\
48
	watermarks.$O\
49
	xalloc.$O\
50
 
51
OBJ=\
52
	l.$O\
53
	plan9l.$O\
54
	cga.$O\
55
	i8253.$O\
56
	i8259.$O\
57
	kbd.$O\
58
	main.$O\
59
	memory.$O\
60
	mmu.$O\
61
	random.$O\
62
	syscallfmt.$O\
63
	trap.$O\
64
	$CONF.root.$O\
65
	$CONF.rootc.$O\
66
	$DEVS\
67
	$PORT\
68
 
69
LIB=\
70
	/$objtype/lib/libmemlayer.a\
71
	/$objtype/lib/libmemdraw.a\
72
	/$objtype/lib/libdraw.a\
73
	/$objtype/lib/libip.a\
74
	/$objtype/lib/libc.a\
75
	/$objtype/lib/libsec.a\
76
	/$objtype/lib/libmp.a\
77
 
78
ETHER=`{echo devether.c ether*.c | sed 's/\.c/.'$O'/g'}
79
VGA=`{echo devvga.c screen.c vga*.c | sed 's/\.c/.'$O'/g'}
80
SDEV=`{echo devsd.c sd*.c | sed 's/\.c/.'$O'/g'}
81
 
82
$p$CONF:	$CONF.c $OBJ $LIB
83
	$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
84
	$LD -o $target -T$KTZERO -l $OBJ $CONF.$O $LIB
85
	size $target
86
 
87
# this makes an ELF kernel:
88
# $LD -o $target.elf -PH5 -R4096 -T$KTZERO -F$KTZEROP -l $OBJ $CONF.$O $LIB
89
 
90
# don't strip the gzipped kernels -- too frustrating when that's all you have!
91
$p%.gz:D:	$p%
92
	gzip -9 <$p$stem >$p$stem.gz
93
 
94
 
95
# pcflop and pccd need all the space they can get
96
9pcflop.gz:D: 9pcflop
97
	strip -o /fd/1 9pcflop | gzip -9 >9pcflop.gz
98
 
99
9pccd.gz:D: 9pccd
100
	strip -o /fd/1 9pccd | gzip -9 >9pccd.gz
101
 
102
# we don't need gzipped kernels otherwise, so don't make them
103
install:V:	$p$CONF				# $p$CONF.gz
104
	cp $p$CONF /$objtype/ &
105
	for(i in $EXTRACOPIES)
106
		{ 9fs $i && cp $p$CONF /n/$i/$objtype && echo -n $i... & }
107
	wait
108
	echo
109
 
110
<../boot/bootmkfile
111
<../port/portmkfile
112
<|../port/mkbootrules $CONF
113
 
114
$ETHER: 			etherif.h ../port/netif.h
115
ether8003.$O ether8390.$O:	ether8390.h
116
$VGA mouse.$O:			screen.h /sys/include/memdraw.h
117
devfloppy.$O: 			floppy.h
118
archmp.$O mp.$O:		apbootstrap.h
119
apic.$O archmp.$O mp.$O:	mp.h
120
$SDEV:				../port/sd.h
121
sd53c8xx.$O:			sd53c8xx.i
122
sdiahci.$O:			ahci.h
123
devaoe.$O sdaoe.$O:		../port/aoe.h
124
main.$O:			init.h reboot.h
125
wavelan.$O:			wavelan.c ../pc/wavelan.c ../pc/wavelan.h
126
etherwavelan.$O:		etherwavelan.c ../pc/wavelan.h
127
devusb.$O usbuhci.$O usbohci.$O usbehci.$O: ../port/usb.h
128
trap.$O:			/sys/include/tos.h
129
uartaxp.$O:			uartaxp.i
130
etherm10g.$O:			etherm10g2k.i etherm10g4k.i
131
 
132
init.h:D:		../port/initcode.c init9.c
133
	$CC ../port/initcode.c
134
	$CC init9.c
135
	$LD -l -R1 -s -o init.out init9.$O initcode.$O /386/lib/libc.a
136
	{echo 'uchar initcode[]={'
137
	 xd -1x <init.out |
138
		sed -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
139
	 echo '};'} > init.h
140
 
141
reboot.h:D:	rebootcode.s
142
	$AS rebootcode.s
143
	$LD -l -s -T0x11000 -R4 -o reboot.out rebootcode.$O
144
	{echo 'uchar rebootcode[]={'
145
	 xd -1x reboot.out |
146
		sed -e '1,2d' -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
147
	 echo '};'} > reboot.h
148
 
149
apbootstrap.h:	apbootstrap.s mem.h
150
	$AS $prereq
151
	$LD -o apbootstrap.out -T$APBOOTSTRAP -R4 -l -s apbootstrap.$O
152
	{echo 'uchar apbootstrap[]={'
153
	 xd -1x apbootstrap.out |
154
		sed -e '1,2d' -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
155
	 echo '};'} > $target
156
 
157
sd53c8xx.i:	sd53c8xx.n
158
	aux/na $prereq > $target
159
 
160
uartaxp.i:	a100p.cp
161
	{echo 'static uchar uartaxpcp[] = {'
162
	 xd -1x $prereq |
163
		sed -e 's/^[0-9a-f]+ //' -e '/^$/d' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
164
	 echo '};'
165
	} > $target
166
 
167
acid:V:
168
	8c -a -w -I. i8253.c>acid
169
 
170
%.checkether:VQ:
171
	for (i in ether*.c){
172
		x=`{echo $i | sed 's/\.c//'}
173
		if(! ~ $x ether8390 && ! grep -s '^	'^$x^'([ 	]|$)' $stem)
174
			echo $x not included in $stem
175
	}
176
	exit 0
177
 
178
%.checkvga:VQ:
179
	for (i in vga*.c){
180
		x=`{echo $i | sed 's/\.c//'}
181
		if(! ~ $x vga vgax vgasavage && ! grep -s '^	'^$x^'([ 	]|$)' $stem)
182
			echo $x not included in $stem
183
	}
184
	exit 0
185
 
186
checkdist:VQ:
187
	for(i in pcdisk pcflop)
188
	for(j in checkvga checkether)
189
		mk $i.$j
190
 
191
%.clean:V:
192
	rm -f $stem.c [9bz]$stem [9bz]$stem.gz boot$stem.* reboot.h apbootstrap.h init.h [9bz]$stem.elf
193
 
194
# testing
195
9load:D: /usr/rsc/boot/$O.load 9pcload
196
	cat $prereq >$target
197
 
198
9load.flp: 9load
199
	disk/format -b /386/pbs -df $target $prereq
200
 
201
$p$CONF.flp: /386/9load plan9.ini $p$CONF.gz
202
	disk/format -b /386/pbs -df $target $prereq