Browse Source

Plan 9 from Bell Labs 2007-08-09

David du Colombier 13 years ago
parent
commit
4106fbffbf

+ 12 - 9
dist/replica/_plan9.db

@@ -409,7 +409,7 @@
 386/bin/sniffer - 775 sys sys 1038443185 99028
 386/bin/snoopy - 775 sys sys 1186112232 190558
 386/bin/sort - 775 sys sys 1178568303 81057
-386/bin/spin - 775 sys sys 1176520498 760856
+386/bin/spin - 775 sys sys 1186543935 769291
 386/bin/split - 775 sys sys 1181507270 75811
 386/bin/srv - 775 sys sys 1179372105 82797
 386/bin/srvfs - 775 sys sys 1162241047 40169
@@ -8120,7 +8120,7 @@ sys/src/9/pc/sd63xxesb.c - 664 sys sys 1184467400 35975
 sys/src/9/pc/sdata.c - 664 sys sys 1186361525 52991
 sys/src/9/pc/sdmv50xx.c - 664 sys sys 1184467229 33837
 sys/src/9/pc/sdmylex.c - 664 sys sys 1171321627 28237
-sys/src/9/pc/sdscsi.c - 664 sys sys 1158889425 7241
+sys/src/9/pc/sdscsi.c - 664 sys sys 1186618532 7957
 sys/src/9/pc/trap.c - 664 sys sys 1186361997 21898
 sys/src/9/pc/uartaxp.c - 664 sys sys 1166247784 18879
 sys/src/9/pc/uarti8250.c - 664 sys sys 1177676872 13957
@@ -8183,7 +8183,7 @@ sys/src/9/port/devpipe.c - 664 sys sys 1077055016 5825
 sys/src/9/port/devpnp.c - 664 sys sys 1088560907 13624
 sys/src/9/port/devproc.c - 664 sys sys 1168304324 28543
 sys/src/9/port/devroot.c - 664 sys sys 1146151714 4242
-sys/src/9/port/devsd.c - 664 sys sys 1184847548 31123
+sys/src/9/port/devsd.c - 664 sys sys 1186618574 31315
 sys/src/9/port/devsdp.c - 664 sys sys 1057323393 44800
 sys/src/9/port/devsegment.c - 664 sys sys 1131289891 9610
 sys/src/9/port/devsrv.c - 664 sys sys 1165810571 5711
@@ -8230,7 +8230,7 @@ sys/src/9/port/qio.c - 664 sys sys 1070287837 23562
 sys/src/9/port/qlock.c - 664 sys sys 1178057654 3300
 sys/src/9/port/rdb.c - 664 sys sys 1184465938 1704
 sys/src/9/port/rebootcmd.c - 664 sys sys 1015278340 1561
-sys/src/9/port/sd.h - 664 sys sys 1134411408 2494
+sys/src/9/port/sd.h - 664 sys sys 1186618553 2499
 sys/src/9/port/segment.c - 664 sys sys 1170456581 14052
 sys/src/9/port/semaphore.p - 664 sys sys 1143129797 2424
 sys/src/9/port/swap.c - 664 sys sys 1138028310 7019
@@ -9151,11 +9151,11 @@ sys/src/boot/pc/kfs.h - 664 sys sys 1032215924 861
 sys/src/boot/pc/kfsboot.c - 664 sys sys 1032215914 4788
 sys/src/boot/pc/l.s - 664 sys sys 1130887225 18115
 sys/src/boot/pc/lib.h - 664 sys sys 1186031516 2843
-sys/src/boot/pc/load.c - 664 sys sys 1175289729 9410
+sys/src/boot/pc/load.c - 664 sys sys 1186619888 9469
 sys/src/boot/pc/mbr.s - 664 sys sys 1015007953 6234
 sys/src/boot/pc/mem.h - 664 sys sys 1130887225 3371
 sys/src/boot/pc/memory.c - 664 sys sys 1019533021 10272
-sys/src/boot/pc/mkfile - 664 sys sys 1178926615 3166
+sys/src/boot/pc/mkfile - 664 sys sys 1186619876 3181
 sys/src/boot/pc/noether.c - 664 sys sys 1094674488 358
 sys/src/boot/pc/part.c - 664 sys sys 1114697151 7153
 sys/src/boot/pc/pbs.s - 664 sys sys 1143465387 8291
@@ -9554,7 +9554,7 @@ sys/src/cmd/auth/changeuser.c - 664 sys sys 1155994851 2949
 sys/src/cmd/auth/convbio.c - 664 sys sys 1015008432 2212
 sys/src/cmd/auth/convkeys.c - 664 sys sys 1155994849 2387
 sys/src/cmd/auth/convkeys2.c - 664 sys sys 1155994849 2444
-sys/src/cmd/auth/cron.c - 664 sys sys 1178316322 12313
+sys/src/cmd/auth/cron.c - 664 sys sys 1186599442 12315
 sys/src/cmd/auth/debug.c - 664 sys sys 1143694911 7325
 sys/src/cmd/auth/disable - 775 sys sys 1015008431 146
 sys/src/cmd/auth/enable - 775 sys sys 1015008430 134
@@ -10097,7 +10097,7 @@ sys/src/cmd/db/runpcs.c - 664 sys sys 1134305454 2928
 sys/src/cmd/db/setup.c - 664 sys sys 1014925293 3581
 sys/src/cmd/db/trcrun.c - 664 sys sys 1131297926 4433
 sys/src/cmd/dc.c - 664 sys sys 1121977159 36572
-sys/src/cmd/dd.c - 664 sys sys 1184464448 11893
+sys/src/cmd/dd.c - 664 sys sys 1186615580 11885
 sys/src/cmd/deroff.c - 664 sys sys 1017679319 14611
 sys/src/cmd/dial - 20000000775 sys sys 1059696920 0
 sys/src/cmd/dial/at.c - 664 sys sys 1058789951 2011
@@ -12816,7 +12816,7 @@ sys/src/cmd/mkmany - 664 sys sys 1123818681 1304
 sys/src/cmd/mkone - 664 sys sys 1123943673 910
 sys/src/cmd/mksyslib - 664 sys sys 1134390137 665
 sys/src/cmd/mntgen.c - 664 sys sys 1106410349 3630
-sys/src/cmd/mount.c - 664 sys sys 1181847483 1685
+sys/src/cmd/mount.c - 664 sys sys 1186618412 1685
 sys/src/cmd/ms2html.c - 664 sys sys 1166823350 41013
 sys/src/cmd/mtime.c - 664 sys sys 1036172302 450
 sys/src/cmd/mug.c - 664 sys sys 1157143847 24888
@@ -15847,3 +15847,6 @@ 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/dd - 775 sys sys 1186629980 46060
+386/bin/mount - 775 sys sys 1186629980 73380
+386/bin/auth/cron - 775 sys sys 1186629980 143801

+ 12 - 12
dist/replica/plan9.db

@@ -48,7 +48,7 @@
 386/bin/auth/changeuser - 775 sys sys 1178568246 96020
 386/bin/auth/convkeys - 775 sys sys 1181621139 87231
 386/bin/auth/convkeys2 - 775 sys sys 1181621139 87290
-386/bin/auth/cron - 775 sys sys 1179372068 143801
+386/bin/auth/cron - 775 sys sys 1186629980 143801
 386/bin/auth/debug - 775 sys sys 1168402268 101566
 386/bin/auth/disable - 775 sys sys 1020319057 146
 386/bin/auth/enable - 775 sys sys 1020319057 134
@@ -195,7 +195,7 @@
 386/bin/date - 775 sys sys 1178568265 41845
 386/bin/db - 775 sys sys 1178908092 345933
 386/bin/dc - 775 sys sys 1168402299 99260
-386/bin/dd - 775 sys sys 1184529900 46002
+386/bin/dd - 775 sys sys 1186629980 46060
 386/bin/deroff - 775 sys sys 1168402299 74474
 386/bin/dial - 20000000775 sys sys 1058790015 0
 386/bin/dial/at - 775 sys sys 1168402300 61080
@@ -334,7 +334,7 @@
 386/bin/mkdir - 775 sys sys 1168402334 61205
 386/bin/mkpaqfs - 775 sys sys 1178568292 93268
 386/bin/mntgen - 775 sys sys 1179372098 144046
-386/bin/mount - 775 sys sys 1181877817 73380
+386/bin/mount - 775 sys sys 1186629980 73380
 386/bin/ms2html - 775 sys sys 1178568293 102703
 386/bin/mtime - 775 sys sys 1168402336 59376
 386/bin/mug - 775 sys sys 1179372099 176427
@@ -409,7 +409,7 @@
 386/bin/sniffer - 775 sys sys 1038443185 99028
 386/bin/snoopy - 775 sys sys 1186112232 190558
 386/bin/sort - 775 sys sys 1178568303 81057
-386/bin/spin - 775 sys sys 1176520498 760856
+386/bin/spin - 775 sys sys 1186543935 769291
 386/bin/split - 775 sys sys 1181507270 75811
 386/bin/srv - 775 sys sys 1179372105 82797
 386/bin/srvfs - 775 sys sys 1162241047 40169
@@ -8120,7 +8120,7 @@ sys/src/9/pc/sd63xxesb.c - 664 sys sys 1184467400 35975
 sys/src/9/pc/sdata.c - 664 sys sys 1186361525 52991
 sys/src/9/pc/sdmv50xx.c - 664 sys sys 1184467229 33837
 sys/src/9/pc/sdmylex.c - 664 sys sys 1171321627 28237
-sys/src/9/pc/sdscsi.c - 664 sys sys 1158889425 7241
+sys/src/9/pc/sdscsi.c - 664 sys sys 1186618532 7957
 sys/src/9/pc/trap.c - 664 sys sys 1186361997 21898
 sys/src/9/pc/uartaxp.c - 664 sys sys 1166247784 18879
 sys/src/9/pc/uarti8250.c - 664 sys sys 1177676872 13957
@@ -8183,7 +8183,7 @@ sys/src/9/port/devpipe.c - 664 sys sys 1077055016 5825
 sys/src/9/port/devpnp.c - 664 sys sys 1088560907 13624
 sys/src/9/port/devproc.c - 664 sys sys 1168304324 28543
 sys/src/9/port/devroot.c - 664 sys sys 1146151714 4242
-sys/src/9/port/devsd.c - 664 sys sys 1184847548 31123
+sys/src/9/port/devsd.c - 664 sys sys 1186618574 31315
 sys/src/9/port/devsdp.c - 664 sys sys 1057323393 44800
 sys/src/9/port/devsegment.c - 664 sys sys 1131289891 9610
 sys/src/9/port/devsrv.c - 664 sys sys 1165810571 5711
@@ -8230,7 +8230,7 @@ sys/src/9/port/qio.c - 664 sys sys 1070287837 23562
 sys/src/9/port/qlock.c - 664 sys sys 1178057654 3300
 sys/src/9/port/rdb.c - 664 sys sys 1184465938 1704
 sys/src/9/port/rebootcmd.c - 664 sys sys 1015278340 1561
-sys/src/9/port/sd.h - 664 sys sys 1134411408 2494
+sys/src/9/port/sd.h - 664 sys sys 1186618553 2499
 sys/src/9/port/segment.c - 664 sys sys 1170456581 14052
 sys/src/9/port/semaphore.p - 664 sys sys 1143129797 2424
 sys/src/9/port/swap.c - 664 sys sys 1138028310 7019
@@ -9151,11 +9151,11 @@ sys/src/boot/pc/kfs.h - 664 sys sys 1032215924 861
 sys/src/boot/pc/kfsboot.c - 664 sys sys 1032215914 4788
 sys/src/boot/pc/l.s - 664 sys sys 1130887225 18115
 sys/src/boot/pc/lib.h - 664 sys sys 1186031516 2843
-sys/src/boot/pc/load.c - 664 sys sys 1175289729 9410
+sys/src/boot/pc/load.c - 664 sys sys 1186619888 9469
 sys/src/boot/pc/mbr.s - 664 sys sys 1015007953 6234
 sys/src/boot/pc/mem.h - 664 sys sys 1130887225 3371
 sys/src/boot/pc/memory.c - 664 sys sys 1019533021 10272
-sys/src/boot/pc/mkfile - 664 sys sys 1178926615 3166
+sys/src/boot/pc/mkfile - 664 sys sys 1186619876 3181
 sys/src/boot/pc/noether.c - 664 sys sys 1094674488 358
 sys/src/boot/pc/part.c - 664 sys sys 1114697151 7153
 sys/src/boot/pc/pbs.s - 664 sys sys 1143465387 8291
@@ -9554,7 +9554,7 @@ sys/src/cmd/auth/changeuser.c - 664 sys sys 1155994851 2949
 sys/src/cmd/auth/convbio.c - 664 sys sys 1015008432 2212
 sys/src/cmd/auth/convkeys.c - 664 sys sys 1155994849 2387
 sys/src/cmd/auth/convkeys2.c - 664 sys sys 1155994849 2444
-sys/src/cmd/auth/cron.c - 664 sys sys 1178316322 12313
+sys/src/cmd/auth/cron.c - 664 sys sys 1186599442 12315
 sys/src/cmd/auth/debug.c - 664 sys sys 1143694911 7325
 sys/src/cmd/auth/disable - 775 sys sys 1015008431 146
 sys/src/cmd/auth/enable - 775 sys sys 1015008430 134
@@ -10097,7 +10097,7 @@ sys/src/cmd/db/runpcs.c - 664 sys sys 1134305454 2928
 sys/src/cmd/db/setup.c - 664 sys sys 1014925293 3581
 sys/src/cmd/db/trcrun.c - 664 sys sys 1131297926 4433
 sys/src/cmd/dc.c - 664 sys sys 1121977159 36572
-sys/src/cmd/dd.c - 664 sys sys 1184464448 11893
+sys/src/cmd/dd.c - 664 sys sys 1186615580 11885
 sys/src/cmd/deroff.c - 664 sys sys 1017679319 14611
 sys/src/cmd/dial - 20000000775 sys sys 1059696920 0
 sys/src/cmd/dial/at.c - 664 sys sys 1058789951 2011
@@ -12816,7 +12816,7 @@ sys/src/cmd/mkmany - 664 sys sys 1123818681 1304
 sys/src/cmd/mkone - 664 sys sys 1123943673 910
 sys/src/cmd/mksyslib - 664 sys sys 1134390137 665
 sys/src/cmd/mntgen.c - 664 sys sys 1106410349 3630
-sys/src/cmd/mount.c - 664 sys sys 1181847483 1685
+sys/src/cmd/mount.c - 664 sys sys 1186618412 1685
 sys/src/cmd/ms2html.c - 664 sys sys 1166823350 41013
 sys/src/cmd/mtime.c - 664 sys sys 1036172302 450
 sys/src/cmd/mug.c - 664 sys sys 1157143847 24888

+ 13 - 0
dist/replica/plan9.log

@@ -49898,3 +49898,16 @@
 1186527604 28 c sys/src/cmd/spin/vars.c - 664 sys sys 1186525921 8374
 1186527604 29 c sys/src/cmd/spin/version.h - 664 sys sys 1186525921 53
 1186529404 0 c rc/bin/lookman - 775 sys sys 1186528516 687
+1186545604 0 c 386/bin/spin - 775 sys sys 1186543935 769291
+1186599604 0 c sys/src/cmd/auth/cron.c - 664 sys sys 1186599442 12315
+1186615805 0 c sys/src/9/pc/sdscsi.c - 664 sys sys 1186615791 7381
+1186615805 1 c sys/src/cmd/dd.c - 664 sys sys 1186615580 11885
+1186619405 0 c sys/src/9/pc/sdscsi.c - 664 sys sys 1186618532 7957
+1186619405 1 c sys/src/9/port/devsd.c - 664 sys sys 1186618574 31315
+1186619405 2 c sys/src/9/port/sd.h - 664 sys sys 1186618553 2499
+1186619405 3 c sys/src/cmd/mount.c - 664 sys sys 1186618412 1685
+1186621205 0 c sys/src/boot/pc/load.c - 664 sys sys 1186619888 9469
+1186621205 1 c sys/src/boot/pc/mkfile - 664 sys sys 1186619876 3181
+1186630203 0 c 386/bin/dd - 775 sys sys 1186629980 46060
+1186630203 1 c 386/bin/mount - 775 sys sys 1186629980 73380
+1186630203 2 c 386/bin/auth/cron - 775 sys sys 1186629980 143801

+ 69 - 24
sys/src/9/pc/sdscsi.c

@@ -57,7 +57,7 @@ scsiverify(SDunit* unit)
 		return 0;
 	}
 	memmove(unit->inquiry, inquiry, r->dlen);
-	free(inquiry); 
+	free(inquiry);
 
 	SET(status);
 	for(i = 0; i < 3; i++){
@@ -208,20 +208,13 @@ scsionline(SDunit* unit)
 		r->data = p;
 		r->dlen = 8;
 		r->flags = 0;
-	
+
 		r->status = ~0;
 		switch(scsirio(r)){
 		default:
 			break;
 		case 0:
 			unit->sectors = (p[0]<<24)|(p[1]<<16)|(p[2]<<8)|p[3];
-			if(unit->sectors == 0)
-				continue;
-			/*
-			 * Read-capacity returns the LBA of the last sector,
-			 * therefore the number of sectors must be incremented.
-			 */
-			unit->sectors++;
 			unit->secsize = (p[4]<<24)|(p[5]<<16)|(p[6]<<8)|p[7];
 
 			/*
@@ -231,6 +224,16 @@ scsionline(SDunit* unit)
 			 */
 			if(unit->secsize == 2352)
 				unit->secsize = 2048;
+			/*
+			 * Devices with removable media may return 0 sectors
+			 * when they have empty media (e.g. sata dvd writers);
+			 * if so, keep the count zero.
+			 *
+			 * Read-capacity returns the LBA of the last sector,
+			 * therefore the number of sectors must be incremented.
+			 */
+			if(unit->sectors != 0)
+				unit->sectors++;
 			ok = 1;
 			break;
 		case 1:
@@ -300,8 +303,60 @@ scsiexec(SDunit* unit, int write, uchar* cmd, int clen, void* data, int* dlen)
 	return status;
 }
 
+static void
+scsifmt10(SDreq *r, int write, int lun, ulong nb, uvlong bno)
+{
+	uchar *c;
+
+	c = r->cmd;
+	if(write == 0)
+		c[0] = 0x28;
+	else
+		c[0] = 0x2A;
+	c[1] = lun<<5;
+	c[2] = bno>>24;
+	c[3] = bno>>16;
+	c[4] = bno>>8;
+	c[5] = bno;
+	c[6] = 0;
+	c[7] = nb>>8;
+	c[8] = nb;
+	c[9] = 0;
+
+	r->clen = 10;
+}
+
+static void
+scsifmt16(SDreq *r, int write, int lun, ulong nb, uvlong bno)
+{
+	uchar *c;
+
+	c = r->cmd;
+	if(write == 0)
+		c[0] = 0x88;
+	else
+		c[0] = 0x8A;
+	c[1] = lun<<5;		/* so wrong */
+	c[2] = bno>>56;
+	c[3] = bno>>48;
+	c[4] = bno>>40;
+	c[5] = bno>>32;
+	c[6] = bno>>24;
+	c[7] = bno>>16;
+	c[8] = bno>>8;
+	c[9] = bno;
+	c[10] = nb>>24;
+	c[11] = nb>>16;
+	c[12] = nb>>8;
+	c[13] = nb;
+	c[14] = 0;
+	c[15] = 0;
+
+	r->clen = 16;
+}
+
 long
-scsibio(SDunit* unit, int lun, int write, void* data, long nb, long bno)
+scsibio(SDunit* unit, int lun, int write, void* data, long nb, uvlong bno)
 {
 	SDreq *r;
 	long rlen;
@@ -312,20 +367,10 @@ scsibio(SDunit* unit, int lun, int write, void* data, long nb, long bno)
 	r->lun = lun;
 again:
 	r->write = write;
-	if(write == 0)
-		r->cmd[0] = 0x28;
+	if(bno >= (1ULL<<32))
+		scsifmt16(r, write, lun, nb, bno);
 	else
-		r->cmd[0] = 0x2A;
-	r->cmd[1] = (lun<<5);
-	r->cmd[2] = bno>>24;
-	r->cmd[3] = bno>>16;
-	r->cmd[4] = bno>>8;
-	r->cmd[5] = bno;
-	r->cmd[6] = 0;
-	r->cmd[7] = nb>>8;
-	r->cmd[8] = nb;
-	r->cmd[9] = 0;
-	r->clen = 10;
+		scsifmt10(r, write, lun, nb, bno);
 	r->data = data;
 	r->dlen = nb*unit->secsize;
 	r->flags = 0;
@@ -346,7 +391,7 @@ again:
 		default:
 			break;
 		case 0x01:		/* recovered error */
-			print("%s: recovered error at sector %ld\n",
+			print("%s: recovered error at sector %llud\n",
 				unit->name, bno);
 			rlen = r->rlen;
 			break;

+ 27 - 16
sys/src/9/port/devsd.c

@@ -73,7 +73,7 @@ enum {
 
 
 static void
-sdaddpart(SDunit* unit, char* name, ulong start, ulong end)
+sdaddpart(SDunit* unit, char* name, uvlong start, uvlong end)
 {
 	SDpart *pp;
 	int i, partno;
@@ -177,7 +177,7 @@ static int
 sdinitpart(SDunit* unit)
 {
 	int nf;
-	ulong start, end;
+	uvlong start, end;
 	char *f[4], *p, *q, buf[10];
 
 	if(unit->sectors > 0){
@@ -219,8 +219,8 @@ sdinitpart(SDunit* unit)
 			if(nf < 3)
 				continue;
 
-			start = strtoul(f[1], 0, 0);
-			end = strtoul(f[2], 0, 0);
+			start = strtoull(f[1], 0, 0);
+			end = strtoull(f[2], 0, 0);
 			if(!waserror()){
 				sdaddpart(unit, f[0], start, end);
 				poperror();
@@ -378,11 +378,20 @@ sdadddevs(SDev *sdev)
 	}
 }
 
+// void
+// sdrmdevs(SDev *sdev)
+// {
+// 	char buf[2];
+//
+// 	snprint(buf, sizeof buf, "%c", sdev->idno);
+// 	unconfigure(buf);
+// }
+
 static int
 sd2gen(Chan* c, int i, Dir* dp)
 {
 	Qid q;
-	vlong l;
+	uvlong l;
 	SDpart *pp;
 	SDperm *perm;
 	SDunit *unit;
@@ -421,7 +430,7 @@ sd2gen(Chan* c, int i, Dir* dp)
 
 	case Qpart:
 		pp = &unit->part[PART(c->qid)];
-		l = (pp->end - pp->start) * (vlong)unit->secsize;
+		l = (pp->end - pp->start) * unit->secsize;
 		mkqid(&q, QID(DEV(c->qid), UNIT(c->qid), PART(c->qid), Qpart),
 			unit->vers+pp->vers, QTFILE);
 		if(emptystr(pp->user))
@@ -453,7 +462,7 @@ static int
 sdgen(Chan* c, char*, Dirtab*, int, int s, Dir* dp)
 {
 	Qid q;
-	vlong l;
+	uvlong l;
 	int i, r;
 	SDpart *pp;
 	SDunit *unit;
@@ -554,7 +563,7 @@ sdgen(Chan* c, char*, Dirtab*, int, int s, Dir* dp)
 			decref(&sdev->r);
 			return 0;
 		}
-		l = (pp->end - pp->start) * (vlong)unit->secsize;
+		l = (pp->end - pp->start) * unit->secsize;
 		mkqid(&q, QID(DEV(c->qid), UNIT(c->qid), i, Qpart),
 			unit->vers+pp->vers, QTFILE);
 		if(emptystr(pp->user))
@@ -707,7 +716,7 @@ sdclose(Chan* c)
 }
 
 static long
-sdbio(Chan* c, int write, char* a, long len, vlong off)
+sdbio(Chan* c, int write, char* a, long len, uvlong off)
 {
 	int nchange;
 	long l;
@@ -715,7 +724,8 @@ sdbio(Chan* c, int write, char* a, long len, vlong off)
 	SDpart *pp;
 	SDunit *unit;
 	SDev *sdev;
-	ulong bno, max, nb, offset;
+	ulong max, nb, offset;
+	uvlong bno;
 
 	sdev = sdgetdev(DEV(c->qid));
 	if(sdev == nil){
@@ -1053,6 +1063,8 @@ sdfakescsi(SDreq *r, void *info, int ilen)
 
 	case 0x28:	/* read */
 	case 0x2A:	/* write */
+	case 0x88:	/* read16 */
+	case 0x8a:	/* write16 */
 		return SDnostatus;
 	}
 }
@@ -1114,13 +1126,13 @@ sdread(Chan *c, void *a, long n, vlong off)
 		if(unit->sectors){
 			if(unit->dev->ifc->rctl == nil)
 				l += snprint(p+l, m-l,
-					"geometry %lud %ld\n",
+					"geometry %llud %lud\n",
 					unit->sectors, unit->secsize);
 			pp = unit->part;
 			for(i = 0; i < unit->npart; i++){
 				if(pp->valid)
 					l += snprint(p+l, m-l,
-						"part %s %lud %lud\n",
+						"part %s %llud %llud\n",
 						pp->name, pp->start, pp->end);
 				pp++;
 			}
@@ -1172,7 +1184,7 @@ sdwrite(Chan* c, void* a, long n, vlong off)
 {
 	char *f0;
 	int i;
-	ulong end, start;
+	uvlong end, start;
 	Cmdbuf *cb;
 	SDifc *ifc;
 	SDreq *req;
@@ -1266,8 +1278,8 @@ sdwrite(Chan* c, void* a, long n, vlong off)
 				error(Ebadctl);
 			if(unit->sectors == 0 && !sdinitpart(unit))
 				error(Eio);
-			start = strtoul(cb->f[2], 0, 0);
-			end = strtoul(cb->f[3], 0, 0);
+			start = strtoull(cb->f[2], 0, 0);
+			end = strtoull(cb->f[3], 0, 0);
 			sdaddpart(unit, cb->f[1], start, end);
 		}
 		else if(strcmp(cb->f[0], "delpart") == 0){
@@ -1631,4 +1643,3 @@ legacytopctl(Cmdbuf *cb)
 		error(Ebadarg);
 	sdconfig(cd.on, cd.spec, &cd.cf);
 }
-

+ 7 - 7
sys/src/9/port/sd.h

@@ -15,8 +15,8 @@ struct SDperm {
 };
 
 struct SDpart {
-	ulong	start;
-	ulong	end;
+	uvlong	start;
+	uvlong	end;
 	SDperm;
 	int	valid;
 	ulong	vers;
@@ -30,7 +30,7 @@ struct SDunit {
 	SDperm;
 
 	QLock	ctl;
-	ulong	sectors;
+	uvlong	sectors;
 	ulong	secsize;
 	SDpart*	part;			/* nil or array of size npart */
 	int	npart;
@@ -44,9 +44,9 @@ struct SDunit {
 	SDperm	rawperm;
 };
 
-/* 
+/*
  * Each controller is represented by a SDev.
- */ 
+ */
 struct SDev {
 	Ref	r;			/* Number of callers using device */
 	SDifc*	ifc;			/* pnp/legacy */
@@ -77,7 +77,7 @@ struct SDifc {
 	int	(*rctl)(SDunit*, char*, int);
 	int	(*wctl)(SDunit*, Cmdbuf*);
 
-	long	(*bio)(SDunit*, int, int, void*, long, long);
+	long	(*bio)(SDunit*, int, int, void*, long, uvlong);
 	SDev*	(*probe)(DevConf*);
 	void	(*clear)(SDev*);
 	char*	(*rtopctl)(SDev*, char*, char*);
@@ -133,5 +133,5 @@ extern int sdfakescsi(SDreq*, void*, int);
 /* sdscsi.c */
 extern int scsiverify(SDunit*);
 extern int scsionline(SDunit*);
-extern long scsibio(SDunit*, int, int, void*, long, long);
+extern long scsibio(SDunit*, int, int, void*, long, uvlong);
 extern SDev* scsiid(SDev*, SDifc*);

+ 3 - 0
sys/src/boot/pc/load.c

@@ -75,11 +75,13 @@ Type types[] = {
 #include "sd.h"
 
 extern SDifc sdataifc;
+extern SDifc sd63xxesbifc;
 
 #ifdef NOSCSI
 
 SDifc* sdifc[] = {
 	&sdataifc,
+	&sd63xxesbifc,
 	nil,
 };
 
@@ -91,6 +93,7 @@ SDifc* sdifc[] = {
 	&sdataifc,
 	&sdmylexifc,
 	&sd53c8xxifc,
+	&sd63xxesbifc,
 	nil,
 };
 

+ 1 - 0
sys/src/boot/pc/mkfile

@@ -46,6 +46,7 @@ LOAD=\
 	sdata.$O\
 	sdmylex.$O\
 	sd53c8xx.$O\
+	sd63xxesb.$O\
 	sdscsi.$O\
 
 ETHER=\

+ 1 - 1
sys/src/cmd/auth/cron.c

@@ -618,7 +618,7 @@ initcap(void)
 {
 	caphashfd = open("#¤/caphash", OCEXEC|OWRITE);
 	if(caphashfd < 0)
-		fprint(2, "%s: opening #¤/caphash: %r", argv0);
+		fprint(2, "%s: opening #¤/caphash: %r\n", argv0);
 }
 
 /*

+ 19 - 16
sys/src/cmd/dd.c

@@ -1,7 +1,8 @@
 #include <u.h>
 #include <libc.h>
 
-#define	BIG	2147483647
+#define	BIG	((1UL<<31)-1)
+#define VBIG	((1ULL<<63)-1)
 #define	LCASE	(1<<0)
 #define	UCASE	(1<<1)
 #define	SWAB	(1<<2)
@@ -10,15 +11,18 @@
 
 int	cflag;
 int	fflag;
+
 char	*string;
 char	*ifile;
 char	*ofile;
 char	*ibuf;
 char	*obuf;
+
 vlong	skip;
 vlong	oseekn;
 vlong	iseekn;
 vlong	count;
+
 long	files	= 1;
 long	ibs	= 512;
 long	obs	= 512;
@@ -32,19 +36,23 @@ long	nipr;
 long	nofr;
 long	nopr;
 long	ntrunc;
+
 int dotrunc = 1;
 int	ibf;
 int	obf;
+
 char	*op;
 int	nspace;
+
 uchar	etoa[256];
 uchar	atoe[256];
 uchar	atoibm[256];
+
 int	quiet;
 
 void	flsh(void);
 int	match(char *s);
-vlong	number(long big);
+vlong	number(vlong big);
 void	cnull(int cc);
 void	null(int c);
 void	ascii(int cc);
@@ -106,19 +114,19 @@ main(int argc, char *argv[])
 			continue;
 		}
 		if(iskey("skip")) {
-			skip = number(BIG);
+			skip = number(VBIG);
 			continue;
 		}
 		if(iskey("seek") || iskey("oseek")) {
-			oseekn = number(BIG);
+			oseekn = number(VBIG);
 			continue;
 		}
 		if(iskey("iseek")) {
-			iseekn = number(BIG);
+			iseekn = number(VBIG);
 			continue;
 		}
 		if(iskey("count")) {
-			count = number(BIG);
+			count = number(VBIG);
 			continue;
 		}
 		if(iskey("files")) {
@@ -334,10 +342,10 @@ true:
 }
 
 vlong
-number(long big)
+number(vlong big)
 {
 	char *cs;
-	vlong n;
+	uvlong n;
 
 	cs = string;
 	n = 0;
@@ -350,11 +358,6 @@ number(long big)
 		n *= 1024;
 		continue;
 
-/*	case 'w':
-		n *= sizeof(int);
-		continue;
-*/
-
 	case 'b':
 		n *= 512;
 		continue;
@@ -362,11 +365,11 @@ number(long big)
 /*	case '*':*/
 	case 'x':
 		string = cs;
-		n *= number(BIG);
+		n *= number(VBIG);
 
 	case '\0':
-		if(n>=big || n<0) {
-			fprint(2, "dd: argument %lld out of range\n", n);
+		if(n > big) {
+			fprint(2, "dd: argument %llud out of range\n", n);
 			exits("range");
 		}
 		return n;

+ 2 - 1
sys/src/cmd/mount.c

@@ -4,6 +4,7 @@
 
 void	usage(void);
 void	catch(void*, char*);
+
 char *keyspec = "";
 
 int
@@ -105,6 +106,6 @@ catch(void *x, char *m)
 void
 usage(void)
 {
-	fprint(2, "usage: mount [-a|-b] [-cnrq] [-k keypattern] /srv/service dir [spec]\n");
+	fprint(2, "usage: mount [-a|-b] [-cnq] [-k keypattern] /srv/service dir [spec]\n");
 	exits("usage");
 }