Browse Source

Plan 9 from Bell Labs 2004-01-02

David du Colombier 18 years ago
parent
commit
fe744a33a4

+ 13 - 10
dist/replica/plan9.db

@@ -4624,7 +4624,7 @@ sys/man/1/emacs - 664 sys sys 944959673 199
 sys/man/1/eqn - 664 sys sys 944959675 5655
 sys/man/1/expect - 664 sys sys 1058791094 3023
 sys/man/1/face - 664 sys sys 1062505426 2278
-sys/man/1/faces - 664 sys sys 1045501346 2052
+sys/man/1/faces - 664 sys sys 1072972212 2093
 sys/man/1/factor - 664 sys sys 957920005 1019
 sys/man/1/file - 664 sys sys 1015024739 1578
 sys/man/1/filter - 664 sys sys 1041108741 4403
@@ -5189,7 +5189,7 @@ sys/src/9/boot/boot.c - 664 sys sys 1063857658 5334
 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
-sys/src/9/boot/bootip.c - 664 sys sys 1063857634 3405
+sys/src/9/boot/bootip.c - 664 sys sys 1072972133 3418
 sys/src/9/boot/bootmkfile - 664 sys sys 1032053196 390
 sys/src/9/boot/doauthenticate.c - 664 sys sys 1015012529 2300
 sys/src/9/boot/embed.c - 664 sys sys 1039763720 1191
@@ -5252,7 +5252,7 @@ sys/src/9/mtx/kbd.c - 664 sys sys 1018721286 8358
 sys/src/9/mtx/l.s - 664 sys sys 1067722599 10730
 sys/src/9/mtx/main.c - 664 sys sys 1018721287 8344
 sys/src/9/mtx/mem.h - 664 sys sys 1026848200 5959
-sys/src/9/mtx/mkfile - 664 sys sys 1071245412 1504
+sys/src/9/mtx/mkfile - 664 sys sys 1072972534 1520
 sys/src/9/mtx/mmu.c - 664 sys sys 1018721287 4388
 sys/src/9/mtx/mtx - 664 sys sys 1056336297 416
 sys/src/9/mtx/mtxcpu - 664 sys sys 1039753442 421
@@ -5315,7 +5315,7 @@ sys/src/9/pc/i8253.c - 664 sys sys 1071245560 6251
 sys/src/9/pc/i8259.c - 664 sys sys 1015014519 4423
 sys/src/9/pc/init9.c - 664 sys sys 1040002518 94
 sys/src/9/pc/initcode.s - 664 sys sys 1015014519 282
-sys/src/9/pc/io.h - 664 sys sys 1067722633 7991
+sys/src/9/pc/io.h - 664 sys sys 1072972600 8023
 sys/src/9/pc/kbd.c - 664 sys sys 1071726245 9135
 sys/src/9/pc/l.s - 664 sys sys 1072704796 22700
 sys/src/9/pc/main.c - 664 sys sys 1072704797 14685
@@ -5357,7 +5357,7 @@ sys/src/9/pc/trap.c - 664 sys sys 1072704797 20506
 sys/src/9/pc/uarti8250.c - 664 sys sys 1067722686 13859
 sys/src/9/pc/uartpci.c - 664 sys sys 1015014524 2709
 sys/src/9/pc/usb.h - 664 sys sys 1063857246 3566
-sys/src/9/pc/usbuhci.c - 664 sys sys 1063857239 30688
+sys/src/9/pc/usbuhci.c - 664 sys sys 1072972271 30738
 sys/src/9/pc/vga.c - 664 sys sys 1039753497 4963
 sys/src/9/pc/vga3dfx.c - 664 sys sys 1071247360 4867
 sys/src/9/pc/vgaark2000pv.c - 664 sys sys 1015014524 3416
@@ -6070,7 +6070,7 @@ sys/src/ape/lib/ap/plan9/link.c - 664 sys sys 1014921984 168
 sys/src/ape/lib/ap/plan9/lseek.c - 664 sys sys 1038237526 358
 sys/src/ape/lib/ap/plan9/malloc.c - 664 sys sys 1014921985 1957
 sys/src/ape/lib/ap/plan9/mkdir.c - 664 sys sys 1014921984 353
-sys/src/ape/lib/ap/plan9/mkfile - 664 sys sys 1070660696 1370
+sys/src/ape/lib/ap/plan9/mkfile - 664 sys sys 1072972153 1385
 sys/src/ape/lib/ap/plan9/nan.c - 664 sys sys 1014921985 614
 sys/src/ape/lib/ap/plan9/open.c - 664 sys sys 1048644335 1088
 sys/src/ape/lib/ap/plan9/opendir.c - 664 sys sys 1014921984 1881
@@ -6791,7 +6791,7 @@ 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/time.c - 664 sys sys 1014926095 1783
-sys/src/cmd/acme/util.c - 664 sys sys 1045546057 6435
+sys/src/cmd/acme/util.c - 664 sys sys 1072972297 6436
 sys/src/cmd/acme/wind.c - 664 sys sys 1016833877 11063
 sys/src/cmd/acme/xfid.c - 664 sys sys 1067723165 19180
 sys/src/cmd/ar.c - 664 sys sys 1046643027 23717
@@ -7493,10 +7493,10 @@ sys/src/cmd/ext2srv/xfssrv.c - 664 sys sys 1055687749 1292
 sys/src/cmd/faces - 20000000775 sys sys 952888246 0
 sys/src/cmd/faces/dblook.c - 664 sys sys 944961084 359
 sys/src/cmd/faces/facedb.c - 664 sys sys 1062460263 9927
-sys/src/cmd/faces/faces.h - 664 sys sys 1045419243 1071
-sys/src/cmd/faces/main.c - 664 sys sys 1048644465 13572
+sys/src/cmd/faces/faces.h - 664 sys sys 1072972232 1115
+sys/src/cmd/faces/main.c - 664 sys sys 1072972232 13637
 sys/src/cmd/faces/mkfile - 664 sys sys 1062460262 355
-sys/src/cmd/faces/plumb.c - 664 sys sys 1045505116 7132
+sys/src/cmd/faces/plumb.c - 664 sys sys 1072972233 7054
 sys/src/cmd/faces/util.c - 664 sys sys 1035698250 569
 sys/src/cmd/factor.c - 664 sys sys 944961351 1348
 sys/src/cmd/fax - 20000000775 sys sys 954036333 0
@@ -10896,6 +10896,9 @@ sys/src/cmd/usb/mkfile - 664 sys sys 1072728986 219
 sys/src/cmd/usb/mouse - 20000000775 sys sys 1017802022 0
 sys/src/cmd/usb/mouse/mkfile - 664 sys sys 1017802022 211
 sys/src/cmd/usb/mouse/usbmouse.c - 664 sys sys 1017802022 3074
+sys/src/cmd/usb/print - 20000000775 sys sys 1073007760 0
+sys/src/cmd/usb/print/mkfile - 664 sys sys 1073007760 197
+sys/src/cmd/usb/print/usbprint - 775 sys sys 1073007760 222
 sys/src/cmd/usb/usbd - 20000000775 sys sys 1017802021 0
 sys/src/cmd/usb/usbd/dat.h - 664 sys sys 1017802021 682
 sys/src/cmd/usb/usbd/device.c - 664 sys sys 1018387004 2955

+ 13 - 0
dist/replica/plan9.log

@@ -13256,3 +13256,16 @@
 1072909862 2 a sys/src/libcomplete - 20000000775 sys sys 1072904881 0
 1072909862 3 a sys/src/libcomplete/complete.c - 664 sys sys 1072904881 2673
 1072909862 4 a sys/src/libcomplete/mkfile - 664 sys sys 1072904881 208
+1072972871 0 c sys/man/1/faces - 664 sys sys 1072972212 2093
+1072972871 1 c sys/src/9/boot/bootip.c - 664 sys sys 1072972133 3418
+1072972871 2 c sys/src/9/mtx/mkfile - 664 sys sys 1072972534 1520
+1072972871 3 c sys/src/9/pc/io.h - 664 sys sys 1072972600 8023
+1072972871 4 c sys/src/9/pc/usbuhci.c - 664 sys sys 1072972271 30738
+1072972871 5 c sys/src/ape/lib/ap/plan9/mkfile - 664 sys sys 1072972153 1385
+1072972871 6 c sys/src/cmd/acme/util.c - 664 sys sys 1072972297 6436
+1072972871 7 c sys/src/cmd/faces/faces.h - 664 sys sys 1072972232 1115
+1072972871 8 c sys/src/cmd/faces/main.c - 664 sys sys 1072972232 13637
+1072972871 9 c sys/src/cmd/faces/plumb.c - 664 sys sys 1072972233 7054
+1073008876 0 a sys/src/cmd/usb/print - 20000000775 sys sys 1073007760 0
+1073008876 1 a sys/src/cmd/usb/print/mkfile - 664 sys sys 1073007760 197
+1073008876 2 a sys/src/cmd/usb/print/usbprint - 775 sys sys 1073007760 222

+ 8 - 5
sys/man/1/faces

@@ -63,7 +63,10 @@ with the
 flag causes
 .B faces
 to read the messages in
-.B /mail/fs/mbox
+.BR /mail/fs/mbox
+— or the mailboxes specified with the
+.B -m
+flag —
 upon startup.
 .PP
 The
@@ -72,11 +75,11 @@ option directs
 .I faces
 to watch for messages arriving in
 .I maildir
-as well as in
+instead of
 .BR /mail/fs/mbox .
-However, only
-.BR /mail/fs/mbox
-is used to load the initial set of faces.
+Multiple
+.B -m
+flags may be used to watch multiple mailboxes.
 .PP
 The
 .B -h

+ 2 - 1
sys/src/9/boot/bootip.c

@@ -29,7 +29,8 @@ configip(int bargc, char **bargv, int needfs)
 	arg = malloc((bargc+1) * sizeof(char*));
 	if(arg == nil)
 		fatal("%r");
-	memmove(arg, bargv, (bargc+1) * sizeof(char*));
+	memmove(arg, bargv, bargc * sizeof(char*));
+	arg[bargc] = 0;
 
 	argc = bargc;
 	argv = arg;

+ 1 - 0
sys/src/9/mtx/mkfile

@@ -19,6 +19,7 @@ PORT=\
 	fault.$O\
 	latin1.$O\
 	log.$O\
+	mul64fract.$O\
 	rebootcmd.$O\
 	page.$O\
 	parse.$O\

+ 1 - 0
sys/src/9/pc/io.h

@@ -10,6 +10,7 @@ enum {
 	Vector2F	= 8,		/* double fault */
 	VectorCSO	= 9,		/* coprocessor segment overrun */
 	VectorPF	= 14,		/* page fault */
+	Vector15 = 15,		/* reserved */
 	VectorCERR	= 16,		/* coprocessor error */
 
 	VectorPIC	= 32,		/* external i8259 interrupts */

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

@@ -797,6 +797,8 @@ epopen(Usbhost *uh, Endpt *e)
 	Ctlr *ctlr;
 
 	ctlr = uh->ctlr;
+	if(e->iso && e->active)
+		error("already open");
 	if(schedendpt(ctlr, e) < 0){
 		if(e->active)
 			error("can't schedule USB endpoint, active");

+ 1 - 0
sys/src/ape/lib/ap/plan9/mkfile

@@ -108,3 +108,4 @@ UPDATE=\
 
 CFLAGS=-c -D_POSIX_SOURCE -D_PLAN9_SOURCE -D_BSD_EXTENSION
 
+$OFILES: lib.h

+ 3 - 3
sys/src/cmd/acme/util.c

@@ -62,11 +62,11 @@ errorwin1(Rune *dir, int ndir, Rune **incl, int nincl)
 	Rune *r;
 	int i, n;
 
-	r = runemalloc(ndir+7);
+	r = runemalloc(ndir+8);
 	if(n = ndir)	/* assign = */
 		runemove(r, dir, ndir);
-	runemove(r+n, L"+Errors", 7);
-	n += 7;
+	runemove(r+n, L"/+Errors", 8);
+	n += 8;
 	w = lookfile(r, n);
 	if(w == nil){
 		if(row.ncol == 0)

+ 18 - 16
sys/src/cmd/faces/faces.h

@@ -41,24 +41,26 @@ struct Facefile
 	Facefile	*next;
 };
 
-char		date[];
-char		*maildir;
+extern char	date[];
+extern char	*maildir;
+extern char	**maildirs;
+extern int	nmaildirs;
 
 Face*	nextface(void);
-void		findbit(Face*);
-void		freeface(Face*);
-void		initplumb(void);
-void		killall(char*);
-void		showmail(Face*);
-void		delete(char*, char*);
-void		freefacefile(Facefile*);
+void	findbit(Face*);
+void	freeface(Face*);
+void	initplumb(void);
+void	killall(char*);
+void	showmail(Face*);
+void	delete(char*, char*);
+void	freefacefile(Facefile*);
 Face*	dirface(char*, char*);
-void		resized(void);
-int		alreadyseen(char*);
+void	resized(void);
+int	alreadyseen(char*);
 ulong	dirlen(char*);
 
-void		*emalloc(ulong);
-void		*erealloc(void*, ulong);
-char		*estrdup(char*);
-char		*findfile(Face*, char*, char*);
-void		addmaildir(char*);
+void	*emalloc(ulong);
+void	*erealloc(void*, ulong);
+char	*estrdup(char*);
+char	*findfile(Face*, char*, char*);
+void	addmaildir(char*);

+ 20 - 15
sys/src/cmd/faces/main.c

@@ -55,20 +55,20 @@ uchar rightdata[] = {
 
 Image	*blue;		/* full arrow */
 Image	*bgrnd;		/* pale blue background color */
-Image	*left;			/* left-pointing arrow mask */
+Image	*left;		/* left-pointing arrow mask */
 Image	*right;		/* right-pointing arrow mask */
-Font		*tinyfont;
-Font		*mediumfont;
-Font		*datefont;
-int		first, last;		/* first and last visible face; last is first invisible */
-int		nfaces;
-int		mousefd;
-int		nacross;
-int		ndown;
-
-char		date[64];
-Face		**faces;
-char		*maildir = "/mail/fs/mbox";
+Font	*tinyfont;
+Font	*mediumfont;
+Font	*datefont;
+int	first, last;	/* first and last visible face; last is first invisible */
+int	nfaces;
+int	mousefd;
+int	nacross;
+int	ndown;
+
+char	date[64];
+Face	**faces;
+char	*maildir = "/mail/fs/mbox";
 ulong	now;
 
 Point	datep = { 8, 6 };
@@ -89,7 +89,6 @@ setdate(void)
 void
 init(void)
 {
-	addmaildir(maildir);
 	mousefd = open("/dev/mouse", OREAD);
 	if(mousefd < 0){
 		fprint(2, "faces: can't open mouse: %r\n");
@@ -682,6 +681,8 @@ usage(void)
 void
 main(int argc, char *argv[])
 {
+	int i;
+
 	ARGBEGIN{
 	case 'h':
 		history++;
@@ -691,6 +692,7 @@ main(int argc, char *argv[])
 		break;
 	case 'm':
 		addmaildir(EARGF(usage()));
+		maildir = nil;
 		break;
 	default:
 		usage();
@@ -700,6 +702,8 @@ main(int argc, char *argv[])
 		fprint(2, "faces: initdraw failed: %r\n");
 		exits("initdraw");
 	}
+	if(maildir)
+		addmaildir(maildir);
 	init();
 	unlockdisplay(display);	/* initdraw leaves it locked */
 	display->locking = 1;	/* tell library we're using the display lock */
@@ -710,7 +714,8 @@ main(int argc, char *argv[])
 	startproc(timeproc, Timep);
 	startproc(mouseproc, Mousep);
 	if(initload)
-		loadmboxfaces(maildir);
+		for(i = 0; i < nmaildirs; i++)
+		 loadmboxfaces(maildirs[i]);
 	faceproc();
 	fprint(2, "faces: %s process exits\n", procnames[Mainp]);
 	killall(nil);

+ 6 - 11
sys/src/cmd/faces/plumb.c

@@ -11,8 +11,9 @@ static int		seefd = -1;
 static int		logfd = -1;
 static char	*user;
 static char	*logtag;
-static char	**maildirs;
-static int		nmaildirs;
+
+char		**maildirs;
+int		nmaildirs;
 
 void
 initplumb(void)
@@ -273,17 +274,11 @@ nextface(void)
 			if(m == nil)
 				killall("error on seemail plumb port");
 			t = value(m->attr, "mailtype", "");
-			if(strcmp(t, "delete") == 0){
+			if(strcmp(t, "delete") == 0)
 				delete(m->data, value(m->attr, "digest", nil));
-				plumbfree(m);
-				continue;
-			}
-			if(strcmp(t, "new") != 0){
+			else if(strcmp(t, "new") != 0)
 				fprint(2, "faces: unknown plumb message type %s\n", t);
-				plumbfree(m);
-				continue;
-			}
-			for(i=0; i<nmaildirs; i++)
+			else for(i=0; i<nmaildirs; i++)
 				if(strncmp(m->data, maildirs[i], strlen(maildirs[i])) == 0)
 					goto Found;
 			plumbfree(m);

+ 12 - 0
sys/src/cmd/usb/print/mkfile

@@ -0,0 +1,12 @@
+</386/mkfile
+
+BIN=/$objtype/bin/usb
+
+none:VQ:
+	echo mk all, install, installall, clean, or nuke
+
+install installall safeinstall:VQ:
+	cp usbprint $bin
+
+all safeinstall clean nuke:VQ:
+	echo usbprint

+ 13 - 0
sys/src/cmd/usb/print/usbprint

@@ -0,0 +1,13 @@
+#!/bin/rc
+
+if (! test -e /dev/usb)
+	bind -b '#U' /dev
+
+for(i in /dev/usb?/[0-9]*){
+	if (grep -s 'Enabled 0x020107' $i/status){
+		echo -n 'ep 2 bulk w 64 32' >$i/ctl
+		bind $i/ep2data /n/lp
+		exit ''
+	}
+}
+exit 'no printer'