Browse Source

Plan 9 from Bell Labs 2004-02-22

David du Colombier 20 years ago
parent
commit
a0c91ed647

+ 30 - 30
dist/replica/plan9.db

@@ -27,7 +27,7 @@
 386/bin/9660srv - 775 sys sys 1064598019 104963
 386/bin/aan - 775 sys sys 1064598020 128816
 386/bin/acid - 775 sys sys 1073851203 379815
-386/bin/acme - 775 sys sys 1076817072 422441
+386/bin/acme - 775 sys sys 1077422339 424461
 386/bin/ape - 20000000775 sys sys 1016944144 0
 386/bin/ape/basename - 775 sys sys 1071245280 133877
 386/bin/ape/cc - 775 sys sys 1064598025 68790
@@ -202,7 +202,7 @@
 386/bin/dict - 775 sys sys 1064598121 185384
 386/bin/diff - 775 sys sys 1077163174 82769
 386/bin/disk - 20000000775 sys sys 984788664 0
-386/bin/disk/dump9660 - 775 sys sys 1064598123 151282
+386/bin/disk/dump9660 - 775 sys sys 1077422340 152343
 386/bin/disk/exsort - 775 sys sys 1072729312 58501
 386/bin/disk/fdisk - 775 sys sys 1064598124 106639
 386/bin/disk/format - 775 sys sys 1072729312 91581
@@ -542,7 +542,7 @@
 386/lib/libmach.a - 664 sys sys 1073851272 746962
 386/lib/libmemdraw.a - 664 sys sys 1073851273 291288
 386/lib/libmemlayer.a - 664 sys sys 1073851273 47636
-386/lib/libmp.a - 664 sys sys 1077335667 77700
+386/lib/libmp.a - 664 sys sys 1077422340 78536
 386/lib/libndb.a - 664 sys sys 1073851273 54474
 386/lib/libplumb.a - 664 sys sys 1073851274 18876
 386/lib/libregexp.a - 664 sys sys 1073851274 37502
@@ -3317,7 +3317,7 @@ sys/doc/venti/venti.pdf - 755 sys sys 1020384352 139090
 sys/doc/venti/venti.ps - 664 sys sys 1019852320 2012620
 sys/games - 20000000775 sys sys 952648872 0
 sys/games/lib - 20000000775 sys sys 952648879 0
-sys/games/lib/fortunes - 664 sys sys 1075688069 247488
+sys/games/lib/fortunes - 664 sys sys 1077376248 247524
 sys/include - 20000000775 sys sys 1016902416 0
 sys/include/9p.h - 664 sys sys 1044836327 4309
 sys/include/String.h - 664 sys sys 1055701304 1291
@@ -3958,7 +3958,7 @@ sys/lib/man/preface4 - 664 sys sys 1020082276 1758
 sys/lib/man/secindex - 775 sys sys 956337727 322
 sys/lib/man/title - 664 sys sys 1019915894 746
 sys/lib/man/trademarks - 664 sys sys 958527089 1838
-sys/lib/mimetype - 664 sys sys 1073826820 5674
+sys/lib/mimetype - 664 sys sys 1077376279 5699
 sys/lib/newuser - 775 sys sys 1018386991 1229
 sys/lib/plumb - 20000000775 sys sys 944957365 0
 sys/lib/plumb/basic - 664 sys sys 1070330856 2930
@@ -4723,7 +4723,7 @@ sys/man/1/thesaurus - 664 sys sys 1068121775 222
 sys/man/1/time - 664 sys sys 944959673 380
 sys/man/1/touch - 664 sys sys 1018369246 461
 sys/man/1/tr - 664 sys sys 944959675 1730
-sys/man/1/trace - 664 sys sys 1075347661 1758
+sys/man/1/trace - 664 sys sys 1077376189 1756
 sys/man/1/troff - 664 sys sys 944959675 3102
 sys/man/1/troff2html - 664 sys sys 964455062 1871
 sys/man/1/tweak - 664 sys sys 957920008 4762
@@ -4959,7 +4959,7 @@ sys/man/4/tapefs - 664 sys sys 944959699 1731
 sys/man/4/telco - 664 sys sys 1015024814 4359
 sys/man/4/u9fs - 664 sys sys 1043769139 4748
 sys/man/4/upasfs - 664 sys sys 1034348505 6212
-sys/man/4/usb - 664 sys sys 1044894160 3371
+sys/man/4/usb - 664 sys sys 1077376395 3332
 sys/man/4/usbd - 664 sys sys 1018386778 731
 sys/man/4/vacfs - 664 sys sys 1022112155 1419
 sys/man/4/webcookies - 664 sys sys 1019828742 3525
@@ -5121,7 +5121,7 @@ sys/src/9/alphapc/io.h - 664 sys sys 1015012785 4612
 sys/src/9/alphapc/kbd.c - 664 sys sys 1015012785 8676
 sys/src/9/alphapc/l.s - 664 sys sys 1067722580 9124
 sys/src/9/alphapc/main.c - 664 sys sys 1039753420 13626
-sys/src/9/alphapc/mem.h - 664 sys sys 1017166326 3132
+sys/src/9/alphapc/mem.h - 664 sys sys 1077408326 3131
 sys/src/9/alphapc/memmove.s - 664 sys sys 1015012786 2936
 sys/src/9/alphapc/memset.s - 664 sys sys 1015012786 844
 sys/src/9/alphapc/mkfile - 664 sys sys 1071320227 2030
@@ -5196,7 +5196,7 @@ sys/src/9/bitsy/wavelan.c - 664 sys sys 1064584681 27267
 sys/src/9/bitsy/wavelan.h - 664 sys sys 1037029076 27
 sys/src/9/boot - 20000000775 sys sys 1018556557 0
 sys/src/9/boot/aux.c - 664 sys sys 1063857702 2579
-sys/src/9/boot/boot.c - 664 sys sys 1063857658 5334
+sys/src/9/boot/boot.c - 664 sys sys 1077376393 5361
 sys/src/9/boot/boot.h - 664 sys sys 1063857659 1785
 sys/src/9/boot/bootauth.c - 664 sys sys 1039763726 1097
 sys/src/9/boot/bootcache.c - 664 sys sys 1063857645 1579
@@ -5221,10 +5221,10 @@ sys/src/9/ip/eipconvtest.c - 664 sys sys 1022588098 3135
 sys/src/9/ip/esp.c - 664 sys sys 1047260561 17084
 sys/src/9/ip/ethermedium.c - 664 sys sys 1066514880 15124
 sys/src/9/ip/gre.c - 664 sys sys 1047260562 4684
-sys/src/9/ip/icmp.c - 664 sys sys 1068049000 9438
+sys/src/9/ip/icmp.c - 664 sys sys 1077376217 9511
 sys/src/9/ip/icmp6.c - 664 sys sys 1047260563 18098
 sys/src/9/ip/igmp.c - 664 sys sys 1055700768 5175
-sys/src/9/ip/il.c - 664 sys sys 1055700772 26893
+sys/src/9/ip/il.c - 664 sys sys 1077376217 26959
 sys/src/9/ip/inferno.c - 664 sys sys 1022588098 517
 sys/src/9/ip/ip.c - 664 sys sys 1047951326 15285
 sys/src/9/ip/ip.h - 664 sys sys 1063857527 16054
@@ -5244,7 +5244,7 @@ sys/src/9/ip/ptclbsum.c - 664 sys sys 1022588099 1243
 sys/src/9/ip/rudp.c - 664 sys sys 1055700790 21415
 sys/src/9/ip/tcp.c - 664 sys sys 1076613357 65462
 sys/src/9/ip/tripmedium.c - 664 sys sys 1045063515 7136
-sys/src/9/ip/udp.c - 664 sys sys 1055700791 13069
+sys/src/9/ip/udp.c - 664 sys sys 1077376216 13146
 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
@@ -5359,7 +5359,7 @@ sys/src/9/pc/reboot.h - 664 sys sys 1015014522 334
 sys/src/9/pc/rebootcode.s - 664 sys sys 1015014522 988
 sys/src/9/pc/screen.c - 664 sys sys 1039753497 7266
 sys/src/9/pc/screen.h - 664 sys sys 1060267144 3797
-sys/src/9/pc/sd53c8xx.c - 664 sys sys 1055689891 52089
+sys/src/9/pc/sd53c8xx.c - 664 sys sys 1077376414 52220
 sys/src/9/pc/sd53c8xx.i - 664 sys sys 1045063730 27355
 sys/src/9/pc/sd53c8xx.n - 664 sys sys 1032059019 12455
 sys/src/9/pc/sdata.c - 664 sys sys 1071615236 50538
@@ -5433,7 +5433,7 @@ sys/src/9/port/devssl.c - 664 sys sys 1045063590 26100
 sys/src/9/port/devtinyfs.c - 664 sys sys 1015278339 15347
 sys/src/9/port/devtls.c - 664 sys sys 1066737478 45222
 sys/src/9/port/devuart.c - 664 sys sys 1077055016 11683
-sys/src/9/port/edf.c - 664 sys sys 1072704672 12331
+sys/src/9/port/edf.c - 664 sys sys 1077376394 12357
 sys/src/9/port/edf.h - 664 sys sys 1074883055 1145
 sys/src/9/port/error.h - 664 sys sys 1055700517 2630
 sys/src/9/port/fault.c - 664 sys sys 1067722722 6628
@@ -5461,7 +5461,7 @@ sys/src/9/port/nulledf.c - 664 sys sys 1037669300 821
 sys/src/9/port/page.c - 664 sys sys 1055688510 8107
 sys/src/9/port/parse.c - 664 sys sys 1014931177 2026
 sys/src/9/port/pgrp.c - 664 sys sys 1072704671 3940
-sys/src/9/port/portclock.c - 664 sys sys 1073323995 4758
+sys/src/9/port/portclock.c - 664 sys sys 1077376395 4759
 sys/src/9/port/portdat.h - 664 sys sys 1073324006 22707
 sys/src/9/port/portfns.h - 664 sys sys 1068215525 11376
 sys/src/9/port/portmkfile - 664 sys sys 1067722766 2098
@@ -5492,7 +5492,7 @@ sys/src/9/ppc/clock.c - 664 sys sys 1068135488 1032
 sys/src/9/ppc/dat.h - 664 sys sys 1071245549 4727
 sys/src/9/ppc/devether.c - 664 sys sys 1059490750 9264
 sys/src/9/ppc/devflash.c - 664 sys sys 1059490750 19885
-sys/src/9/ppc/devirq.c - 664 sys sys 1067722849 6057
+sys/src/9/ppc/devirq.c - 664 sys sys 1077376394 6053
 sys/src/9/ppc/devtls.c - 664 sys sys 1059490751 43721
 sys/src/9/ppc/errstr.h - 664 sys sys 1059490751 2137
 sys/src/9/ppc/etherfcc.c - 664 sys sys 1068135488 14307
@@ -5505,7 +5505,7 @@ sys/src/9/ppc/io.h - 664 sys sys 1059490752 1017
 sys/src/9/ppc/l.s - 664 sys sys 1072705423 20411
 sys/src/9/ppc/lblast.h - 664 sys sys 1059490752 1694
 sys/src/9/ppc/lucu.h - 664 sys sys 1059490752 935
-sys/src/9/ppc/m8260.c - 664 sys sys 1072705483 14480
+sys/src/9/ppc/m8260.c - 664 sys sys 1077376312 14480
 sys/src/9/ppc/m8260.h - 664 sys sys 1068135488 20913
 sys/src/9/ppc/main.c - 664 sys sys 1072705483 9044
 sys/src/9/ppc/mcc.c - 664 sys sys 1059490752 9667
@@ -5517,7 +5517,7 @@ sys/src/9/ppc/msaturn.h - 664 sys sys 1059490753 99
 sys/src/9/ppc/mtx.c - 664 sys sys 1059490753 177
 sys/src/9/ppc/random.c - 664 sys sys 1059490753 1983
 sys/src/9/ppc/saturntimer.c - 664 sys sys 1072705482 1737
-sys/src/9/ppc/trap.c - 664 sys sys 1072705481 17531
+sys/src/9/ppc/trap.c - 664 sys sys 1077376394 17460
 sys/src/9/ppc/uartsaturn.c - 664 sys sys 1059490754 7151
 sys/src/9/ppc/uartsmc.c - 664 sys sys 1068135489 11462
 sys/src/9/ppc/ucu - 664 sys sys 1067722849 672
@@ -6783,30 +6783,30 @@ sys/src/cmd/acid/print.c - 664 sys sys 984756705 6840
 sys/src/cmd/acid/proc.c - 664 sys sys 1014924908 4513
 sys/src/cmd/acid/util.c - 664 sys sys 944960738 4297
 sys/src/cmd/acme - 20000000775 sys sys 969511023 0
-sys/src/cmd/acme/acme.c - 664 sys sys 1035591507 18969
+sys/src/cmd/acme/acme.c - 664 sys sys 1077376255 19258
 sys/src/cmd/acme/addr.c - 664 sys sys 1018553456 4787
 sys/src/cmd/acme/buff.c - 664 sys sys 1014926092 5573
 sys/src/cmd/acme/cols.c - 664 sys sys 1032462024 11122
-sys/src/cmd/acme/dat.h - 664 sys sys 1073566949 10976
+sys/src/cmd/acme/dat.h - 664 sys sys 1077376255 11019
 sys/src/cmd/acme/disk.c - 664 sys sys 1014926093 2151
-sys/src/cmd/acme/ecmd.c - 664 sys sys 1073566949 24288
+sys/src/cmd/acme/ecmd.c - 664 sys sys 1077376256 24294
 sys/src/cmd/acme/edit.c - 664 sys sys 1015701171 12055
 sys/src/cmd/acme/edit.h - 664 sys sys 969500816 2466
 sys/src/cmd/acme/elog.c - 664 sys sys 1067723163 7241
-sys/src/cmd/acme/exec.c - 664 sys sys 1067723165 27057
+sys/src/cmd/acme/exec.c - 664 sys sys 1077376257 28024
 sys/src/cmd/acme/file.c - 664 sys sys 1044626079 5717
-sys/src/cmd/acme/fns.h - 664 sys sys 1067723164 2922
+sys/src/cmd/acme/fns.h - 664 sys sys 1077376255 2857
 sys/src/cmd/acme/fsys.c - 664 sys sys 1022512648 12727
-sys/src/cmd/acme/look.c - 664 sys sys 1072729041 14132
+sys/src/cmd/acme/look.c - 664 sys sys 1077376257 14213
 sys/src/cmd/acme/mkfile - 664 sys sys 1058463682 543
 sys/src/cmd/acme/regx.c - 664 sys sys 1014926094 16057
 sys/src/cmd/acme/rows.c - 664 sys sys 1068140772 14637
 sys/src/cmd/acme/scrl.c - 664 sys sys 1014926095 3072
-sys/src/cmd/acme/text.c - 664 sys sys 1072729041 26813
+sys/src/cmd/acme/text.c - 664 sys sys 1077376258 27226
 sys/src/cmd/acme/time.c - 664 sys sys 1014926095 1783
-sys/src/cmd/acme/util.c - 664 sys sys 1073566950 6456
+sys/src/cmd/acme/util.c - 664 sys sys 1077376259 7310
 sys/src/cmd/acme/wind.c - 664 sys sys 1073566950 11094
-sys/src/cmd/acme/xfid.c - 664 sys sys 1067723165 19180
+sys/src/cmd/acme/xfid.c - 664 sys sys 1077376259 19260
 sys/src/cmd/ar.c - 664 sys sys 1046643027 23717
 sys/src/cmd/archfs.c - 664 sys sys 1014925694 3871
 sys/src/cmd/ascii.c - 664 sys sys 964457138 3989
@@ -7361,9 +7361,9 @@ sys/src/cmd/disk/9660/cdrdwr.c - 664 sys sys 1017679314 11158
 sys/src/cmd/disk/9660/conform.c - 664 sys sys 1015009157 2450
 sys/src/cmd/disk/9660/direc.c - 664 sys sys 1015009157 4249
 sys/src/cmd/disk/9660/dump.c - 664 sys sys 1021579989 9572
-sys/src/cmd/disk/9660/dump9660.c - 664 sys sys 1020313485 9038
+sys/src/cmd/disk/9660/dump9660.c - 664 sys sys 1077376395 9405
 sys/src/cmd/disk/9660/ichar.c - 664 sys sys 1021579989 4828
-sys/src/cmd/disk/9660/iso9660.h - 664 sys sys 1017679315 9143
+sys/src/cmd/disk/9660/iso9660.h - 664 sys sys 1077376396 9165
 sys/src/cmd/disk/9660/jchar.c - 664 sys sys 1036474102 3339
 sys/src/cmd/disk/9660/mk9660.rc - 775 sys sys 984788654 144
 sys/src/cmd/disk/9660/mkfile - 664 sys sys 1036474115 493
@@ -7374,7 +7374,7 @@ sys/src/cmd/disk/9660/sysuse.c - 664 sys sys 1015009158 13953
 sys/src/cmd/disk/9660/uid.c - 664 sys sys 984788373 520
 sys/src/cmd/disk/9660/unix.c - 664 sys sys 984788373 1352
 sys/src/cmd/disk/9660/util.c - 664 sys sys 1017679315 1294
-sys/src/cmd/disk/9660/write.c - 664 sys sys 1021579990 8764
+sys/src/cmd/disk/9660/write.c - 664 sys sys 1077376396 8836
 sys/src/cmd/disk/exsort.c - 664 sys sys 944960885 1964
 sys/src/cmd/disk/format.c - 664 sys sys 1022448818 17648
 sys/src/cmd/disk/kfs - 20000000775 sys sys 1019072794 0

+ 31 - 0
dist/replica/plan9.log

@@ -13920,3 +13920,34 @@
 1077163284 0 c 386/bin/diff - 775 sys sys 1077163174 82769
 1077249698 0 c 386/lib/libmp.a - 664 sys sys 1077249616 81428
 1077336112 0 c 386/lib/libmp.a - 664 sys sys 1077335667 77700
+1077377519 0 c sys/games/lib/fortunes - 664 sys sys 1077376248 247524
+1077377519 1 c sys/lib/mimetype - 664 sys sys 1077376279 5699
+1077377519 2 c sys/man/1/trace - 664 sys sys 1077376189 1756
+1077377519 3 c sys/man/4/usb - 664 sys sys 1077376395 3332
+1077377519 4 c sys/src/9/alphapc/mem.h - 664 sys sys 1077376459 3127
+1077377519 5 c sys/src/9/boot/boot.c - 664 sys sys 1077376393 5361
+1077377519 6 c sys/src/9/ip/icmp.c - 664 sys sys 1077376217 9511
+1077377519 7 c sys/src/9/ip/il.c - 664 sys sys 1077376217 26959
+1077377519 8 c sys/src/9/ip/udp.c - 664 sys sys 1077376216 13146
+1077377519 9 c sys/src/9/pc/sd53c8xx.c - 664 sys sys 1077376414 52220
+1077377519 10 c sys/src/9/port/edf.c - 664 sys sys 1077376394 12357
+1077377519 11 c sys/src/9/port/portclock.c - 664 sys sys 1077376395 4759
+1077377519 12 c sys/src/9/ppc/devirq.c - 664 sys sys 1077376394 6053
+1077377519 13 c sys/src/9/ppc/m8260.c - 664 sys sys 1077376312 14480
+1077377519 14 c sys/src/9/ppc/trap.c - 664 sys sys 1077376394 17460
+1077377519 15 c sys/src/cmd/acme/acme.c - 664 sys sys 1077376255 19258
+1077377519 16 c sys/src/cmd/acme/dat.h - 664 sys sys 1077376255 11019
+1077377519 17 c sys/src/cmd/acme/ecmd.c - 664 sys sys 1077376256 24294
+1077377519 18 c sys/src/cmd/acme/exec.c - 664 sys sys 1077376257 28024
+1077377519 19 c sys/src/cmd/acme/fns.h - 664 sys sys 1077376255 2857
+1077377519 20 c sys/src/cmd/acme/look.c - 664 sys sys 1077376257 14213
+1077377519 21 c sys/src/cmd/acme/text.c - 664 sys sys 1077376258 27226
+1077377519 22 c sys/src/cmd/acme/util.c - 664 sys sys 1077376259 7310
+1077377519 23 c sys/src/cmd/acme/xfid.c - 664 sys sys 1077376259 19260
+1077377519 24 c sys/src/cmd/disk/9660/dump9660.c - 664 sys sys 1077376395 9405
+1077377519 25 c sys/src/cmd/disk/9660/iso9660.h - 664 sys sys 1077376396 9165
+1077377519 26 c sys/src/cmd/disk/9660/write.c - 664 sys sys 1077376396 8836
+1077409924 0 c sys/src/9/alphapc/mem.h - 664 sys sys 1077408326 3131
+1077422406 0 c 386/bin/acme - 775 sys sys 1077422339 424461
+1077422406 1 c 386/bin/disk/dump9660 - 775 sys sys 1077422340 152343
+1077422406 2 c 386/lib/libmp.a - 664 sys sys 1077422340 78536

+ 1 - 0
sys/games/lib/fortunes

@@ -4000,3 +4000,4 @@ fortune 1907: suicide: sys: trap: divide error pc=0x00001b33
 i'm not real convinced about this but I could be interesting. - boyd
 If you are what you eat, then I'm cheap, fast, and easy.
 /@burro.ws: Permission denied
+return ({goto L; p;}) && ({L: 5;});

+ 2 - 1
sys/lib/mimetype

@@ -61,6 +61,7 @@
 .jpe		image		jpeg		-		y
 .jpeg		image		jpeg		-		y
 .jpg		image		jpeg		-		y
+.jpg		image		pjpeg		-		y
 .latex		application	x-latex		-		y
 .ltx		application	x-latex		-		y
 .man		application	x-troff-man	-		y
@@ -147,7 +148,7 @@
 .xwd		image		x-xwindowdump	-		y
 .z		-		-		compress	m
 .Z		-		-		compress	m
-.zip		application	zip		-		m
+.zip		application	zip		-		n
 .zzz		application	sleep		-		n # testing
 -		application	x-gunzip	-		p # type for .tar.gz
 -		message		delivery-status	-		y # mail bounces

+ 2 - 2
sys/man/1/trace

@@ -42,8 +42,8 @@ flag makes
 .B trace
 open a new window for its display.
 .PP
-To enable process tracing echo the string "trace on" into 
-/proc/<pid>/ctl.  To disable tracing of a process echo "trace off"
+To enable process tracing echo the string "traceon" into 
+/proc/<pid>/ctl.  To disable tracing of a process echo "traceoff"
 in the control file.  Trace enables tracing on all processes as specified
 by their
 .B pids 

+ 7 - 7
sys/man/4/usb

@@ -1,7 +1,8 @@
 .TH USB 4
 .SH NAME
 usbmouse,
-usbaudio
+usbaudio,
+usbprinter
 \- Universal Serial Bus user level device drivers
 .SH SYNOPSIS
 .B usb/usbmouse
@@ -29,7 +30,7 @@ usbaudio
 .I n
 ]
 .PP
-.B usbstart
+.B usb/usbprinter
 .SH DESCRIPTION
 These programs implement support for specific USB device classes.
 They should be run after
@@ -37,11 +38,6 @@ They should be run after
 has had a chance to locate the devices in question and provide
 them with device addresses and minimal configuration.
 Dynamic handling of device insertion and removal is currently not supported.
-.PP
-The script
-.B usbstart
-checks whether a USB driver is present, and if so, starts usbd
-followed by the support programs listed below.
 .SS Mice
 .B Usbmouse
 sends mouse events from a USB mouse to
@@ -138,6 +134,10 @@ and read from
 The data format is little endian, samples ordered primarily by time and
 secondarily by channel.  Samples occupy the minimum integral number
 of bytes.  Read and write operations of arbitrary size are allowed.
+.SS Printers
+.B Usbprinter
+is a script that mounts a usb printer on
+.BR /n/lp .
 .SH EXAMPLE
 .LP
 To use a USB mouse and audio device, put the following in your profile

+ 16 - 20
sys/src/9/alphapc/mem.h

@@ -5,20 +5,19 @@
 /*
  * Sizes
  */
-
 #define	BI2BY		8			/* bits per byte */
 #define	BI2WD		32			/* bits per word */
 #define	BY2WD		4			/* bytes per word */
-#define 	BY2V		8			/* bytes per vlong */
-#define	BY2PG		8192		/* bytes per page */
-#define	WD2PG		(BY2PG/BY2WD)	/* words per page */
+#define BY2V		8			/* bytes per vlong */
+#define	BY2PG		8192			/* bytes per page */
+#define	WD2PG		(BY2PG/BY2WD)		/* words per page */
 #define	PGSHIFT		13			/* log(BY2PG) */
-#define 	ROUND(s, sz)	(((s)+(sz-1))&~(sz-1))
-#define 	PGROUND(s)	ROUND(s, BY2PG)
+#define ROUND(s, sz)	(((s)+((sz)-1))&~((sz)-1))
+#define PGROUND(s)	ROUND(s, BY2PG)
 #define BLOCKALIGN	8
 
 #define	BY2PTE		8			/* bytes per pte entry */
-#define	PTE2PG		(BY2PG/BY2PTE)	/* pte entries per page */
+#define	PTE2PG		(BY2PG/BY2PTE)		/* pte entries per page */
 
 #define	MAXMACH		1			/* max # cpus system can run */
 #define	KSTACK		4096			/* Size of kernel stack */
@@ -27,14 +26,13 @@
  * Time
  */
 #define	HZ		100			/* clock frequency */
-#define	MS2HZ	(1000/HZ)
+#define	MS2HZ		(1000/HZ)
 #define	TK2SEC(t)	((t)/HZ)		/* ticks to seconds */
 
 /*
  * Magic registers
  */
-
-#define	MACH	15		/* R15 is m-> */
+#define	MACH		15		/* R15 is m-> */
 #define	USER		14		/* R14 is up-> */
 
 
@@ -51,16 +49,15 @@
  * This means that we can only map the first 2G of physical
  * space via putmmu() - ie only physical memory, not devices.
  */
-
-#define	PTEVALID		0x3301
+#define	PTEVALID	0x3301
 #define	PTEKVALID	0x1101
 #define	PTEASM		0x0010
-#define	PTEGH(s)		((s)<<5)
-#define	PTEWRITE		0
+#define	PTEGH(s)	((s)<<5)
+#define	PTEWRITE	0
 #define	PTERONLY	0x4
 #define	PTEUNCACHED	0
 #define	PPN(n)		(((n)>>PGSHIFT)<<14)
-#define	FIXPTE(x)		((((uvlong)(x)>>14)<<32)|((x) & 0x3fff))
+#define	FIXPTE(x)	((((uvlong)(x)>>14)<<32)|((x) & 0x3fff))
 #define	PTEPFN(pa)	(((uvlong)(pa)>>PGSHIFT)<<32)
 #define	NCOLOR		1
 #define	getpgcolor(a)	0
@@ -73,14 +70,13 @@
 /*
  * Address spaces
  */
-
 #define	UZERO	0			/* base of user address space */
 #define	UTZERO	(UZERO+BY2PG)		/* first address in user text */
 #define	USTKTOP	(TSTKTOP-TSTKSIZ*BY2PG)	/* byte just beyond user stack */
-#define	TSTKTOP	KZERO	/* top of temporary stack */
+#define	TSTKTOP	KZERO			/* top of temporary stack */
 #define	TSTKSIZ 100
-#define	KZERO	0x80000000	/* base of kernel address space */
-#define	KTZERO	(KZERO+0x400000)		/* first address in kernel text */
+#define	KZERO	0x80000000		/* base of kernel address space */
+#define	KTZERO	(KZERO+0x400000)	/* first address in kernel text */
 #define	USTKSIZE	(4*1024*1024)	/* size of user stack */
 
 /*
@@ -127,7 +123,7 @@
  * Processor Status (as returned by rdps)
  */
 #define	UMODE	0x8
-#define	IPL		0x7
+#define	IPL	0x7
 
 
 #define isphys(x) (((ulong)x&KZERO)!=0)

+ 2 - 0
sys/src/9/boot/boot.c

@@ -140,6 +140,8 @@ boot(int argc, char *argv[])
 	setenv("rootdir", rp);
 
 	settime(islocal, afd, rsp);
+	if(afd > 0)
+		close(afd);
 	swapproc();
 
 	cmd = getenv("init");

+ 5 - 1
sys/src/9/ip/icmp.c

@@ -130,7 +130,11 @@ extern int
 icmpstate(Conv *c, char *state, int n)
 {
 	USED(c);
-	return snprint(state, n, "%s", "Datagram");
+	return snprint(state, n, "%s qin %d qout %d",
+		"Datagram",
+		c->rq ? qlen(c->rq) : 0,
+		c->wq ? qlen(c->wq) : 0
+	);
 }
 
 extern char*

+ 4 - 2
sys/src/9/ip/il.c

@@ -24,7 +24,7 @@ char	*ilstates[] =
 	"Syncer",
 	"Syncee",
 	"Established",
-	"Listening",
+	"Listen",
 	"Closing",
 	"Opening",		/* only for file server */
 };
@@ -256,8 +256,10 @@ ilstate(Conv *c, char *state, int n)
 	Ilcb *ic;
 
 	ic = (Ilcb*)(c->ptcl);
-	return snprint(state, n, "%s del %5.5d Br %5.5d md %5.5d una %5.5lud rex %5.5d rxq %5.5d max %5.5d",
+	return snprint(state, n, "%s qin %d qout %d del %5.5d Br %5.5d md %5.5d una %5.5lud rex %5.5d rxq %5.5d max %5.5d",
 		ilstates[ic->state],
+		c->rq ? qlen(c->rq) : 0,
+		c->wq ? qlen(c->wq) : 0,
 		ic->delay>>LogAGain, ic->rate>>LogAGain, ic->mdev>>LogDGain,
 		ic->unackedbytes, ic->rxtot, ic->rxquery, ic->maxrtt);
 }

+ 5 - 1
sys/src/9/ip/udp.c

@@ -125,7 +125,11 @@ udpconnect(Conv *c, char **argv, int argc)
 static int
 udpstate(Conv *c, char *state, int n)
 {
-	return snprint(state, n, "%s", c->inuse?"Open":"Closed");
+	return snprint(state, n, "%s qin %d qout %d",
+		c->inuse ? "Open" : "Closed",
+		c->rq ? qlen(c->rq) : 0,
+		c->wq ? qlen(c->wq) : 0
+	);
 }
 
 static char*

+ 2 - 0
sys/src/9/pc/sd53c8xx.c

@@ -1856,6 +1856,7 @@ bios_set_differential(Controller *c)
 #define SYM_885_DID	0x000d	/* ditto */
 #define SYM_875_DID	0x000f	/* ditto */
 #define SYM_1010_DID	0x0020
+#define SYM_1011_DID	0x0021
 #define SYM_875J_DID	0x008f
 
 static Variant variant[] = {
@@ -1875,6 +1876,7 @@ static Variant variant[] = {
 { SYM_895_DID,   0xff, "SYM53C895",	Burst128, 16, 24, Prefetch|LocalRAM|BigFifo|Wide|Ultra|Ultra2 },
 { SYM_896_DID,   0xff, "SYM53C896",	Burst128, 16, 64, Prefetch|LocalRAM|BigFifo|Wide|Ultra|Ultra2 },
 { SYM_1010_DID,  0xff, "SYM53C1010",	Burst128, 16, 64, Prefetch|LocalRAM|BigFifo|Wide|Ultra|Ultra2 },
+{ SYM_1011_DID,   0xff, "SYM53C1010",	Burst128, 16, 64, Prefetch|LocalRAM|BigFifo|Wide|Ultra|Ultra2 },
 };
 
 #define offsetof(s, t) ((ulong)&((s *)0)->t)

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

@@ -471,7 +471,7 @@ edfready(Proc *p)
 				DPRINT("%t edfready %lud[%s], release=%t\n",
 					now, p->pid, statename[p->state], e->t);
 			}
-			if(p->state == Running && (e->flags & (Yield|Yieldonblock)) == 0){
+			if(p->state == Running && (e->flags & (Yield|Yieldonblock)) == 0 && (e->flags & Extratime)){
 				/* If we were running, we've overrun our CPU allocation
 				 * or missed the deadline, continue running best-effort at low priority
 				 * Otherwise we were blocked.  If we don't yield on block, we continue

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

@@ -97,7 +97,7 @@ timeradd(Timer *nt)
 	if (nt->tmode == Tabsolute){
 		when = todget(nil);
 		if (nt->tns <= when){
-			if (nt->tns + MS2NS(1) <= when)	/* Give it some slack, small deviations will happen */
+			if (nt->tns + MS2NS(10) <= when)	/* Give it some slack, small deviations will happen */
 				print("timeradd (%lld %lld) %lld too early 0x%lux\n",
 					when, nt->tns, when - nt->tns, getcallerpc(&nt));
 			nt->tns = when;

+ 1 - 1
sys/src/9/ppc/devirq.c

@@ -91,7 +91,7 @@ irqenable(Irqconfig *ic, int irq)
 	if (ic->intenable)
 		return;
 	if (irq == Qmstimer){
-		if (ic->tstatus == Tidle)
+		if (ic->tnext == nil)
 			ic->tns = MS2NS(ic->mode);
 		ic->tmode = Tperiodic;
 		timeradd(&ic->Timer);

+ 1 - 1
sys/src/9/ppc/m8260.c

@@ -145,7 +145,7 @@ machinit(void)
 	 * Currently we use 32-bit transfers, because the 8260 does not easily do 64-bit operations.
 	 */
 	iomem->bank[6].br = 0xe0001801;
-	iomem->bank[6].or = 0xff000816;	/* Was 0xff000856; one wait state */
+	iomem->bank[6].or = 0xff000896;	/* Was 0xff000816; one wait state */
 
 /*
  * All systems with rev. A.1 (0K26N) silicon had serious problems when doing

+ 8 - 11
sys/src/9/ppc/trap.c

@@ -6,6 +6,7 @@
 #include	"ureg.h"
 #include	"../port/error.h"
 #include	"tos.h"
+#include	<trace.h>
 
 static Lock vctllock;
 static Vctl *vctl[256];
@@ -385,19 +386,12 @@ intr(Ureg *ureg)
 {
 	int vno;
 	Vctl *ctl, *v;
+	void (*pt)(Proc*, int, vlong);
 
-#ifdef notdef
-	if (inintr > 4){
-		int i;
-		for(i = 0; i != inintr; i++)
-			iprint("intr[%d] %d %.lld\n", i, intrstack[i], intrtime[i]);
-		iprint("current vector %d, lastoffset %lld, %.lld\n", intvec(), lastoffset,
-				fastticks(nil));
-		panic("recursing");
-	}
-	inintr++;
-#endif
 	vno = intvec();
+	pt = proctrace;
+	if(up && up->trace && pt)
+		pt(up, (vno << 16) | SInts, 0);
 
 //	intrstack[inintr - 1] = vno;
 
@@ -413,6 +407,9 @@ intr(Ureg *ureg)
 	}
 
 	intend(vno);	/* reenable the interrupt */
+	pt = proctrace;
+	if(up && up->trace && pt)
+		pt(up, (vno << 16) | SInte, 0);
 //	inintr--;
 	preempted();
 }

+ 17 - 1
sys/src/cmd/acme/acme.c

@@ -70,6 +70,9 @@ threadmain(int argc, char *argv[])
 
 	loadfile = nil;
 	ARGBEGIN{
+	case 'a':
+		globalautoindent = TRUE;
+		break;
 	case 'b':
 		bartflag = TRUE;
 		break;
@@ -98,7 +101,7 @@ threadmain(int argc, char *argv[])
 		break;
 	default:
 	Usage:
-		fprint(2, "usage: acme -c ncol -f fontname -F fixedwidthfontname -l loadfile\n");
+		fprint(2, "usage: acme -a -c ncol -f fontname -F fixedwidthfontname -l loadfile\n");
 		exits("usage");
 	}ARGEND
 
@@ -376,6 +379,9 @@ keyboardthread(void *)
 				winlock(t->w, 'K');
 				wincommit(t->w, t);
 				winunlock(t->w);
+				qlock(&row);
+				flushwarnings();
+				qunlock(&row);
 				flushimage(display, 1);
 			}
 			alts[KTimer].c = nil;
@@ -402,6 +408,9 @@ keyboardthread(void *)
 			}
 			if(nbrecv(keyboardctl->c, &r) > 0)
 				goto casekeyboard;
+			qlock(&row);
+			flushwarnings();
+			qunlock(&row);
 			flushimage(display, 1);
 			break;
 		}
@@ -442,6 +451,9 @@ mousethread(void *)
 				error("attach to window");
 			scrlresize();
 			rowresize(&row, screen->clipr);
+			qlock(&row);
+			flushwarnings();
+			qunlock(&row);
 			flushimage(display, 1);
 			break;
 		case MPlumb:
@@ -452,6 +464,9 @@ mousethread(void *)
 				else if(strcmp(act, "showdata")==0)
 					plumbshow(pm);
 			}
+			qlock(&row);
+			flushwarnings();
+			qunlock(&row);
 			flushimage(display, 1);
 			plumbfree(pm);
 			break;
@@ -537,6 +552,7 @@ mousethread(void *)
 				goto Continue;
 			}
     Continue:
+			flushwarnings();
 			flushimage(display, 1);
 			qunlock(&row);
 			break;

+ 2 - 0
sys/src/cmd/acme/dat.h

@@ -232,6 +232,7 @@ struct Window
 	uchar	isscratch;
 	uchar	filemenu;
 	uchar	dirty;
+	uchar	autoindent;
 	int		id;
 	Range	addr;
 	Range	limit;
@@ -529,6 +530,7 @@ int			plumbeditfd;
 char			wdir[];
 int			editing;
 int			messagesize;		/* negotiated in 9P version setup */
+int			globalautoindent;
 
 Channel	*ckeyboard;	/* chan(Rune)[10] */
 Channel	*cplumb;		/* chan(Plumbmsg*) */

+ 1 - 1
sys/src/cmd/acme/ecmd.c

@@ -590,7 +590,7 @@ runpipe(Text *t, int cmd, Rune *cr, int ncr, int state)
 
 	r = skipbl(cr, ncr, &n);
 	if(n == 0)
-		editerror("no command specified for >");
+		editerror("no command specified for %c", cmd);
 	w = nil;
 	if(state == Inserting){
 		w = t->w;

+ 50 - 7
sys/src/cmd/acme/exec.c

@@ -22,6 +22,7 @@ void	fontx(Text*, Text*, Text*, int, int, Rune*, int);
 void	get(Text*, Text*, Text*, int, int, Rune*, int);
 void	id(Text*, Text*, Text*, int, int, Rune*, int);
 void	incl(Text*, Text*, Text*, int, int, Rune*, int);
+void	indent(Text*, Text*, Text*, int, int, Rune*, int);
 void	kill(Text*, Text*, Text*, int, int, Rune*, int);
 void	local(Text*, Text*, Text*, int, int, Rune*, int);
 void	look(Text*, Text*, Text*, int, int, Rune*, int);
@@ -56,6 +57,7 @@ Exectab exectab[] = {
 	{ L"Get",		get,		FALSE,	TRUE,	XXX		},
 	{ L"ID",		id,		FALSE,	XXX,		XXX		},
 	{ L"Incl",		incl,		FALSE,	XXX,		XXX		},
+	{ L"Indent",	indent,	FALSE,	XXX,		XXX		},
 	{ L"Kill",		kill,		FALSE,	XXX,		XXX		},
 	{ L"Load",		dump,	FALSE,	FALSE,	XXX		},
 	{ L"Local",		local,	FALSE,	XXX,		XXX		},
@@ -398,7 +400,7 @@ getname(Text *t, Text *argt, Rune *arg, int narg, int isput)
 		dir.nr = 0;
 		if(n>0 && arg[0]!='/'){
 			dir = dirname(t, nil, 0);
-			if(n==1 && dir.r[0]=='.'){	/* sigh */
+			if(dir.nr==1 && dir.r[0]=='.'){	/* sigh */
 				free(dir.r);
 				dir.r = nil;
 				dir.nr = 0;
@@ -534,15 +536,15 @@ putfile(File *f, int q0, int q1, Rune *namer, int nname)
 			f->qidpath = d->qid.path;
 			f->mtime = d->mtime;
 			if(f->unread)
-				warningew(w, nil, "%s not written; file already exists\n", name);
+				warning(nil, "%s not written; file already exists\n", name);
 			else
-				warningew(w, nil, "%s modified%s%s since last read\n", name, d->muid[0]?" by ":"", d->muid);
+				warning(nil, "%s modified%s%s since last read\n", name, d->muid[0]?" by ":"", d->muid);
 			goto Rescue1;
 		}
 	}
 	fd = create(name, OWRITE, 0666);
 	if(fd < 0){
-		warningew(w, nil, "can't create file %s: %r\n", name);
+		warning(nil, "can't create file %s: %r\n", name);
 		goto Rescue1;
 	}
 	r = fbufalloc();
@@ -551,7 +553,7 @@ putfile(File *f, int q0, int q1, Rune *namer, int nname)
 	d = dirfstat(fd);
 	isapp = (d!=nil && d->length>0 && (d->qid.type&QTAPPEND));
 	if(isapp){
-		warningew(w, nil, "%s not written; file is append only\n", name);
+		warning(nil, "%s not written; file is append only\n", name);
 		goto Rescue2;
 	}
 
@@ -562,7 +564,7 @@ putfile(File *f, int q0, int q1, Rune *namer, int nname)
 		bufread(f, q, r, n);
 		m = snprint(s, BUFSIZE+1, "%.*S", n, r);
 		if(write(fd, s, m) != m){
-			warningew(w, nil, "can't write file %s: %r\n", name);
+			warning(nil, "can't write file %s: %r\n", name);
 			goto Rescue2;
 		}
 	}
@@ -625,7 +627,7 @@ put(Text *et, Text*, Text *argt, int, int, Rune *arg, int narg)
 	f = w->body.file;
 	name = getname(&w->body, argt, arg, narg, TRUE);
 	if(name == nil){
-		warningew(w, nil, "no file name\n");
+		warning(nil, "no file name\n");
 		return;
 	}
 	namer = bytetorune(name, &nname);
@@ -1017,6 +1019,47 @@ incl(Text *et, Text*, Text *argt, int, int, Rune *arg, int narg)
 	}
 }
 
+static int indentval(Rune *s, int n){
+	if(n < 2)
+		return -1;
+	if(runestrncmp(s, L"ON", n) == 0){
+		globalautoindent = TRUE;
+		warning(nil, "Indent ON\n");
+		return -2;
+	}
+	if(runestrncmp(s, L"OFF", n) == 0){
+		globalautoindent = FALSE;
+		warning(nil, "Indent OFF\n");
+		return -2;
+	}
+	return runestrncmp(s, L"on", n) == 0;
+}
+
+void
+indent(Text *et, Text*, Text *argt, int, int, Rune *arg, int narg)
+{
+	Rune *a, *r;
+	Window *w;
+	int na, len, autoindent;
+
+	if(et==nil || et->w==nil)
+		return;
+	w = et->w;
+	autoindent = -1;
+	getarg(argt, FALSE, TRUE, &r, &len);
+	if(r!=nil && len>0)
+		autoindent = indentval(r, len);
+	else{
+		a = findbl(arg, narg, &na);
+		if(a != arg)
+			autoindent = indentval(arg, narg-na);
+	}
+	if(autoindent >= 0)
+		w->autoindent = autoindent;
+	if(autoindent != -2)
+		warning(nil, "%.*S: Indent %s\n", w->body.file->nname, w->body.file->name, w->autoindent? "on" : "off");
+}
+
 void
 tab(Text *et, Text*, Text *argt, int, int, Rune *arg, int narg)
 {

+ 3 - 4
sys/src/cmd/acme/fns.h

@@ -1,8 +1,6 @@
 #pragma	varargck	argpos	warning	2
-#pragma	varargck	argpos	warningew	2
 
 void	warning(Mntdir*, char*, ...);
-void	warningew(Window*, Mntdir*, char*, ...);
 
 #define	fbufalloc()	emalloc(BUFSIZE)
 #define	fbuffree(x)	free(x)
@@ -25,7 +23,7 @@ void	clearmouse(void);
 void	allwindows(void(*)(Window*, void*), void*);
 uint loadfile(int, uint, int*, int(*)(void*, uint, Rune*, int), void*);
 
-Window*	errorwin(Mntdir*, int, Window*);
+Window*	errorwin(Mntdir*, int);
 Runestr cleanrname(Runestr);
 void	run(Window*, char*, Rune*, int, int, char*, char*, int);
 void fsysclose(void);
@@ -83,7 +81,8 @@ Window*	makenewwindow(Text *t);
 int	expand(Text*, uint, uint, Expand*);
 Rune*	skipbl(Rune*, int, int*);
 Rune*	findbl(Rune*, int, int*);
-char*	edittext(Window*, int, Rune*, int);	
+char*	edittext(Window*, int, Rune*, int);
+void		flushwarnings(void);
 
 #define	runemalloc(a)		(Rune*)emalloc((a)*sizeof(Rune))
 #define	runerealloc(a, b)	(Rune*)erealloc((a), (b)*sizeof(Rune))

+ 4 - 1
sys/src/cmd/acme/look.c

@@ -657,13 +657,16 @@ openfile(Text *t, Expand *e)
 		t->w->dirty = FALSE;
 		winsettag(t->w);
 		textsetselect(&t->w->tag, t->w->tag.file->nc, t->w->tag.file->nc);
-		if(ow != nil)
+		if(ow != nil){
 			for(i=ow->nincl; --i>=0; ){
 				n = runestrlen(ow->incl[i]);
 				rp = runemalloc(n);
 				runemove(rp, ow->incl[i], n);
 				winaddincl(w, rp, n);
 			}
+			w->autoindent = ow->autoindent;
+		}else
+			w->autoindent = globalautoindent;
 	}
 	if(e->a1 == e->a0)
 		eval = FALSE;

+ 18 - 2
sys/src/cmd/acme/text.c

@@ -605,10 +605,11 @@ textcomplete(Text *t)
 	}
 
 	if(!c->advance){
-		warning(nil, "%.*S%s%.*S*\n",
+		warning(nil, "%.*S%s%.*S*%s\n",
 			dir.nr, dir.r,
 			dir.nr>0 && dir.r[dir.nr-1]!='/' ? "/" : "",
-			nstr, str);
+			nstr, str,
+			c->nmatch? "" : ": no matches in:");
 		for(i=0; i<c->nfile; i++)
 			warning(nil, " %s\n", c->filename[i]);
 	}
@@ -751,6 +752,21 @@ texttype(Text *t, Rune r)
 		for(i=0; i<t->file->ntext; i++)
 			textfill(t->file->text[i]);
 		return;
+	case '\n':
+		if(t->w->autoindent){
+			/* find beginning of previous line using backspace code */
+			nnb = textbswidth(t, 0x15); /* ^U case */
+			rp = runemalloc(nnb + 1);
+			nr = 0;
+			rp[nr++] = r;
+			for(i=0; i<nnb; i++){
+				r = textreadc(t, t->q0-nnb+i);
+				if(r != ' ' && r != '\t')
+					break;
+				rp[nr++] = r;
+			}
+		}
+		break; /* fall through to normal code */
 	}
 	/* otherwise ordinary character; just insert, typically in caches of all texts */
 	for(i=0; i<t->file->ntext; i++){

+ 77 - 44
sys/src/cmd/acme/util.c

@@ -85,12 +85,13 @@ errorwin1(Rune *dir, int ndir, Rune **incl, int nincl)
 		runemove(r, incl[i], n);
 		winaddincl(w, r, n);
 	}
+	w->autoindent = globalautoindent;
 	return w;
 }
 
 /* make new window, if necessary; return with it locked */
 Window*
-errorwin(Mntdir *md, int owner, Window *e)
+errorwin(Mntdir *md, int owner)
 {
 	Window *w;
 
@@ -99,51 +100,97 @@ errorwin(Mntdir *md, int owner, Window *e)
 			w = errorwin1(nil, 0, nil, 0);
 		else
 			w = errorwin1(md->dir, md->ndir, md->incl, md->nincl);
-		if(w != e)
-			winlock(w, owner);
+		winlock(w, owner);
 		if(w->col != nil)
 			break;
 		/* window was deleted too fast */
-		if(w != e)
-			winunlock(w);
+		winunlock(w);
 	}
 	return w;
 }
 
-static void
-printwarning(Window *ew, Mntdir *md, Rune *r)
+typedef struct Warning Warning;
+
+struct Warning{
+	Mntdir *md;
+	Buffer buf;
+	Warning *next;
+};
+
+static Warning *warnings;
+
+static
+void
+addwarningtext(Mntdir *md, Rune *r, int nr)
+{
+	Warning *warn;
+	
+	for(warn = warnings; warn; warn=warn->next){
+		if(warn->md == md){
+			bufinsert(&warn->buf, warn->buf.nc, r, nr);
+			return;
+		}
+	}
+	warn = emalloc(sizeof(Warning));
+	warn->next = warnings;
+	warnings = warn;
+	bufinsert(&warn->buf, 0, r, nr);
+}
+
+/* called while row is locked */
+void
+flushwarnings(void)
 {
-	int nr, q0, owner;
+	Warning *warn, *next;
 	Window *w;
 	Text *t;
-
-	if(r == nil)
-		error("runevsmprint failed");
-	nr = runestrlen(r);
+	int owner, nr, q0, n;
+	Rune *r;
 
 	if(row.ncol == 0){	/* really early error */
 		rowinit(&row, screen->clipr);
 		rowadd(&row, nil, -1);
 		rowadd(&row, nil, -1);
 		if(row.ncol == 0)
-			error("initializing columns in warning()");
+			error("initializing columns in flushwarnings()");
 	}
 
-	w = errorwin(md, 'E', ew);
-	t = &w->body;
-	owner = w->owner;
-	if(owner == 0)
-		w->owner = 'E';
-	wincommit(w, t);
-	q0 = textbsinsert(t, t->file->nc, r, nr, TRUE, &nr);
-	textshow(t, q0, q0+nr, 1);
-	winsettag(t->w);
-	textscrdraw(t);
-	w->owner = owner;
-	w->dirty = FALSE;
-	if(ew != w)
+	for(warn=warnings; warn; warn=next) {
+		w = errorwin(warn->md, 'E');
+		t = &w->body;
+		owner = w->owner;
+		if(owner == 0)
+			w->owner = 'E';
+		wincommit(w, t);
+		/*
+		 * Most commands don't generate much output. For instance,
+		 * Edit ,>cat goes through /dev/cons and is already in blocks
+		 * because of the i/o system, but a few can.  Edit ,p will
+		 * put the entire result into a single hunk.  So it's worth doing
+		 * this in blocks (and putting the text in a buffer in the first
+		 * place), to avoid a big memory footprint.
+		 */
+		r = fbufalloc();
+		q0 = t->file->nc;
+		for(n = 0; n < warn->buf.nc; n += nr){
+			nr = warn->buf.nc - n;
+			if(nr > RBUFSIZE)
+				nr = RBUFSIZE;
+			bufread(&warn->buf, n, r, nr);
+			textbsinsert(t, t->file->nc, r, nr, TRUE, &nr);
+		}
+		textshow(t, q0, t->file->nc, 1);
+		free(r);
+		winsettag(t->w);
+		textscrdraw(t);
+		w->owner = owner;
+		w->dirty = FALSE;
 		winunlock(w);
-	free(r);
+		bufclose(&warn->buf);
+		next = warn->next;
+		free(warn);
+	}
+	warnings = nil;
 }
 
 void
@@ -155,23 +202,9 @@ warning(Mntdir *md, char *s, ...)
 	va_start(arg, s);
 	r = runevsmprint(s, arg);
 	va_end(arg);
-	printwarning(nil, md, r);
-}
-
-/*
- * Warningew is like warning but avoids locking the error window
- * if it's already locked by checking that ew!=error window.
- */
-void
-warningew(Window *ew, Mntdir *md, char *s, ...)
-{
-	Rune *r;
-	va_list arg;
-
-	va_start(arg, s);
-	r = runevsmprint(s, arg);
-	va_end(arg);
-	printwarning(ew, md, r);
+	if(r == nil)
+		error("runevsmprint failed");
+	addwarningtext(md, r, runestrlen(r));
 }
 
 int

+ 6 - 1
sys/src/cmd/acme/xfid.c

@@ -382,7 +382,7 @@ xfidwrite(Xfid *x)
 	x->data[x->count] = 0;
 	switch(qid){
 	case Qcons:
-		w = errorwin(x->f->mntdir, 'X', nil);
+		w = errorwin(x->f->mntdir, 'X');
 		t=&w->body;
 		goto BodyTag;
 
@@ -542,6 +542,9 @@ xfidwrite(Xfid *x)
 	}
 	if(w)
 		winunlock(w);
+	qlock(&row);
+	flushwarnings();
+	qunlock(&row);
 }
 
 void
@@ -812,6 +815,7 @@ xfideventwrite(Xfid *x, Window *w)
 			qunlock(&row);
 			goto Rescue;
 		}
+		flushwarnings();
 		qunlock(&row);
 
 	}
@@ -1029,6 +1033,7 @@ xfidindexread(Xfid *x)
 			b[n++] = '\n';
 		}
 	}
+	flushwarnings();
 	qunlock(&row);
 	off = x->offset;
 	cnt = x->count;

+ 12 - 1
sys/src/cmd/disk/9660/dump9660.c

@@ -10,6 +10,8 @@ int chatty;
 int doabort;
 int docolon;
 int mk9660;
+int dataoffset;
+int blocksize;
 Conform *map;
 
 static void addprotofile(char *new, char *old, Dir *d, void *a);
@@ -21,7 +23,7 @@ void
 usage(void)
 {
 	if(mk9660)
-		fprint(2, "usage: disk/mk9660 [-D:] [-9cjr] [-b bootfile] [-p proto] [-s src] cdimage\n");
+		fprint(2, "usage: disk/mk9660 [-D:] [-9cjr] [-b bootfile] [-o offset blocksize] [-p proto] [-s src] cdimage\n");
 	else
 		fprint(2, "usage: disk/dump9660 [-D:] [-9cjr] [-m maxsize] [-n now] [-p proto] [-s src] cdimage\n");
 	exits("usage");
@@ -94,6 +96,13 @@ main(int argc, char **argv)
 	case 'm':
 		maxsize = strtoul(EARGF(usage()), 0, 0);
 		break;
+	case 'o':
+		dataoffset = atoi(EARGF(usage()));
+		blocksize = atoi(EARGF(usage()));
+		if(blocksize%Blocksize)
+			sysfatal("bad block size %d -- must be multiple of 2048", blocksize);
+		blocksize /= Blocksize;
+		break;
 	case 'p':
 		proto = EARGF(usage());
 		break;
@@ -185,6 +194,8 @@ main(int argc, char **argv)
  	 * Must be done before creation of the Joliet tree so that
  	 * blocks and lengths are correct.
 	 */
+	if(dataoffset > cd->nextblock*Blocksize)
+		cd->nextblock = (dataoffset+Blocksize-1)/Blocksize;
 	Cwseek(cd, cd->nextblock*Blocksize);
 	writefiles(dump, cd, &iroot);
 

+ 1 - 0
sys/src/cmd/disk/9660/iso9660.h

@@ -422,3 +422,4 @@ extern Conform *map;
 extern int chatty;
 extern int docolon;
 extern int mk9660;
+extern int blocksize;

+ 2 - 0
sys/src/cmd/disk/9660/write.c

@@ -88,6 +88,8 @@ writefiles(Dump *d, Cdimg *cd, Direc *direc)
 
 	start = cd->nextblock;
 	assert(start != 0);
+	if(blocksize && start%blocksize)
+		start += blocksize-start%blocksize;
 
 	Cwseek(cd, start*Blocksize);