Browse Source

Plan 9 from Bell Labs 2008-04-19

David du Colombier 13 years ago
parent
commit
9895783b3f

+ 17 - 18
dist/replica/_plan9.db

@@ -293,7 +293,7 @@
 386/bin/ip - 20000000775 sys sys 1016920851 0
 386/bin/ip/6in4 - 775 sys sys 1204292492 93318
 386/bin/ip/dhcpclient - 775 sys sys 1178568281 92992
-386/bin/ip/dhcpd - 775 sys sys 1207453634 152879
+386/bin/ip/dhcpd - 775 sys sys 1208546545 152990
 386/bin/ip/dhcpleases - 775 sys sys 1204292497 86370
 386/bin/ip/ftpd - 775 sys sys 1208230201 172192
 386/bin/ip/gping - 775 sys sys 1198211707 182214
@@ -309,19 +309,19 @@
 386/bin/ip/httpd/wikipost - 775 sys sys 1191273662 114183
 386/bin/ip/httpfile - 775 sys sys 1206478945 285640
 386/bin/ip/imap4d - 775 sys sys 1188447250 236867
-386/bin/ip/ipconfig - 775 sys sys 1204750828 161835
+386/bin/ip/ipconfig - 775 sys sys 1208546548 161946
 386/bin/ip/linklocal - 775 sys sys 1204292504 46800
 386/bin/ip/ping - 775 sys sys 1204292506 94531
 386/bin/ip/ppp - 775 sys sys 1204292510 221800
 386/bin/ip/pppoe - 775 sys sys 1168402326 77787
 386/bin/ip/pptp - 775 sys sys 1204292512 128355
 386/bin/ip/pptpd - 775 sys sys 1204292514 126067
-386/bin/ip/rarpd - 775 sys sys 1204292516 112649
+386/bin/ip/rarpd - 775 sys sys 1208546550 112756
 386/bin/ip/rexexec - 775 sys sys 1179372096 90284
 386/bin/ip/rip - 775 sys sys 1204292518 91302
 386/bin/ip/rlogind - 775 sys sys 1178568290 66192
 386/bin/ip/telnetd - 775 sys sys 1196742496 121995
-386/bin/ip/tftpd - 775 sys sys 1204292520 131963
+386/bin/ip/tftpd - 775 sys sys 1208546553 132074
 386/bin/ip/traceroute - 775 sys sys 1198211710 72783
 386/bin/ip/udpecho - 775 sys sys 1178508500 43095
 386/bin/ip/wol - 775 sys sys 1205983484 47866
@@ -347,13 +347,13 @@
 386/bin/mug - 775 sys sys 1197732786 176443
 386/bin/mv - 775 sys sys 1168402336 66629
 386/bin/ndb - 20000000775 sys sys 985743147 0
-386/bin/ndb/cs - 775 sys sys 1204292523 151621
+386/bin/ndb/cs - 775 sys sys 1208546555 151732
 386/bin/ndb/csquery - 775 sys sys 1176488418 61652
-386/bin/ndb/dns - 775 sys sys 1204292529 298693
-386/bin/ndb/dnsdebug - 775 sys sys 1204292533 272512
+386/bin/ndb/dns - 775 sys sys 1208546561 298804
+386/bin/ndb/dnsdebug - 775 sys sys 1208546565 272623
 386/bin/ndb/dnsquery - 775 sys sys 1185334136 64350
-386/bin/ndb/dnstcp - 775 sys sys 1204292538 270403
-386/bin/ndb/ipquery - 775 sys sys 1204292540 96739
+386/bin/ndb/dnstcp - 775 sys sys 1208546570 270514
+386/bin/ndb/ipquery - 775 sys sys 1208546571 96850
 386/bin/ndb/mkdb - 775 sys sys 1168402340 64211
 386/bin/ndb/mkhash - 775 sys sys 1178568296 83312
 386/bin/ndb/mkhosts - 775 sys sys 1178568296 84355
@@ -584,7 +584,7 @@
 386/lib/libmemdraw.a - 664 sys sys 1168402369 284092
 386/lib/libmemlayer.a - 664 sys sys 1168402369 47360
 386/lib/libmp.a - 664 sys sys 1206470114 79978
-386/lib/libndb.a - 664 sys sys 1204292557 64600
+386/lib/libndb.a - 664 sys sys 1208546572 64960
 386/lib/liboventi.a - 664 sys sys 1206470118 99024
 386/lib/libplumb.a - 664 sys sys 1168402370 19408
 386/lib/libregexp.a - 664 sys sys 1200262805 37414
@@ -7729,7 +7729,7 @@ sys/man/4/INDEX - 664 sys sys 1196638942 1026
 sys/man/4/INDEX.html - 664 sys sys 1196638942 5147
 sys/man/4/acme - 664 sys sys 1196638943 10435
 sys/man/4/archfs - 664 sys sys 1196638943 533
-sys/man/4/cdfs - 664 sys sys 1207959658 4803
+sys/man/4/cdfs - 664 sys sys 1208538134 4809
 sys/man/4/cfs - 664 sys sys 1196638943 2136
 sys/man/4/consolefs - 664 sys sys 1196638943 4389
 sys/man/4/cwfs - 664 sys sys 1196638943 6553
@@ -9432,12 +9432,12 @@ sys/src/cmd/8l/optab.c - 664 sys sys 1111156413 16231
 sys/src/cmd/8l/pass.c - 664 sys sys 1095107668 13675
 sys/src/cmd/8l/span.c - 664 sys sys 1107721554 23294
 sys/src/cmd/9660srv - 20000000775 sys sys 1048644372 0
-sys/src/cmd/9660srv/9660srv.c - 664 sys sys 1206721469 17203
-sys/src/cmd/9660srv/dat.h - 664 sys sys 1204937773 2129
+sys/src/cmd/9660srv/9660srv.c - 664 sys sys 1208574082 17189
+sys/src/cmd/9660srv/dat.h - 664 sys sys 1208573849 2131
 sys/src/cmd/9660srv/data.c - 664 sys sys 944960735 373
 sys/src/cmd/9660srv/fns.h - 664 sys sys 1204937773 429
-sys/src/cmd/9660srv/iobuf.c - 664 sys sys 1204937829 3153
-sys/src/cmd/9660srv/iso9660.h - 664 sys sys 1014924873 2607
+sys/src/cmd/9660srv/iobuf.c - 664 sys sys 1208573842 3224
+sys/src/cmd/9660srv/iso9660.h - 664 sys sys 1208573813 2713
 sys/src/cmd/9660srv/main.c - 664 sys sys 1168307369 9808
 sys/src/cmd/9660srv/mkfile - 664 sys sys 1048644372 238
 sys/src/cmd/9660srv/xfile.c - 664 sys sys 1113742177 2736
@@ -10034,7 +10034,7 @@ sys/src/cmd/cdfs/dat.h - 664 sys sys 1206046829 4619
 sys/src/cmd/cdfs/fns.h - 664 sys sys 969542122 297
 sys/src/cmd/cdfs/main.c - 664 sys sys 1208195235 12480
 sys/src/cmd/cdfs/mkfile - 664 sys sys 1204937991 153
-sys/src/cmd/cdfs/mmc.c - 664 sys sys 1206476551 31404
+sys/src/cmd/cdfs/mmc.c - 664 sys sys 1208555777 31532
 sys/src/cmd/cec - 20000000775 sys sys 1193683647 0
 sys/src/cmd/cec/LICENSE - 664 sys sys 1186248056 1554
 sys/src/cmd/cec/Protocol - 664 sys sys 1186248056 2881
@@ -15586,7 +15586,7 @@ sys/src/libndb/ndbgetipaddr.c - 664 sys sys 1144174489 876
 sys/src/libndb/ndbgetval.c - 664 sys sys 1144174490 1348
 sys/src/libndb/ndbhash.c - 664 sys sys 1144174490 5276
 sys/src/libndb/ndbhf.h - 664 sys sys 1015013485 746
-sys/src/libndb/ndbipinfo.c - 664 sys sys 1176931776 5181
+sys/src/libndb/ndbipinfo.c - 664 sys sys 1208488938 5259
 sys/src/libndb/ndblookval.c - 664 sys sys 1078839929 791
 sys/src/libndb/ndbopen.c - 664 sys sys 1173737251 2717
 sys/src/libndb/ndbparse.c - 664 sys sys 1144174490 1207
@@ -15884,4 +15884,3 @@ usr/glenda/lib/profile - 664 glenda glenda 1105128663 890
 usr/glenda/readme.acme - 664 glenda glenda 1019860628 4753
 usr/glenda/readme.rio - 664 glenda glenda 1019860628 6370
 usr/glenda/tmp - 20000000775 glenda glenda 1018802620 0
-sys/src/libndb/ndbipinfo.c - 664 sys sys 1208488938 5259

+ 17 - 16
dist/replica/plan9.db

@@ -293,7 +293,7 @@
 386/bin/ip - 20000000775 sys sys 1016920851 0
 386/bin/ip/6in4 - 775 sys sys 1204292492 93318
 386/bin/ip/dhcpclient - 775 sys sys 1178568281 92992
-386/bin/ip/dhcpd - 775 sys sys 1207453634 152879
+386/bin/ip/dhcpd - 775 sys sys 1208546545 152990
 386/bin/ip/dhcpleases - 775 sys sys 1204292497 86370
 386/bin/ip/ftpd - 775 sys sys 1208230201 172192
 386/bin/ip/gping - 775 sys sys 1198211707 182214
@@ -309,19 +309,19 @@
 386/bin/ip/httpd/wikipost - 775 sys sys 1191273662 114183
 386/bin/ip/httpfile - 775 sys sys 1206478945 285640
 386/bin/ip/imap4d - 775 sys sys 1188447250 236867
-386/bin/ip/ipconfig - 775 sys sys 1204750828 161835
+386/bin/ip/ipconfig - 775 sys sys 1208546548 161946
 386/bin/ip/linklocal - 775 sys sys 1204292504 46800
 386/bin/ip/ping - 775 sys sys 1204292506 94531
 386/bin/ip/ppp - 775 sys sys 1204292510 221800
 386/bin/ip/pppoe - 775 sys sys 1168402326 77787
 386/bin/ip/pptp - 775 sys sys 1204292512 128355
 386/bin/ip/pptpd - 775 sys sys 1204292514 126067
-386/bin/ip/rarpd - 775 sys sys 1204292516 112649
+386/bin/ip/rarpd - 775 sys sys 1208546550 112756
 386/bin/ip/rexexec - 775 sys sys 1179372096 90284
 386/bin/ip/rip - 775 sys sys 1204292518 91302
 386/bin/ip/rlogind - 775 sys sys 1178568290 66192
 386/bin/ip/telnetd - 775 sys sys 1196742496 121995
-386/bin/ip/tftpd - 775 sys sys 1204292520 131963
+386/bin/ip/tftpd - 775 sys sys 1208546553 132074
 386/bin/ip/traceroute - 775 sys sys 1198211710 72783
 386/bin/ip/udpecho - 775 sys sys 1178508500 43095
 386/bin/ip/wol - 775 sys sys 1205983484 47866
@@ -347,13 +347,13 @@
 386/bin/mug - 775 sys sys 1197732786 176443
 386/bin/mv - 775 sys sys 1168402336 66629
 386/bin/ndb - 20000000775 sys sys 985743147 0
-386/bin/ndb/cs - 775 sys sys 1204292523 151621
+386/bin/ndb/cs - 775 sys sys 1208546555 151732
 386/bin/ndb/csquery - 775 sys sys 1176488418 61652
-386/bin/ndb/dns - 775 sys sys 1204292529 298693
-386/bin/ndb/dnsdebug - 775 sys sys 1204292533 272512
+386/bin/ndb/dns - 775 sys sys 1208546561 298804
+386/bin/ndb/dnsdebug - 775 sys sys 1208546565 272623
 386/bin/ndb/dnsquery - 775 sys sys 1185334136 64350
-386/bin/ndb/dnstcp - 775 sys sys 1204292538 270403
-386/bin/ndb/ipquery - 775 sys sys 1204292540 96739
+386/bin/ndb/dnstcp - 775 sys sys 1208546570 270514
+386/bin/ndb/ipquery - 775 sys sys 1208546571 96850
 386/bin/ndb/mkdb - 775 sys sys 1168402340 64211
 386/bin/ndb/mkhash - 775 sys sys 1178568296 83312
 386/bin/ndb/mkhosts - 775 sys sys 1178568296 84355
@@ -584,7 +584,7 @@
 386/lib/libmemdraw.a - 664 sys sys 1168402369 284092
 386/lib/libmemlayer.a - 664 sys sys 1168402369 47360
 386/lib/libmp.a - 664 sys sys 1206470114 79978
-386/lib/libndb.a - 664 sys sys 1204292557 64600
+386/lib/libndb.a - 664 sys sys 1208546572 64960
 386/lib/liboventi.a - 664 sys sys 1206470118 99024
 386/lib/libplumb.a - 664 sys sys 1168402370 19408
 386/lib/libregexp.a - 664 sys sys 1200262805 37414
@@ -7729,7 +7729,7 @@ sys/man/4/INDEX - 664 sys sys 1196638942 1026
 sys/man/4/INDEX.html - 664 sys sys 1196638942 5147
 sys/man/4/acme - 664 sys sys 1196638943 10435
 sys/man/4/archfs - 664 sys sys 1196638943 533
-sys/man/4/cdfs - 664 sys sys 1207959658 4803
+sys/man/4/cdfs - 664 sys sys 1208538134 4809
 sys/man/4/cfs - 664 sys sys 1196638943 2136
 sys/man/4/consolefs - 664 sys sys 1196638943 4389
 sys/man/4/cwfs - 664 sys sys 1196638943 6553
@@ -9432,12 +9432,12 @@ sys/src/cmd/8l/optab.c - 664 sys sys 1111156413 16231
 sys/src/cmd/8l/pass.c - 664 sys sys 1095107668 13675
 sys/src/cmd/8l/span.c - 664 sys sys 1107721554 23294
 sys/src/cmd/9660srv - 20000000775 sys sys 1048644372 0
-sys/src/cmd/9660srv/9660srv.c - 664 sys sys 1206721469 17203
-sys/src/cmd/9660srv/dat.h - 664 sys sys 1204937773 2129
+sys/src/cmd/9660srv/9660srv.c - 664 sys sys 1208574082 17189
+sys/src/cmd/9660srv/dat.h - 664 sys sys 1208573849 2131
 sys/src/cmd/9660srv/data.c - 664 sys sys 944960735 373
 sys/src/cmd/9660srv/fns.h - 664 sys sys 1204937773 429
-sys/src/cmd/9660srv/iobuf.c - 664 sys sys 1204937829 3153
-sys/src/cmd/9660srv/iso9660.h - 664 sys sys 1014924873 2607
+sys/src/cmd/9660srv/iobuf.c - 664 sys sys 1208573842 3224
+sys/src/cmd/9660srv/iso9660.h - 664 sys sys 1208573813 2713
 sys/src/cmd/9660srv/main.c - 664 sys sys 1168307369 9808
 sys/src/cmd/9660srv/mkfile - 664 sys sys 1048644372 238
 sys/src/cmd/9660srv/xfile.c - 664 sys sys 1113742177 2736
@@ -10034,7 +10034,7 @@ sys/src/cmd/cdfs/dat.h - 664 sys sys 1206046829 4619
 sys/src/cmd/cdfs/fns.h - 664 sys sys 969542122 297
 sys/src/cmd/cdfs/main.c - 664 sys sys 1208195235 12480
 sys/src/cmd/cdfs/mkfile - 664 sys sys 1204937991 153
-sys/src/cmd/cdfs/mmc.c - 664 sys sys 1206476551 31404
+sys/src/cmd/cdfs/mmc.c - 664 sys sys 1208555777 31532
 sys/src/cmd/cec - 20000000775 sys sys 1193683647 0
 sys/src/cmd/cec/LICENSE - 664 sys sys 1186248056 1554
 sys/src/cmd/cec/Protocol - 664 sys sys 1186248056 2881
@@ -15884,3 +15884,4 @@ usr/glenda/lib/profile - 664 glenda glenda 1105128663 890
 usr/glenda/readme.acme - 664 glenda glenda 1019860628 4753
 usr/glenda/readme.rio - 664 glenda glenda 1019860628 6370
 usr/glenda/tmp - 20000000775 glenda glenda 1018802620 0
+386/bin/cdfs - 775 sys sys 1208576039 173203

+ 16 - 0
dist/replica/plan9.log

@@ -18998,3 +18998,19 @@
 1208359804 1 c sys/src/cmd/page/view.c - 664 sys sys 1208359650 22159
 1208376004 0 c 386/bin/page - 775 sys sys 1208375716 236269
 1208489405 0 c sys/src/libndb/ndbipinfo.c - 664 sys sys 1208488938 5259
+1208538005 0 c sys/man/4/cdfs - 664 sys sys 1208538134 4809
+1208547004 0 c 386/bin/ip/dhcpd - 775 sys sys 1208546545 152990
+1208547004 1 c 386/bin/ip/ipconfig - 775 sys sys 1208546548 161946
+1208547004 2 c 386/bin/ip/rarpd - 775 sys sys 1208546550 112756
+1208547004 3 c 386/bin/ip/tftpd - 775 sys sys 1208546553 132074
+1208547004 4 c 386/bin/ndb/cs - 775 sys sys 1208546555 151732
+1208547004 5 c 386/bin/ndb/dns - 775 sys sys 1208546561 298804
+1208547004 6 c 386/bin/ndb/dnsdebug - 775 sys sys 1208546565 272623
+1208547004 7 c 386/bin/ndb/dnstcp - 775 sys sys 1208546570 270514
+1208547004 8 c 386/bin/ndb/ipquery - 775 sys sys 1208546571 96850
+1208547004 9 c 386/lib/libndb.a - 664 sys sys 1208546572 64960
+1208556004 0 c sys/src/cmd/cdfs/mmc.c - 664 sys sys 1208555777 31532
+1208574005 0 c sys/src/cmd/9660srv/9660srv.c - 664 sys sys 1208574082 17189
+1208574005 1 c sys/src/cmd/9660srv/dat.h - 664 sys sys 1208573849 2131
+1208574005 2 c sys/src/cmd/9660srv/iobuf.c - 664 sys sys 1208573842 3224
+1208574005 3 c sys/src/cmd/9660srv/iso9660.h - 664 sys sys 1208573813 2713

+ 1 - 1
sys/man/4/cdfs

@@ -1,6 +1,6 @@
 .TH CDFS 4
 .SH NAME
-cdfs, cddb \- optical disc (CD, DVD, BD) reader and writer file system
+cdfs, cddb \- optical disc (CD, DVD, BD) track reader and writer file system
 .SH SYNOPSIS
 .B cdfs
 [

+ 17 - 16
sys/src/cmd/9660srv/9660srv.c

@@ -14,8 +14,8 @@ static void	iwalk(Xfile*, char*);
 static void	iopen(Xfile*, int);
 static void	icreate(Xfile*, char*, long, int);
 static long	ireaddir(Xfile*, uchar*, long, long);
-static long	iread(Xfile*, char*, long, long);
-static long	iwrite(Xfile*, char*, long, long);
+static long	iread(Xfile*, char*, vlong, long);
+static long	iwrite(Xfile*, char*, vlong, long);
 static void	iclunk(Xfile*);
 static void	iremove(Xfile*);
 static void	istat(Xfile*, Dir*);
@@ -359,11 +359,12 @@ ireaddir(Xfile *f, uchar *buf, long offset, long count)
 }
 
 static long
-iread(Xfile *f, char *buf, long offset, long count)
+iread(Xfile *f, char *buf, vlong offset, long count)
 {
+	int n, o, rcnt = 0;
+	long size;
+	vlong addr;
 	Isofile *ip = f->ptr;
-	long size, addr, o, n;
-	int rcnt = 0;
 	Iobuf *p;
 
 	size = l32(ip->d.size);
@@ -371,10 +372,10 @@ iread(Xfile *f, char *buf, long offset, long count)
 		return 0;
 	if(offset+count > size)
 		count = size - offset;
-	addr = (l32(ip->d.addr)+ip->d.attrlen)*ip->blksize + offset;
-	o = (ulong)addr % Sectorsize;
-	addr = (ulong)addr / Sectorsize;
-	/*chat("d.addr=0x%x, addr=0x%x, o=0x%x...", l32(ip->d.addr), addr, o);*/
+	addr = ((vlong)l32(ip->d.addr) + ip->d.attrlen)*ip->blksize + offset;
+	o = addr % Sectorsize;
+	addr /= Sectorsize;
+	/*chat("d.addr=%ld, addr=%lld, o=%d...", l32(ip->d.addr), addr, o);*/
 	n = Sectorsize - o;
 
 	while(count > 0){
@@ -393,7 +394,7 @@ iread(Xfile *f, char *buf, long offset, long count)
 }
 
 static long
-iwrite(Xfile *f, char *buf, long offset, long count)
+iwrite(Xfile *f, char *buf, vlong offset, long count)
 {
 	USED(f, buf, offset, count);
 	error(Eperm);
@@ -493,20 +494,21 @@ getdrec(Xfile *f, void *buf)
 {
 	Isofile *ip = f->ptr;
 	int len = 0, boff = 0;
-	long size, addr;
+	ulong size;
+	vlong addr;
 	Iobuf *p = 0;
 
 	if(!ip)
 		return -1;
 	size = l32(ip->d.size);
-	while(ip->offset<size){
+	while(ip->offset < size){
 		addr = (l32(ip->d.addr)+ip->d.attrlen)*ip->blksize + ip->offset;
-		boff = (ulong)addr % Sectorsize;
+		boff = addr % Sectorsize;
 		if(boff > Sectorsize-34){
 			ip->offset += Sectorsize-boff;
 			continue;
 		}
-		p = getbuf(f->xf->d, (ulong)addr/Sectorsize);
+		p = getbuf(f->xf->d, addr/Sectorsize);
 		len = p->iobuf[boff];
 		if(len >= 34)
 			break;
@@ -519,9 +521,8 @@ getdrec(Xfile *f, void *buf)
 		putbuf(p);
 		ip->odelta = len + (len&1);
 		ip->offset += ip->odelta;
-	}
-	if(p)
 		return 0;
+	}
 	return -1;
 }
 

+ 5 - 5
sys/src/cmd/9660srv/dat.h

@@ -16,7 +16,7 @@ enum
 
 struct Iobuf
 {
-	Ioclust*	clust;
+	Ioclust* clust;
 	long	addr;
 	uchar*	iobuf;
 };
@@ -25,8 +25,8 @@ struct Ioclust
 {
 	long	addr;			/* in sectors; good to 8TB */
 	Xdata*	dev;
-	Ioclust*	next;
-	Ioclust*	prev;
+	Ioclust* next;
+	Ioclust* prev;
 	int	busy;
 	int	nbuf;
 	Iobuf*	buf;
@@ -54,8 +54,8 @@ struct Xfsub
 	void	(*open)(Xfile*, int);
 	void	(*create)(Xfile*, char*, long, int);
 	long	(*readdir)(Xfile*, uchar*, long, long);
-	long	(*read)(Xfile*, char*, long, long);
-	long	(*write)(Xfile*, char*, long, long);
+	long	(*read)(Xfile*, char*, vlong, long);
+	long	(*write)(Xfile*, char*, vlong, long);
 	void	(*clunk)(Xfile*);
 	void	(*remove)(Xfile*);
 	void	(*stat)(Xfile*, Dir*);

+ 5 - 5
sys/src/cmd/9660srv/iobuf.c

@@ -23,16 +23,18 @@
  * it's worth worrying about.		-rsc
  */
 
-#define	BUFPERCLUST	64	/* 64*Sectorsize = 128kb */
+/* trying a larger value to get greater throughput - geoff */
+#define	BUFPERCLUST	256 /* sectors/cluster; was 64, 64*Sectorsize = 128kb */
 #define	NCLUST		16
 
 int nclust = NCLUST;
 
 static Ioclust*	iohead;
 static Ioclust*	iotail;
+
 static Ioclust*	getclust(Xdata*, long);
 static void	putclust(Ioclust*);
-static void xread(Ioclust*);
+static void	xread(Ioclust*);
 
 void
 iobuf_init(void)
@@ -164,12 +166,10 @@ static void
 xread(Ioclust *c)
 {
 	int n;
-	vlong addr;
 	Xdata *dev;
 
 	dev = c->dev;
-	addr = c->addr;
-	seek(dev->dev, addr*Sectorsize, 0);
+	seek(dev->dev, (vlong)c->addr * Sectorsize, 0);
 	n = readn(dev->dev, c->iobuf, BUFPERCLUST*Sectorsize);
 	if(n < Sectorsize)
 		error("I/O read error");

+ 4 - 0
sys/src/cmd/9660srv/iso9660.h

@@ -1,5 +1,9 @@
 #define	VOLDESC	16	/* sector number */
 
+/*
+ * L means little-endian, M means big-endian, and LM means little-endian
+ * then again big-endian.
+ */
 typedef uchar		Byte2L[2];
 typedef uchar		Byte2M[2];
 typedef uchar		Byte4LM[4];

+ 4 - 2
sys/src/cmd/cdfs/mmc.c

@@ -993,10 +993,12 @@ mmcread(Buf *buf, void *v, long nblock, long off)
 
 	/*
 	 * `read cd' only works for CDs; for everybody else,
-	 * we'll try plain `read (12)'.
+	 * we'll try plain `read (12)'.  only use read cd if it's
+	 * a cd drive with a cd in it and we're not reading data
+	 * (e.g., reading audio).
 	 */
 	memset(cmd, 0, sizeof(cmd));
-	if (drive->type == TypeCD && drive->mmctype == Mmccd) {
+	if (drive->type == TypeCD && drive->mmctype == Mmccd && bs != BScdrom) {
 		cmd[0] = ScmdReadcd;
 		cmd[2] = off>>24;
 		cmd[3] = off>>16;