Browse Source

Plan 9 from Bell Labs 2006-03-22

David du Colombier 14 years ago
parent
commit
4329bda156

+ 14 - 14
dist/replica/_plan9.db

@@ -5393,7 +5393,7 @@ rc/bin - 20000000775 sys sys 1018637942 0
 rc/bin/9fat: - 775 sys sys 1133179689 367
 rc/bin/9fs - 775 sys sys 1139499615 971
 rc/bin/B - 775 sys sys 945617206 645
-rc/bin/C - 775 sys sys 1127395076 855
+rc/bin/C - 775 sys sys 1142958679 889
 rc/bin/Kill - 775 sys sys 1018637942 115
 rc/bin/a: - 775 sys sys 1063856406 255
 rc/bin/ap - 775 sys sys 1123163734 733
@@ -6179,7 +6179,7 @@ sys/lib/dist/pc/inst/stopppp - 775 sys sys 1018469719 250
 sys/lib/dist/pc/inst/textonly - 775 sys sys 1112361039 182
 sys/lib/dist/pc/inst/watchfd - 775 sys sys 1127670125 362
 sys/lib/dist/pc/inst/xxx - 775 sys sys 1018469719 160
-sys/lib/dist/pc/mkfile - 664 sys sys 1123094452 2158
+sys/lib/dist/pc/mkfile - 664 sys sys 1142958580 2193
 sys/lib/dist/pc/plan9.ini - 664 sys sys 1142177575 236
 sys/lib/dist/pc/plan9.ini.blank - 664 sys sys 1018469720 512
 sys/lib/dist/pc/plan9.ini.cd - 664 sys sys 1132452554 369
@@ -7763,7 +7763,7 @@ sys/src - 20000000775 sys sys 1016902537 0
 sys/src/9 - 20000000775 sys sys 1017795023 0
 sys/src/9/alphapc - 20000000775 sys sys 1018721238 0
 sys/src/9/alphapc/apc - 664 sys sys 1131289706 630
-sys/src/9/alphapc/apccpu - 664 sys sys 1084331942 531
+sys/src/9/alphapc/apccpu - 664 sys sys 1142958706 532
 sys/src/9/alphapc/arch164.c - 664 sys sys 1015012783 6100
 sys/src/9/alphapc/audio.h - 664 sys sys 1015012783 349
 sys/src/9/alphapc/axp.h - 664 sys sys 1015012783 1090
@@ -7773,7 +7773,7 @@ sys/src/9/alphapc/cycintr.c - 664 sys sys 1018721238 230
 sys/src/9/alphapc/dat.h - 664 sys sys 1131289707 5196
 sys/src/9/alphapc/devarch.c - 664 sys sys 1039753422 9760
 sys/src/9/alphapc/devvga.c - 664 sys sys 1131289707 7420
-sys/src/9/alphapc/dma.c - 664 sys sys 1015012784 6112
+sys/src/9/alphapc/dma.c - 664 sys sys 1142966373 6526
 sys/src/9/alphapc/etherif.h - 664 sys sys 1045063621 1025
 sys/src/9/alphapc/faultalpha.c - 664 sys sys 1015012784 1257
 sys/src/9/alphapc/fdc37c93x.c - 664 sys sys 1015012785 1110
@@ -7902,7 +7902,7 @@ sys/src/9/mkfile - 664 sys sys 1063857477 205
 sys/src/9/mtx - 20000000775 sys sys 1018721288 0
 sys/src/9/mtx/clock.c - 664 sys sys 1032053278 1293
 sys/src/9/mtx/cycintr.c - 664 sys sys 1018721285 230
-sys/src/9/mtx/dat.h - 664 sys sys 1131289814 3843
+sys/src/9/mtx/dat.h - 664 sys sys 1142958517 3805
 sys/src/9/mtx/devarch.c - 664 sys sys 1018721285 6793
 sys/src/9/mtx/devether.c - 664 sys sys 1116097786 9281
 sys/src/9/mtx/devrtc.c - 664 sys sys 1018721285 6772
@@ -7934,10 +7934,10 @@ sys/src/9/pc/apmjump.s - 664 sys sys 1032058947 1527
 sys/src/9/pc/archmp.c - 664 sys sys 1131290214 2357
 sys/src/9/pc/audio.h - 664 sys sys 1015014513 343
 sys/src/9/pc/cga.c - 664 sys sys 1015014513 1843
-sys/src/9/pc/dat.h - 664 sys sys 1136347070 6583
+sys/src/9/pc/dat.h - 664 sys sys 1142958313 6628
 sys/src/9/pc/devarch.c - 664 sys sys 1136048694 18625
 sys/src/9/pc/devether.c - 664 sys sys 1131290265 10315
-sys/src/9/pc/devfloppy.c - 664 sys sys 1055689885 20024
+sys/src/9/pc/devfloppy.c - 664 sys sys 1142958305 20139
 sys/src/9/pc/devi82365.c - 664 sys sys 1099761153 20505
 sys/src/9/pc/devlm78.c - 664 sys sys 1128255048 6291
 sys/src/9/pc/devlml.c - 664 sys sys 1132448361 7502
@@ -7948,7 +7948,7 @@ sys/src/9/pc/devrtc.c - 664 sys sys 1015014515 7167
 sys/src/9/pc/devtv.c - 664 sys sys 1131290299 45676
 sys/src/9/pc/devusb.c - 664 sys sys 1105193103 18364
 sys/src/9/pc/devvga.c - 664 sys sys 1131290315 9332
-sys/src/9/pc/dma.c - 664 sys sys 1131290319 4715
+sys/src/9/pc/dma.c - 664 sys sys 1142966373 5332
 sys/src/9/pc/ether2000.c - 664 sys sys 1089299187 4819
 sys/src/9/pc/ether2114x.c - 664 sys sys 1081706476 41545
 sys/src/9/pc/ether589.c - 664 sys sys 1015014516 4644
@@ -7986,10 +7986,10 @@ sys/src/9/pc/initcode.s - 664 sys sys 1015014519 282
 sys/src/9/pc/io.h - 664 sys sys 1099761152 8095
 sys/src/9/pc/kbd.c - 664 sys sys 1132574883 12365
 sys/src/9/pc/l.s - 664 sys sys 1131290403 28347
-sys/src/9/pc/main.c - 664 sys sys 1131290418 15224
+sys/src/9/pc/main.c - 664 sys sys 1142958321 15304
 sys/src/9/pc/mem.h - 664 sys sys 1137622431 5203
 sys/src/9/pc/memory.c - 664 sys sys 1131573303 18191
-sys/src/9/pc/mkfile - 664 sys sys 1137622906 3572
+sys/src/9/pc/mkfile - 664 sys sys 1142960857 3804
 sys/src/9/pc/mmu.c - 664 sys sys 1142124315 25229
 sys/src/9/pc/mouse.c - 664 sys sys 1098479254 7057
 sys/src/9/pc/mp.c - 664 sys sys 1131538523 17317
@@ -8104,7 +8104,7 @@ sys/src/9/port/log.c - 664 sys sys 1014931175 2860
 sys/src/9/port/master - 664 sys sys 1140695116 490
 sys/src/9/port/master.local - 664 sys sys 1063856961 130
 sys/src/9/port/mkbootrules - 775 sys sys 1055700518 923
-sys/src/9/port/mkdevc - 775 sys sys 1109202243 3889
+sys/src/9/port/mkdevc - 775 sys sys 1142958298 4242
 sys/src/9/port/mkdevlist - 775 sys sys 1055700519 510
 sys/src/9/port/mkerrstr - 775 sys sys 1015278340 75
 sys/src/9/port/mkextract - 775 sys sys 1039753334 435
@@ -8135,7 +8135,7 @@ sys/src/9/port/segment.c - 664 sys sys 1138749368 13939
 sys/src/9/port/swap.c - 664 sys sys 1138028310 7019
 sys/src/9/port/sysfile.c - 664 sys sys 1141940070 22192
 sys/src/9/port/sysproc.c - 664 sys sys 1137622456 15153
-sys/src/9/port/taslock.c - 664 sys sys 1131290039 3928
+sys/src/9/port/taslock.c - 664 sys sys 1142957865 3928
 sys/src/9/port/thwack.c - 664 sys sys 1057323394 7253
 sys/src/9/port/thwack.h - 664 sys sys 1015278340 1792
 sys/src/9/port/tod.c - 664 sys sys 1138459530 5336
@@ -12608,7 +12608,7 @@ sys/src/cmd/mk/var.c - 664 sys sys 1131289510 530
 sys/src/cmd/mk/varsub.c - 664 sys sys 1131289511 4425
 sys/src/cmd/mk/word.c - 664 sys sys 944961025 2595
 sys/src/cmd/mkdir.c - 664 sys sys 1082593106 1026
-sys/src/cmd/mkfile - 664 sys sys 1108476348 2414
+sys/src/cmd/mkfile - 664 sys sys 1142958953 2451
 sys/src/cmd/mklib - 664 sys sys 1101213349 618
 sys/src/cmd/mkmany - 664 sys sys 1123818681 1304
 sys/src/cmd/mkone - 664 sys sys 1123943673 910
@@ -13297,7 +13297,7 @@ sys/src/cmd/sum.c - 664 sys sys 1014926615 5548
 sys/src/cmd/swap.c - 664 sys sys 1014926662 1141
 sys/src/cmd/syscall - 20000000775 sys sys 944961236 0
 sys/src/cmd/syscall/mkfile - 664 sys sys 1037122264 549
-sys/src/cmd/syscall/syscall.c - 664 sys sys 1135487934 3951
+sys/src/cmd/syscall/syscall.c - 664 sys sys 1142958095 3954
 sys/src/cmd/tail.c - 664 sys sys 1123123922 6034
 sys/src/cmd/tapefs - 20000000775 sys sys 944962012 0
 sys/src/cmd/tapefs/32vfs.c - 664 sys sys 1141144939 3899

+ 14 - 14
dist/replica/plan9.db

@@ -5393,7 +5393,7 @@ rc/bin - 20000000775 sys sys 1018637942 0
 rc/bin/9fat: - 775 sys sys 1133179689 367
 rc/bin/9fs - 775 sys sys 1139499615 971
 rc/bin/B - 775 sys sys 945617206 645
-rc/bin/C - 775 sys sys 1127395076 855
+rc/bin/C - 775 sys sys 1142958679 889
 rc/bin/Kill - 775 sys sys 1018637942 115
 rc/bin/a: - 775 sys sys 1063856406 255
 rc/bin/ap - 775 sys sys 1123163734 733
@@ -6179,7 +6179,7 @@ sys/lib/dist/pc/inst/stopppp - 775 sys sys 1018469719 250
 sys/lib/dist/pc/inst/textonly - 775 sys sys 1112361039 182
 sys/lib/dist/pc/inst/watchfd - 775 sys sys 1127670125 362
 sys/lib/dist/pc/inst/xxx - 775 sys sys 1018469719 160
-sys/lib/dist/pc/mkfile - 664 sys sys 1123094452 2158
+sys/lib/dist/pc/mkfile - 664 sys sys 1142958580 2193
 sys/lib/dist/pc/plan9.ini - 664 sys sys 1142177575 236
 sys/lib/dist/pc/plan9.ini.blank - 664 sys sys 1018469720 512
 sys/lib/dist/pc/plan9.ini.cd - 664 sys sys 1132452554 369
@@ -7763,7 +7763,7 @@ sys/src - 20000000775 sys sys 1016902537 0
 sys/src/9 - 20000000775 sys sys 1017795023 0
 sys/src/9/alphapc - 20000000775 sys sys 1018721238 0
 sys/src/9/alphapc/apc - 664 sys sys 1131289706 630
-sys/src/9/alphapc/apccpu - 664 sys sys 1084331942 531
+sys/src/9/alphapc/apccpu - 664 sys sys 1142958706 532
 sys/src/9/alphapc/arch164.c - 664 sys sys 1015012783 6100
 sys/src/9/alphapc/audio.h - 664 sys sys 1015012783 349
 sys/src/9/alphapc/axp.h - 664 sys sys 1015012783 1090
@@ -7773,7 +7773,7 @@ sys/src/9/alphapc/cycintr.c - 664 sys sys 1018721238 230
 sys/src/9/alphapc/dat.h - 664 sys sys 1131289707 5196
 sys/src/9/alphapc/devarch.c - 664 sys sys 1039753422 9760
 sys/src/9/alphapc/devvga.c - 664 sys sys 1131289707 7420
-sys/src/9/alphapc/dma.c - 664 sys sys 1015012784 6112
+sys/src/9/alphapc/dma.c - 664 sys sys 1142966373 6526
 sys/src/9/alphapc/etherif.h - 664 sys sys 1045063621 1025
 sys/src/9/alphapc/faultalpha.c - 664 sys sys 1015012784 1257
 sys/src/9/alphapc/fdc37c93x.c - 664 sys sys 1015012785 1110
@@ -7902,7 +7902,7 @@ sys/src/9/mkfile - 664 sys sys 1063857477 205
 sys/src/9/mtx - 20000000775 sys sys 1018721288 0
 sys/src/9/mtx/clock.c - 664 sys sys 1032053278 1293
 sys/src/9/mtx/cycintr.c - 664 sys sys 1018721285 230
-sys/src/9/mtx/dat.h - 664 sys sys 1131289814 3843
+sys/src/9/mtx/dat.h - 664 sys sys 1142958517 3805
 sys/src/9/mtx/devarch.c - 664 sys sys 1018721285 6793
 sys/src/9/mtx/devether.c - 664 sys sys 1116097786 9281
 sys/src/9/mtx/devrtc.c - 664 sys sys 1018721285 6772
@@ -7934,10 +7934,10 @@ sys/src/9/pc/apmjump.s - 664 sys sys 1032058947 1527
 sys/src/9/pc/archmp.c - 664 sys sys 1131290214 2357
 sys/src/9/pc/audio.h - 664 sys sys 1015014513 343
 sys/src/9/pc/cga.c - 664 sys sys 1015014513 1843
-sys/src/9/pc/dat.h - 664 sys sys 1136347070 6583
+sys/src/9/pc/dat.h - 664 sys sys 1142958313 6628
 sys/src/9/pc/devarch.c - 664 sys sys 1136048694 18625
 sys/src/9/pc/devether.c - 664 sys sys 1131290265 10315
-sys/src/9/pc/devfloppy.c - 664 sys sys 1055689885 20024
+sys/src/9/pc/devfloppy.c - 664 sys sys 1142958305 20139
 sys/src/9/pc/devi82365.c - 664 sys sys 1099761153 20505
 sys/src/9/pc/devlm78.c - 664 sys sys 1128255048 6291
 sys/src/9/pc/devlml.c - 664 sys sys 1132448361 7502
@@ -7948,7 +7948,7 @@ sys/src/9/pc/devrtc.c - 664 sys sys 1015014515 7167
 sys/src/9/pc/devtv.c - 664 sys sys 1131290299 45676
 sys/src/9/pc/devusb.c - 664 sys sys 1105193103 18364
 sys/src/9/pc/devvga.c - 664 sys sys 1131290315 9332
-sys/src/9/pc/dma.c - 664 sys sys 1131290319 4715
+sys/src/9/pc/dma.c - 664 sys sys 1142966373 5332
 sys/src/9/pc/ether2000.c - 664 sys sys 1089299187 4819
 sys/src/9/pc/ether2114x.c - 664 sys sys 1081706476 41545
 sys/src/9/pc/ether589.c - 664 sys sys 1015014516 4644
@@ -7986,10 +7986,10 @@ sys/src/9/pc/initcode.s - 664 sys sys 1015014519 282
 sys/src/9/pc/io.h - 664 sys sys 1099761152 8095
 sys/src/9/pc/kbd.c - 664 sys sys 1132574883 12365
 sys/src/9/pc/l.s - 664 sys sys 1131290403 28347
-sys/src/9/pc/main.c - 664 sys sys 1131290418 15224
+sys/src/9/pc/main.c - 664 sys sys 1142958321 15304
 sys/src/9/pc/mem.h - 664 sys sys 1137622431 5203
 sys/src/9/pc/memory.c - 664 sys sys 1131573303 18191
-sys/src/9/pc/mkfile - 664 sys sys 1137622906 3572
+sys/src/9/pc/mkfile - 664 sys sys 1142960857 3804
 sys/src/9/pc/mmu.c - 664 sys sys 1142124315 25229
 sys/src/9/pc/mouse.c - 664 sys sys 1098479254 7057
 sys/src/9/pc/mp.c - 664 sys sys 1131538523 17317
@@ -8104,7 +8104,7 @@ sys/src/9/port/log.c - 664 sys sys 1014931175 2860
 sys/src/9/port/master - 664 sys sys 1140695116 490
 sys/src/9/port/master.local - 664 sys sys 1063856961 130
 sys/src/9/port/mkbootrules - 775 sys sys 1055700518 923
-sys/src/9/port/mkdevc - 775 sys sys 1109202243 3889
+sys/src/9/port/mkdevc - 775 sys sys 1142958298 4242
 sys/src/9/port/mkdevlist - 775 sys sys 1055700519 510
 sys/src/9/port/mkerrstr - 775 sys sys 1015278340 75
 sys/src/9/port/mkextract - 775 sys sys 1039753334 435
@@ -8135,7 +8135,7 @@ sys/src/9/port/segment.c - 664 sys sys 1138749368 13939
 sys/src/9/port/swap.c - 664 sys sys 1138028310 7019
 sys/src/9/port/sysfile.c - 664 sys sys 1141940070 22192
 sys/src/9/port/sysproc.c - 664 sys sys 1137622456 15153
-sys/src/9/port/taslock.c - 664 sys sys 1131290039 3928
+sys/src/9/port/taslock.c - 664 sys sys 1142957865 3928
 sys/src/9/port/thwack.c - 664 sys sys 1057323394 7253
 sys/src/9/port/thwack.h - 664 sys sys 1015278340 1792
 sys/src/9/port/tod.c - 664 sys sys 1138459530 5336
@@ -12608,7 +12608,7 @@ sys/src/cmd/mk/var.c - 664 sys sys 1131289510 530
 sys/src/cmd/mk/varsub.c - 664 sys sys 1131289511 4425
 sys/src/cmd/mk/word.c - 664 sys sys 944961025 2595
 sys/src/cmd/mkdir.c - 664 sys sys 1082593106 1026
-sys/src/cmd/mkfile - 664 sys sys 1108476348 2414
+sys/src/cmd/mkfile - 664 sys sys 1142958953 2451
 sys/src/cmd/mklib - 664 sys sys 1101213349 618
 sys/src/cmd/mkmany - 664 sys sys 1123818681 1304
 sys/src/cmd/mkone - 664 sys sys 1123943673 910
@@ -13297,7 +13297,7 @@ sys/src/cmd/sum.c - 664 sys sys 1014926615 5548
 sys/src/cmd/swap.c - 664 sys sys 1014926662 1141
 sys/src/cmd/syscall - 20000000775 sys sys 944961236 0
 sys/src/cmd/syscall/mkfile - 664 sys sys 1037122264 549
-sys/src/cmd/syscall/syscall.c - 664 sys sys 1135487934 3951
+sys/src/cmd/syscall/syscall.c - 664 sys sys 1142958095 3954
 sys/src/cmd/tail.c - 664 sys sys 1123123922 6034
 sys/src/cmd/tapefs - 20000000775 sys sys 944962012 0
 sys/src/cmd/tapefs/32vfs.c - 664 sys sys 1141144939 3899

+ 15 - 0
dist/replica/plan9.log

@@ -28104,3 +28104,18 @@
 1142872287 38 c 386/lib/ape/libdraw.a - 664 sys sys 1142871046 580970
 1142872287 39 c 386/lib/libdraw.a - 664 sys sys 1142871047 374212
 1142906497 0 c sys/man/8/fsconfig - 664 sys sys 1142906116 8281
+1142958712 0 c rc/bin/C - 775 sys sys 1142958679 889
+1142958712 1 c sys/lib/dist/pc/mkfile - 664 sys sys 1142958580 2193
+1142958712 2 c sys/src/9/alphapc/apccpu - 664 sys sys 1142958706 532
+1142958712 3 c sys/src/9/mtx/dat.h - 664 sys sys 1142958517 3805
+1142958712 4 c sys/src/9/pc/dat.h - 664 sys sys 1142958313 6628
+1142958712 5 c sys/src/9/pc/devfloppy.c - 664 sys sys 1142958305 20139
+1142958712 6 c sys/src/9/pc/dma.c - 664 sys sys 1142958300 5073
+1142958712 7 c sys/src/9/pc/main.c - 664 sys sys 1142958321 15304
+1142958712 8 c sys/src/9/port/mkdevc - 775 sys sys 1142958298 4242
+1142958712 9 c sys/src/9/port/taslock.c - 664 sys sys 1142957865 3928
+1142958712 10 c sys/src/cmd/syscall/syscall.c - 664 sys sys 1142958095 3954
+1142960512 0 c sys/src/cmd/mkfile - 664 sys sys 1142958953 2451
+1142962313 0 c sys/src/9/pc/mkfile - 664 sys sys 1142960857 3804
+1142967714 0 c sys/src/9/alphapc/dma.c - 664 sys sys 1142966373 6526
+1142967714 1 c sys/src/9/pc/dma.c - 664 sys sys 1142966373 5332

+ 3 - 0
rc/bin/C

@@ -2,6 +2,7 @@
 
 rfork n
 oflag=()
+opt=-r
 while(~ $1 -*)
 	switch($1){
 	case -r
@@ -18,6 +19,8 @@ while(~ $1 -*)
 switch($1){
 case fs
 	server=edith
+case sources
+	server=ethel
 case ella
 	exec C office0
 	exit

+ 5 - 3
sys/lib/dist/pc/mkfile

@@ -62,7 +62,7 @@ ndisk: 9load /sys/src/9/pc/9pcflop.gz plan9.ini /lib/vgadb
 # cannot list both 9pcflop.gz and 9pccd.gz because they cannot be built 
 # in parallel.  stupid mk
 cddisk:D: 9load /sys/src/9/pc/9pcflop.gz plan9.ini.cd /lib/vgadb
-	mk /sys/src/9/pc/9pccd.gz
+	mk -a /sys/src/9/pc/9pccd.gz
 	rfork n
 	bind plan9.ini.cd plan9.ini
 	dd -if /dev/zero -of cddisk -bs 1024 -count 2880 >[2]/dev/null
@@ -74,8 +74,10 @@ clean:V:
 	rm -rf boot boot.bz2 boot.bflz boot.raw root.bz2 9pcflop ndisk 9load cddisk proto.cp 9loaddebug
 
 install:V: ndisk 9loaddebug
-	cp 9loaddebug ../web.protect2
-	cp ndisk ../web.protect2/disk
+	9fs outside
+	dst=/n/outside/sys/lib/dist/web.protect
+	cp 9loaddebug $dst
+	cp ndisk $dst/disk
 	#mk clean
 
 test:V: ndisk 9loaddebug

+ 1 - 1
sys/src/9/alphapc/apccpu

@@ -33,7 +33,7 @@ misc
 	arch164
 
 	sdata		pci sdscsi
-	sd53c8xx	pci sdscsi
+#	sd53c8xx	pci sdscsi
 
 	uarti8250
 

+ 39 - 16
sys/src/9/alphapc/dma.c

@@ -64,6 +64,41 @@ DMA dma[2] = {
 	 1 },
 };
 
+extern int i8237dma;
+static void* i8237bva[2];
+static int i8237used;
+
+/*
+ *  DMA must be in the first 16MB.  This gets called early by the
+ *  initialisation routines of any devices which require DMA to ensure
+ *  the allocated bounce buffers are below the 16MB limit.
+ */
+void
+_i8237alloc(void)
+{
+	void* bva;
+
+	if(i8237dma <= 0)
+		return;
+	if(i8237dma > 2)
+		i8237dma = 2;
+
+	bva = xspanalloc(64*1024*i8237dma, BY2PG, 64*1024);
+	if(bva == nil || PADDR(bva)+64*1024*i8237dma > 16*MB){
+		/*
+		 * This will panic with the current
+		 * implementation of xspanalloc().
+		if(bva != nil)
+			xfree(bva);
+		 */
+		return;
+	}
+
+	i8237bva[0] = bva;
+	if(i8237dma == 2)
+		i8237bva[1] = ((uchar*)i8237bva[0])+64*1024;
+}
+
 static void
 dmastatus(DMA *dp, int chan, char c)
 {
@@ -83,11 +118,6 @@ dmastatus(DMA *dp, int chan, char c)
 	print("%c: addr %uX len %uX stat %uX\n", c, a, l, s);
 }
 
-/*
- *  DMA must be in the first 16MB.  This gets called early by the
- *  initialisation routines of any devices which require DMA to ensure
- *  the allocated bounce buffers are below the 16MB limit.
- */
 int
 dmainit(int chan, int maxtransfer)
 {
@@ -121,19 +151,12 @@ dmainit(int chan, int maxtransfer)
 	}
 //dmastatus(dp, chan, 'I');
 
-	xp->bva = xspanalloc(maxtransfer, BY2PG, 64*1024);
-	if(xp->bva == nil)
-		return 1;
-	xp->bpa = PADDR(xp->bva);
-	if(xp->bpa >= 16*MB){
-		/*
-		 * This will panic with the current
-		 * implementation of xspanalloc().
-		xfree(xp->bva);
-		 */
-		xp->bva = nil;
+	if(i8237used >= i8237dma || i8237bva[i8237used] == nil){
+		print("no i8237 DMA bounce buffer < 16MB\n");
 		return 1;
 	}
+	xp->bva = i8237bva[i8237used++];
+	xp->bpa = PADDR(xp->bva);
 	xp->blen = maxtransfer;
 	xp->len = 0;
 	xp->isread = 0;

+ 1 - 1
sys/src/9/mtx/dat.h

@@ -30,7 +30,7 @@ typedef struct Vctl	Vctl;
 
 struct Lock
 {
-	ulong	key;			/* semaphore (non-zero = locked) */
+	ulong	key;
 	ulong	sr;
 	ulong	pc;
 	Proc	*p;

+ 2 - 2
sys/src/9/pc/dat.h

@@ -113,7 +113,7 @@ struct PMMU
 	Page*	mmuused;		/* used page table pages */
 	Page*	kmaptable;		/* page table used by kmap */
 	uint	lastkmap;		/* last entry used by kmap */
-	int	nkmap;		/* number of current kmaps */
+	int	nkmap;			/* number of current kmaps */
 };
 
 /*
@@ -136,7 +136,7 @@ typedef struct {
 	ulong	ss1;			/* privilege level 1 stack selector */
 	ulong	esp2;			/* privilege level 2 stack pointer */
 	ulong	ss2;			/* privilege level 2 stack selector */
-	ulong	cr3;			/* page directory base register */
+	ulong	xcr3;			/* page directory base register - not used because we don't use trap gates */
 	ulong	eip;			/* instruction pointer */
 	ulong	eflags;			/* flags register */
 	ulong	eax;			/* general registers */

+ 5 - 0
sys/src/9/pc/devfloppy.c

@@ -180,6 +180,11 @@ floppyreset(void)
 			maxtsize = t->tsize;
 	}
 
+	/*
+	 * Should check if this fails. Can do so
+	 * if there is no space <= 16MB for the DMA
+	 * bounce buffer.
+	 */
 	dmainit(DMAchan, maxtsize);
 
 	/*

+ 39 - 11
sys/src/9/pc/dma.c

@@ -62,6 +62,41 @@ DMA dma[2] = {
 	 1 },
 };
 
+extern int i8237dma;
+static void* i8237bva[2];
+static int i8237used;
+
+/*
+ *  DMA must be in the first 16MB.  This gets called early by the
+ *  initialisation routines of any devices which require DMA to ensure
+ *  the allocated bounce buffers are below the 16MB limit.
+ */
+void
+_i8237alloc(void)
+{
+	void* bva;
+
+	if(i8237dma <= 0)
+		return;
+	if(i8237dma > 2)
+		i8237dma = 2;
+
+	bva = xspanalloc(64*1024*i8237dma, BY2PG, 64*1024);
+	if(bva == nil || PADDR(bva)+64*1024*i8237dma > 16*MB){
+		/*
+		 * This will panic with the current
+		 * implementation of xspanalloc().
+		if(bva != nil)
+			xfree(bva);
+		 */
+		return;
+	}
+
+	i8237bva[0] = bva;
+	if(i8237dma == 2)
+		i8237bva[1] = ((uchar*)i8237bva[0])+64*1024;
+}
+
 /*
  *  DMA must be in the first 16MB.  This gets called early by the
  *  initialisation routines of any devices which require DMA to ensure
@@ -94,19 +129,12 @@ dmainit(int chan, int maxtransfer)
 		return 0;
 	}
 
-	xp->bva = xspanalloc(maxtransfer, BY2PG, 64*1024);
-	if(xp->bva == nil)
-		return 1;
-	xp->bpa = PADDR(xp->bva);
-	if(xp->bpa >= 16*MB){
-		/*
-		 * This will panic with the current
-		 * implementation of xspanalloc().
-		xfree(xp->bva);
-		 */
-		xp->bva = nil;
+	if(i8237used >= i8237dma || i8237bva[i8237used] == nil){
+		print("no i8237 DMA bounce buffer < 16MB\n");
 		return 1;
 	}
+	xp->bva = i8237bva[i8237used++];
+	xp->bpa = PADDR(xp->bva);
 	xp->blen = maxtransfer;
 	xp->len = 0;
 	xp->isread = 0;

+ 5 - 1
sys/src/9/pc/main.c

@@ -70,7 +70,9 @@ options(void)
 	}
 }
 
-void mmuinit0(void);
+extern void mmuinit0(void);
+extern void (*i8237alloc)(void);
+
 void
 main(void)
 {
@@ -93,6 +95,8 @@ main(void)
 	confinit();
 	archinit();
 	xinit();
+	if(i8237alloc != nil)
+		i8237alloc();
 	trapinit();
 	printinit();
 	cpuidprint();

+ 12 - 2
sys/src/9/pc/mkfile

@@ -77,8 +77,18 @@ $p$CONF:	$CONF.c $OBJ $LIB
 	$LD -o $target -T$KTZERO -l $OBJ $CONF.$O $LIB
 	size $target
 
-$p$CONF.gz:	$p$CONF
-	strip -o /fd/1 $p$CONF | gzip -9 > $p$CONF.gz
+# don't strip the gzipped kernels -- too frustrating when that's all you have!
+$p%.gz:	$p%
+	gzip -9 <$p$stem >$p$stem.gz
+
+
+# pcflop and pccd need all the space they can get
+9pcflop.gz: 9pcflop
+	strip -o /fd/1 9pcflop | gzip -9 >9pcflop.gz
+
+9pccd.gz: 9pccd
+	strip -o /fd/1 9pccd | gzip -9 >9pccd.gz
+
 
 install:V:	$p$CONF $p$CONF.gz
 	cp $p$CONF $p$CONF.gz /$objtype/

+ 13 - 0
sys/src/9/port/mkdevc

@@ -25,6 +25,10 @@ collect && section ~ "dev"{
 			devuart = 1;
 		else if($1 ~ "vga")
 			devvga = 1;
+		for(i = 2; i <= NF; i++){
+			if($i ~ "dma" && objtype ~ "(386|alpha|amd64)")
+				i8237dma++;
+		}
 }
 collect && section ~ "ip"{
 		ip[nip++] = $1;
@@ -84,6 +88,15 @@ END{
 			printf "\t&%sdevtab,\n", dev[i];
 		printf "\tnil,\n};\n\n";
 
+		if(objtype ~ "(386|alpha|amd64)"){
+			alloc = "nil";
+			if(i8237dma){
+				printf "extern void _i8237alloc(void);\n";
+				alloc = "_i8237alloc";
+			}
+			printf "void (*i8237alloc)(void) = %s;\n", alloc;
+			printf "int i8237dma = %d;\n\n", i8237dma;
+		}
 
 		for(i = 0; i < nlink; i++)
 			printf "extern void %slink(void);\n", link[i];

+ 1 - 1
sys/src/9/port/taslock.c

@@ -26,7 +26,7 @@ deccnt(Ref *r)
 
 	x = _xdec(&r->ref);
 	if(x < 0)
-		panic("decref pc=0x%lux", getcallerpc(&r));
+		panic("deccnt pc=0x%lux", getcallerpc(&r));
 	return x;
 }
 

+ 5 - 2
sys/src/cmd/mkfile

@@ -8,7 +8,7 @@ LDFLAGS=
 YFLAGS=-d
 
 NOTSYS=sml|dup
-BUGGERED=gc|lmlvideo|dwb|unix|perl|celp|mosml|ovac|vfs|aviation|_vnc|postscript
+BUGGERED=gc|lmlvideo|dwb|unix|perl|celp|mosml|ovac|vfs|aviation|_vnc|postscript|nventi|cvsold|cvs
 OUTOFDATE=old|ssls
 
 NOMK=$NOTSYS|$BUGGERED|$OUTOFDATE
@@ -116,11 +116,14 @@ $O.cj:	cj.$O
 compilers:V:
 	@{
 		cd cc
+		mk clean
 		mk installall
 		mk clean
 	}
-	for(i in 1c 2c 5c 7c 8c kc qc vc) @{
+	for(i in ?c)
+	if(! ~ $i cc rc) @{
 		cd $i;
+		mk clean
 		mk installall
 		mk clean
 	}

+ 1 - 1
sys/src/cmd/syscall/syscall.c

@@ -3,7 +3,7 @@
 #include <sys.h>
 #include <fcall.h>
 
-char	buf[8192];
+char	buf[1048576];
 #define	NARG	5
 uintptr	arg[NARG];