Browse Source

Plan 9 from Bell Labs 2005-03-29

David du Colombier 19 years ago
parent
commit
69cdfe6c20

+ 1 - 1
rc/bin/srvssh

@@ -32,7 +32,7 @@
 rfork e
 
 fn usage {
-	echo 'usage: srvssh [-R] [-r] [-s] [-u u9fspath] [srvname [mtpt]]' >[1=2]
+	echo 'usage: srvssh [-R] [-r] [-s] [-u u9fspath] system [srvname [mtpt]]' >[1=2]
 	exit usage
 }
 

+ 1 - 0
sys/lib/dist/pc/proto

@@ -74,6 +74,7 @@
 # if cpu goes, exportfs could go
 #		exportfs	555 sys sys
 		ext2srv	555 sys sys
+		fcp 555 sys sys
 		grep	555 sys sys
 		hget	555 sys sys
 		hoc	555 sys sys

+ 7 - 7
sys/lib/tmac/tmac.cs

@@ -56,7 +56,7 @@
 '''\" initialization
 '''\"
 '''\"		get ms if not loaded
-.if !\n(PS .so /usr/lib/tmac/tmac.s
+.if !\n(PS .so /sys/lib/tmac/tmac.s
 .	\" to foil ms
 .if !'\*(d)'' \{\
 .	tm You're trying to load the coversheet macros twice - havoc will result
@@ -251,7 +251,7 @@
 .di
 .ft
 .sy echo \\$2 >/tmp/tt\\n($$
-.sy sed -f /usr/lib/tmac/name.sed /tmp/tt\\n($$ >/tmp/tx\\n($$
+.sy sed -f /sys/lib/tmac/name.sed /tmp/tt\\n($$ >/tmp/tx\\n($$
 .so /tmp/tx\\n($$
 .sy rm /tmp/tx\\n($$ /tmp/tt\\n($$
 .if \\$1<2 .ds T1 \\*(T1-gre
@@ -484,8 +484,8 @@
 .ie \\ne>0 \{\
 .	da ZC				\" ZC = mm(cA)
 .	ds y( \\$1
-.	ie '\\$1'y' .so /usr/lib/tmac/complet.1127
-.	el .if  !'\\$1'' .so /usr/lib/tmac/complet.\\*(y(
+.	ie '\\$1'y' .so /sys/lib/tmac/complet.1127
+.	el .if  !'\\$1'' .so /sys/lib/tmac/complet.\\*(y(
 .	dt \\ne OC \}
 .el .da ZC
 ..
@@ -511,8 +511,8 @@
 .ie \\nh>0 \{\
 .	da ZS				\" ZS = mm(dA)
 .	ds y( \\$1
-.	ie '\\$1'y' .so /usr/lib/tmac/cover.1127
-.	el .if !'\\$1'' .so /usr/lib/tmac/cover.\\*(y(
+.	ie '\\$1'y' .so /sys/lib/tmac/cover.1127
+.	el .if !'\\$1'' .so /sys/lib/tmac/cover.\\*(y(
 .	dt \\nh OV \}
 .el .da ZD
 ..
@@ -1056,7 +1056,7 @@ Internal Technical Document Service
 .nr MG \\n(wp
 .nr NA \\nu
 .if '\\n(ST'1' \{\
-'''.so /usr/lib/tmac/tmac.rscover XXX
+'''.so /sys/lib/tmac/tmac.rscover XXX
 .so \*(.P/lib/tmac/tmac.rscover
 . \" a line for troff to eat
 .S1 \}

+ 21 - 12
sys/man/4/usb

@@ -2,12 +2,15 @@
 .SH NAME
 usbmouse,
 usbaudio,
-usbprint
+usbprinter
 \- Universal Serial Bus user level device drivers
 .SH SYNOPSIS
 .B usb/usbmouse
 [
-.B -f
+.B -fsv
+] [
+.B -a
+.I accel
 ] [
 .I ctrlno
 .I n
@@ -30,7 +33,7 @@ usbprint
 .I n
 ]
 .PP
-.B usb/usbprint
+.B usb/usbprinter
 .SH DESCRIPTION
 These programs implement support for specific USB device classes.
 They should be run after
@@ -41,18 +44,24 @@ Dynamic handling of device insertion and removal is currently not supported.
 .SS Mice
 .B Usbmouse
 sends mouse events from a USB mouse to
-.B #m/mousein
+.B /dev/mousein
 where the Plan 9 kernel processes them like other mice.
 .PP
 Without arguments, it scans the USB status files to find a mouse
 and uses the first one it finds.  A pair of numeric arguments overrides this search
-with a specific USB controller and device.
-.PP
-The
-.B -f
-flag runs
-.B usbmouse
-in the foreground.
+with a specific USB controller and device.  The options are
+.TP
+.BI -f
+Run usbmouse in foreground.
+.TP
+.BI -s
+Use the scrollwheel.
+.TP
+.BI -v
+Verbose mode.
+.TP
+.BI -a " accel"
+Accelerate mouse movements.
 .SS Audio devices
 .B Usbaudio
 configures and manages a usb audio device.  It implements a file system,
@@ -139,7 +148,7 @@ 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 Usbprint
+.B Usbprinter
 is a script that mounts a usb printer on
 .BR /dev/lp .
 .SH EXAMPLE

+ 15 - 0
sys/src/cmd/file.c

@@ -159,6 +159,7 @@ int	isrtf(void);
 int	ismsdos(void);
 int	iself(void);
 int	istring(void);
+int	iff(void);
 int	long0(void);
 int	istar(void);
 int	p9bitnum(uchar*);
@@ -172,6 +173,7 @@ int	(*call[])(void) =
 {
 	long0,		/* recognizable by first 4 bytes */
 	istring,	/* recognizable by first string */
+	iff,		/* interchange file format (strings) */
 	isrfc822,	/* email file */
 	ismbox,		/* mail box */
 	istar,		/* recognizable by tar checksum */
@@ -521,6 +523,7 @@ Filemagic long0tab[] = {
 	0x04034B50,	0xFFFFFFFF,	"zip archive\n", "application/zip",
 	070707,		0xFFFF,		"cpio archive\n", OCTET,
 	0x2F7,		0xFFFF,		"tex dvi\n", "application/dvi",
+	0xfffa0000,	0xfffe0000,	"mp3 audio",	"audio/mpeg",
 };
 
 int
@@ -657,6 +660,7 @@ struct	FILE_STRING
 	"\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1",	"microsoft office document",	8,	"application/octet-stream",
 	"<MakerFile ",		"FrameMaker file",		11,	"application/framemaker",
 	"\033%-12345X",	"HPJCL file",		9,	"application/hpjcl",
+	"ID3",			"mp3 audio with id3",	3,	"audio/mpeg",
 	0,0,0,0
 };
 
@@ -688,6 +692,17 @@ istring(void)
 	return 0;
 }
 
+int
+iff(void)
+{
+	if (strncmp((char*)buf, "FORM", 4) == 0 &&
+	    strncmp((char*)buf+8, "AIFF", 4) == 0) {
+		print("%s\n", mime? "audio/x-aiff": "aiff audio");
+		return 1;
+	}
+	return 0;
+}
+
 char*	html_string[] =
 {
 	"title",

+ 5 - 5
sys/src/cmd/usb/audio/usbaudio.c

@@ -240,7 +240,7 @@ findendpoints(void)
 void
 usage(void)
 {
-	fprint(2, "usage: usbaudio [-V] [-v volume[%%]] [-m mountpoint] [-s srvname] [ctrlno id]\n");
+	fprint(2, "usage: usbaudio [-V] [-v volume] [-m mountpoint] [-s srvname] [ctrlno n]\n");
 	threadexitsall("usage");
 }
 
@@ -266,20 +266,20 @@ threadmain(int argc, char **argv)
 		verbose++;
 		break;
 	case 'd':
-		debug = strtol(ARGF(), nil, 0);
+		debug = strtol(EARGF(usage()), nil, 0);
 		if (debug == -1) debugdebug++;
 		verbose++;
 		break;
 	case 'v':
-		volume[0] = strtol(ARGF(), &p, 0);
+		volume[0] = strtol(EARGF(usage()), &p, 0);
 		for(i = 1; i < 8; i++)
 			volume[i] = volume[0];
 		break;
 	case 'm':
-		mntpt = ARGF();
+		mntpt = EARGF(usage());
 		break;
 	case 's':
-		srvpost = ARGF();
+		srvpost = EARGF(usage());
 		break;
 	default:
 		usage();

+ 6 - 6
sys/src/cmd/usb/misc/usbmouse.c

@@ -6,10 +6,10 @@
 int mousefd, ctlfd, mousein;
 
 char hbm[]		= "Enabled 0x020103\n";
-char *mouseinfile	= "#m/mousein";
-char *statfmt		= "#U/usb%d/%d/status";
-char *ctlfmt		= "#U/usb%d/%d/ctl";
-char *msefmt		= "#U/usb%d/%d/ep1data";
+char *mouseinfile	= "/dev/mousein";
+char *statfmt		= "/dev/usb%d/%d/status";
+char *ctlfmt		= "/dev/usb%d/%d/ctl";
+char *msefmt		= "/dev/usb%d/%d/ep1data";
 char *ctl3str		= "ep 1 bulk r 3 32";
 char *ctl5str		= "ep 1 bulk r 5 32";
 char ctlfile[32];
@@ -80,7 +80,7 @@ char maptab[] = {
 void
 usage(void)
 {
-	fprint(2, "usage: %s [-vf] [-a accel] [ctlrno usbport]\n", argv0);
+	fprint(2, "usage: %s [-fsv] [-a accel] [ctlrno usbport]\n", argv0);
 	threadexitsall("usage");
 }
 
@@ -102,7 +102,7 @@ threadmain(int argc, char *argv[])
 		nofork=1;
 		break;
 	case 'a':
-		accel=strtol(ARGF(), nil, 0);
+		accel=strtol(EARGF(usage()), nil, 0);
 		break;
 	default:
 		usage();