Browse Source

Plan 9 from Bell Labs 2006-11-22

David du Colombier 17 years ago
parent
commit
79e1cfc6eb

+ 8 - 8
dist/replica/_plan9.db

@@ -189,7 +189,7 @@
 386/bin/con - 775 sys sys 1148500616 78580
 386/bin/cp - 775 sys sys 1148500616 63548
 386/bin/cpp - 775 sys sys 1148500616 150553
-386/bin/cpu - 775 sys sys 1148500617 139556
+386/bin/cpu - 775 sys sys 1164140641 139578
 386/bin/crop - 775 sys sys 1150062735 116468
 386/bin/date - 775 sys sys 1148500618 43311
 386/bin/db - 775 sys sys 1148500619 346069
@@ -224,7 +224,7 @@
 386/bin/ed - 775 sys sys 1148500629 93366
 386/bin/eqn - 775 sys sys 1141927235 244405
 386/bin/execnet - 775 sys sys 1160622239 178310
-386/bin/exportfs - 775 sys sys 1148500630 162644
+386/bin/exportfs - 775 sys sys 1164140642 162644
 386/bin/ext2srv - 775 sys sys 1160622240 180000
 386/bin/faces - 775 sys sys 1155491750 194710
 386/bin/factor - 775 sys sys 1148500632 61793
@@ -7595,7 +7595,7 @@ sys/man/3/srv - 664 sys sys 958419690 1470
 sys/man/3/ssl - 664 sys sys 1018386776 3413
 sys/man/3/tls - 664 sys sys 1045501496 7018
 sys/man/3/uart - 664 sys sys 1138191356 2003
-sys/man/3/usb - 664 sys sys 1143567502 6941
+sys/man/3/usb - 664 sys sys 1164149393 6960
 sys/man/3/vga - 664 sys sys 1131301005 4957
 sys/man/4 - 20000000775 sys sys 1018581459 0
 sys/man/4/0intro - 664 sys sys 944959699 472
@@ -7637,8 +7637,8 @@ sys/man/4/tapefs - 664 sys sys 1140965924 1861
 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 1127204688 4546
-sys/man/4/usbd - 664 sys sys 1018386778 731
+sys/man/4/usb - 664 sys sys 1164149417 4643
+sys/man/4/usbd - 664 sys sys 1164149441 712
 sys/man/4/vacfs - 664 sys sys 1084333062 1545
 sys/man/4/webcookies - 664 sys sys 1019828742 3525
 sys/man/4/webfs - 664 sys sys 1124711926 6518
@@ -9921,7 +9921,7 @@ sys/src/cmd/cpp/mkfile - 664 sys sys 944960879 178
 sys/src/cmd/cpp/nlist.c - 664 sys sys 1116770041 4645
 sys/src/cmd/cpp/test.c - 664 sys sys 944960879 47
 sys/src/cmd/cpp/tokens.c - 664 sys sys 944960879 6755
-sys/src/cmd/cpu.c - 664 sys sys 1143695295 21126
+sys/src/cmd/cpu.c - 664 sys sys 1164133664 21154
 sys/src/cmd/crop.c - 664 sys sys 1134557476 4137
 sys/src/cmd/date.c - 664 sys sys 944961351 449
 sys/src/cmd/db - 20000000775 sys sys 988249965 0
@@ -10116,7 +10116,7 @@ sys/src/cmd/execnet/main.c - 664 sys sys 1019861330 657
 sys/src/cmd/execnet/mkfile - 664 sys sys 1032059543 208
 sys/src/cmd/execnet/note.c - 664 sys sys 1019855740 2315
 sys/src/cmd/exportfs - 20000000775 sys sys 988249971 0
-sys/src/cmd/exportfs/exportfs.c - 664 sys sys 1145964192 16377
+sys/src/cmd/exportfs/exportfs.c - 664 sys sys 1164133573 16377
 sys/src/cmd/exportfs/exportfs.h - 664 sys sys 1135487971 2809
 sys/src/cmd/exportfs/exportsrv.c - 664 sys sys 1135488028 11946
 sys/src/cmd/exportfs/mkfile - 664 sys sys 1066825703 194
@@ -14113,7 +14113,7 @@ sys/src/cmd/usb/lib/util.c - 664 sys sys 1091204978 523
 sys/src/cmd/usb/misc - 20000000775 sys sys 1091205037 0
 sys/src/cmd/usb/misc/mkfile - 664 sys sys 1091205037 274
 sys/src/cmd/usb/misc/usbmouse.c - 664 sys sys 1163722035 3603
-sys/src/cmd/usb/misc/usbprint - 775 sys sys 1101830683 256
+sys/src/cmd/usb/misc/usbprint - 775 sys sys 1164149479 270
 sys/src/cmd/usb/mkfile - 664 sys sys 1091327562 354
 sys/src/cmd/usb/mouse - 20000000775 sys sys 1017802022 0
 sys/src/cmd/usb/printer - 20000000775 sys sys 1073007760 0

+ 8 - 8
dist/replica/plan9.db

@@ -189,7 +189,7 @@
 386/bin/con - 775 sys sys 1148500616 78580
 386/bin/cp - 775 sys sys 1148500616 63548
 386/bin/cpp - 775 sys sys 1148500616 150553
-386/bin/cpu - 775 sys sys 1148500617 139556
+386/bin/cpu - 775 sys sys 1164140641 139578
 386/bin/crop - 775 sys sys 1150062735 116468
 386/bin/date - 775 sys sys 1148500618 43311
 386/bin/db - 775 sys sys 1148500619 346069
@@ -224,7 +224,7 @@
 386/bin/ed - 775 sys sys 1148500629 93366
 386/bin/eqn - 775 sys sys 1141927235 244405
 386/bin/execnet - 775 sys sys 1160622239 178310
-386/bin/exportfs - 775 sys sys 1148500630 162644
+386/bin/exportfs - 775 sys sys 1164140642 162644
 386/bin/ext2srv - 775 sys sys 1160622240 180000
 386/bin/faces - 775 sys sys 1155491750 194710
 386/bin/factor - 775 sys sys 1148500632 61793
@@ -7595,7 +7595,7 @@ sys/man/3/srv - 664 sys sys 958419690 1470
 sys/man/3/ssl - 664 sys sys 1018386776 3413
 sys/man/3/tls - 664 sys sys 1045501496 7018
 sys/man/3/uart - 664 sys sys 1138191356 2003
-sys/man/3/usb - 664 sys sys 1143567502 6941
+sys/man/3/usb - 664 sys sys 1164149393 6960
 sys/man/3/vga - 664 sys sys 1131301005 4957
 sys/man/4 - 20000000775 sys sys 1018581459 0
 sys/man/4/0intro - 664 sys sys 944959699 472
@@ -7637,8 +7637,8 @@ sys/man/4/tapefs - 664 sys sys 1140965924 1861
 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 1127204688 4546
-sys/man/4/usbd - 664 sys sys 1018386778 731
+sys/man/4/usb - 664 sys sys 1164149417 4643
+sys/man/4/usbd - 664 sys sys 1164149441 712
 sys/man/4/vacfs - 664 sys sys 1084333062 1545
 sys/man/4/webcookies - 664 sys sys 1019828742 3525
 sys/man/4/webfs - 664 sys sys 1124711926 6518
@@ -9921,7 +9921,7 @@ sys/src/cmd/cpp/mkfile - 664 sys sys 944960879 178
 sys/src/cmd/cpp/nlist.c - 664 sys sys 1116770041 4645
 sys/src/cmd/cpp/test.c - 664 sys sys 944960879 47
 sys/src/cmd/cpp/tokens.c - 664 sys sys 944960879 6755
-sys/src/cmd/cpu.c - 664 sys sys 1143695295 21126
+sys/src/cmd/cpu.c - 664 sys sys 1164133664 21154
 sys/src/cmd/crop.c - 664 sys sys 1134557476 4137
 sys/src/cmd/date.c - 664 sys sys 944961351 449
 sys/src/cmd/db - 20000000775 sys sys 988249965 0
@@ -10116,7 +10116,7 @@ sys/src/cmd/execnet/main.c - 664 sys sys 1019861330 657
 sys/src/cmd/execnet/mkfile - 664 sys sys 1032059543 208
 sys/src/cmd/execnet/note.c - 664 sys sys 1019855740 2315
 sys/src/cmd/exportfs - 20000000775 sys sys 988249971 0
-sys/src/cmd/exportfs/exportfs.c - 664 sys sys 1145964192 16377
+sys/src/cmd/exportfs/exportfs.c - 664 sys sys 1164133573 16377
 sys/src/cmd/exportfs/exportfs.h - 664 sys sys 1135487971 2809
 sys/src/cmd/exportfs/exportsrv.c - 664 sys sys 1135488028 11946
 sys/src/cmd/exportfs/mkfile - 664 sys sys 1066825703 194
@@ -14113,7 +14113,7 @@ sys/src/cmd/usb/lib/util.c - 664 sys sys 1091204978 523
 sys/src/cmd/usb/misc - 20000000775 sys sys 1091205037 0
 sys/src/cmd/usb/misc/mkfile - 664 sys sys 1091205037 274
 sys/src/cmd/usb/misc/usbmouse.c - 664 sys sys 1163722035 3603
-sys/src/cmd/usb/misc/usbprint - 775 sys sys 1101830683 256
+sys/src/cmd/usb/misc/usbprint - 775 sys sys 1164149479 270
 sys/src/cmd/usb/mkfile - 664 sys sys 1091327562 354
 sys/src/cmd/usb/mouse - 20000000775 sys sys 1017802022 0
 sys/src/cmd/usb/printer - 20000000775 sys sys 1073007760 0

+ 8 - 0
dist/replica/plan9.log

@@ -31739,3 +31739,11 @@
 1163723406 1 c sys/src/cmd/usb/lib/usb.h - 664 sys sys 1163721974 7129
 1163723406 2 c sys/src/cmd/usb/misc/usbmouse.c - 664 sys sys 1163722035 3603
 1163781005 0 c sys/games/lib/fortunes - 664 sys sys 1163780348 261886
+1164133806 0 c sys/src/cmd/exportfs/exportfs.c - 664 sys sys 1164133573 16377
+1164133806 1 c sys/src/cmd/cpu.c - 664 sys sys 1164133664 21154
+1164141005 0 c 386/bin/cpu - 775 sys sys 1164140641 139578
+1164141005 1 c 386/bin/exportfs - 775 sys sys 1164140642 162644
+1164150006 0 c sys/man/3/usb - 664 sys sys 1164149393 6960
+1164150006 1 c sys/man/4/usb - 664 sys sys 1164149417 4643
+1164150006 2 c sys/man/4/usbd - 664 sys sys 1164149441 712
+1164150006 3 c sys/src/cmd/usb/misc/usbprint - 775 sys sys 1164149479 270

+ 8 - 10
sys/man/3/usb

@@ -4,7 +4,8 @@ usb \- USB Host Controller Interface
 .SH SYNOPSIS
 .nf
 .B bind -a #U /dev
-
+.PP
+.nf
 .BI /dev/usb m
 .BI /dev/usb m /new
 .BI /dev/usb m /port
@@ -14,7 +15,6 @@ usb \- USB Host Controller Interface
 .BI /dev/usb m / n /setup
 .BI /dev/usb m / n /ep k\fLdata
 \&...
-
 .fi
 .SH DESCRIPTION
 The Universal Serial Bus is a popular bus for connecting slow and medium speed
@@ -51,7 +51,7 @@ interfaces.
 To find a mouse, for example, scan the status files for the line beginning with
 .IP
 .EX
-.BR "Enabled 0x020103"
+.B "Enabled 0x020103"
 .EE
 .PP
 A mouse belongs to class 3 (in the least significant byte),
@@ -90,14 +90,14 @@ By sending an `endpoint message' to the
 .I ctl
 file, new driver endpoints can be created.  The syntax of these messages
 is
-.PP
+.IP
 .B ep
 .I n
 .B bulk
 .I "mode maxpkt nbuf
 .PP
 or
-.PP
+.IP
 .B ep
 .I "n period mode samplesize hz
 .PP
@@ -162,7 +162,7 @@ can be used to start the I/O at a specific time.
 The usb status file provides information that can be used to map file
 offsets to points in time:  For each endpoint, the status file produces a line
 of the form:
-.PP
+.IP
 .B "4 0x000201 \f2nnn\fP bytes \f2nnn\fP blocks
 .PP
 The fields are, from left to right,
@@ -171,7 +171,7 @@ least significant byte), number of bytes read/written, number of blocks read/wri
 .PP
 For isochronous devices only, an additional line is produced of the
 form:
-.PP
+.IP
 .B "bufsize \f2s\fP buffered \f2b\fP offset \f2o\fP time \f2t\fP
 .PP
 .I S
@@ -198,7 +198,6 @@ The number of bytes buffered can also be obtained using
 .IR stat (2)
 on the endpoint file.  See also
 .IR audio (3).
-.sp
 .SH FILES
 .TF "#U/usb n /*/status"
 .TP
@@ -232,13 +231,12 @@ configuration.
 .B /sys/src/9/pc/devusb.c
 .br
 .B /sys/src/9/pc/usbuhci.c
-.br
 .SH "SEE ALSO"
 .IR usb (4),
 .IR usbd (4),
 .IR plan9.ini (8)
 .SH BUGS
-OpenHCI USB cards are not yet supported.
+OpenHCI (OHCI) and EHCI USB controllers are not yet supported.
 .PP
 The interface for configuring endpoints is at variance with the standard.
 .PP

+ 10 - 5
sys/man/4/usb

@@ -42,7 +42,7 @@ 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.
 .SS Mice
-.B Usbmouse
+.I Usbmouse
 sends mouse events from a USB mouse to
 .B /dev/mousein
 where the Plan 9 kernel processes them like other mice.
@@ -63,7 +63,7 @@ Verbose mode.
 .BI -a " accel"
 Accelerate mouse movements.
 .SS Audio devices
-.B Usbaudio
+.I Usbaudio
 configures and manages a usb audio device.  It implements a file system,
 normally mounted in
 .BI /dev ,
@@ -98,7 +98,7 @@ yields the device's settings.  The data format of
 .B volume
 is compatible with the soundblaster and
 produces something like
-.PP
+.IP
 .EX
 audio out 65
 treb out 0
@@ -148,14 +148,14 @@ 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
+.I Usbprinter
 is a script that mounts a usb printer on
 .BR /dev/lp .
 .SH EXAMPLE
 .LP
 To use a USB mouse and audio device, put the following in your profile
 (replace x by your favorite initial volume setting):
-.PP
+.IP
 .EX
 .ta 6n
 if (test -r '#U'/usb0) {
@@ -177,6 +177,7 @@ in your profile.
 .SH BUGS
 Usbaudio only works for certain audio devices.  This is the list of devices known to work with usbaudio:
 .IP
+.RS
 .TP
 Xitel AN1
 Output only.  Marginally enough to drive headphones.  Has mute, volume, bass, treble controls.
@@ -201,3 +202,7 @@ to the output, so does nothing.
 Onkyo WAVIO series MA-500U
 Includes three optical digital interfaces, two analog, and an
 amplifier (15W + 15W).
+.TP
+Turtle Beach Audio Advantage micro
+Headset and S/Pdif out, volume and mute controls.
+.RE

+ 5 - 10
sys/man/4/usbd

@@ -4,9 +4,7 @@ usbd \- Universal Serial Bus daemon
 .SH SYNOPSIS
 .B usbd
 [
-.B -v
-] [
-.B -d
+.B -dv
 ]
 .SH DESCRIPTION
 .I Usbd
@@ -18,16 +16,13 @@ by configuring devices when they are plugged in or turned on and
 unconfiguring them when they are pulled out or switched off.
 .PP
 .B Usbd
-recognizes the following flags:
-.I 
-.TP
-.B v
-Verbose; print configuration information and device status as they change.
+recognizes the following options:
 .TP
 .B d
 Debug; print the bytes in each message sent or received.
-.LP
-.sp
+.TP
+.B v
+Verbose; print configuration information and device status as they change.
 .SH SOURCE
 .B /sys/src/cmd/usb/usbd
 .SH "SEE ALSO"

+ 5 - 4
sys/src/cmd/cpu.c

@@ -74,15 +74,13 @@ usage(void)
 	fprint(2, "usage: cpu [-h system] [-u user] [-a authmethod] [-e 'crypt hash'] [-k keypattern] [-P patternfile] [-c cmd args ...]\n");
 	exits("usage");
 }
-int fdd;
 
 void
 main(int argc, char **argv)
 {
 	char dat[MaxStr], buf[MaxStr], cmd[MaxStr], *p, *err;
-	int fd, ms, data;
+	int ac, fd, ms, data;
 	char *av[10];
-	int ac;
 
 	/* see if we should use a larger message size */
 	fd = open("/dev/draw", OREAD);
@@ -186,16 +184,19 @@ main(int argc, char **argv)
 	close(0);
 	dup(data, 0);
 	close(data);
+
 	sprint(buf, "%d", msgsize);
 	ac = 0;
+	av[ac++] = exportfs;
 	av[ac++] = "-m";
+	av[ac++] = buf;
 	if(dbg)
 		av[ac++] = "-d";
 	if(patternfile != nil){
 		av[ac++] = "-P";
 		av[ac++] = patternfile;
 	}
-	av[ac] = 0;
+	av[ac] = nil;
 	exec(exportfs, av);
 	fatal(1, "starting exportfs");
 }

+ 24 - 24
sys/src/cmd/exportfs/exportfs.c

@@ -88,8 +88,8 @@ main(int argc, char **argv)
 		doauth = 1;
 		break;
 
-	case 'k':
-		keyspec = EARGF(usage());
+	case 'd':
+		dbg++;
 		break;
 
 	case 'e':
@@ -98,22 +98,12 @@ main(int argc, char **argv)
 			ealgs = nil;
 		break;
 
-	case 'S':
-		if(srvfdfile)
-			usage();
-		srvfdfile = EARGF(usage());
-		break;
-
-	case 'd':
-		dbg++;
-		break;
-
 	case 'f':
 		dbfile = EARGF(usage());
 		break;
 
-	case 'F':
-		/* accepted but ignored, for backwards compatibility */
+	case 'k':
+		keyspec = EARGF(usage());
 		break;
 
 	case 'm':
@@ -124,10 +114,6 @@ main(int argc, char **argv)
 		nonone = 0;
 		break;
 
-	case 'N':
-		nsfile = EARGF(usage());
-		break;
-
 	case 'r':
 		srv = EARGF(usage());
 		break;
@@ -136,20 +122,34 @@ main(int argc, char **argv)
 		srv = "/";
 		break;
 
-	case 'P':
-		patternfile = EARGF(usage());
-		break;
-
 	case 'A':
 		anstring = EARGF(usage());
 		break;
 
+	case 'B':
+		na = EARGF(usage());
+		break;
+
+	case 'F':
+		/* accepted but ignored, for backwards compatibility */
+		break;
+
+	case 'N':
+		nsfile = EARGF(usage());
+		break;
+
+	case 'P':
+		patternfile = EARGF(usage());
+		break;
+
 	case 'R':
 		readonly = 1;
 		break;
 
-	case 'B':
-		na = EARGF(usage());
+	case 'S':
+		if(srvfdfile)
+			usage();
+		srvfdfile = EARGF(usage());
 		break;
 
 	default:

+ 1 - 1
sys/src/cmd/usb/misc/usbprint

@@ -2,7 +2,7 @@
 
 for(c in `{seq 16}){
 	for(i in `{seq 20}){
-		if (grep -s 'Enabled 0x020107' '#U'/usb$c/$i/status){
+		if (grep -s 'Enabled 0x020107' '#U'/usb$c/$i/status >[2]/dev/null){
 			echo -n 'ep 2 bulk w 64 32' >'#U'/usb$c/$i/ctl
 			aux/stub /dev/lp
 			bind '#U'/usb$c/$i/ep2data /dev/lp