Browse Source

Plan 9 from Bell Labs 2008-05-28

David du Colombier 12 years ago
parent
commit
e2de7e05a4

+ 25 - 24
dist/replica/_plan9.db

@@ -1,17 +1,18 @@
 386 - 20000000775 sys sys 1010957353 0
-386/9load - 775 sys sys 1199773340 338424
-386/9loaddebug - 775 sys sys 1199773344 452196
-386/9loadlite - 775 sys sys 1199773342 161880
-386/9loadlitedebug - 775 sys sys 1199773345 237979
-386/9pc - 775 sys sys 1204234986 2108860
-386/9pc.gz - 664 sys sys 1204235000 902572
-386/9pccpu - 775 sys sys 1204235039 2235277
-386/9pccpu.gz - 664 sys sys 1204235053 916661
-386/9pcdisk - 775 sys sys 1204235093 2304320
-386/9pcdisk.gz - 664 sys sys 1204235109 979802
-386/9pcf - 775 sys sys 1204235159 2969900
-386/9pcf.gz - 664 sys sys 1204235180 1264093
-386/9pxeload - 775 sys sys 1199773341 338432
+386/9load - 775 sys sys 1211923361 340600
+386/9loaddebug - 775 sys sys 1211923364 454856
+386/9loadlite - 775 sys sys 1211923363 163376
+386/9loadlitedebug - 775 sys sys 1211923364 239871
+386/9pc - 775 sys sys 1211924417 2130755
+386/9pc.gz - 664 sys sys 1211924417 912864
+386/9pccpu - 775 sys sys 1211924426 2245510
+386/9pccpu.gz - 664 sys sys 1211924426 921192
+386/9pcdisk - 775 sys sys 1211924484 2326154
+386/9pcdisk.gz - 664 sys sys 1211924484 990096
+386/9pcf - 775 sys sys 1211924445 2991860
+386/9pcf.gz - 664 sys sys 1211924445 1273236
+386/9pxeload - 775 sys sys 1211923362 340604
+386/9pxeloaddebug - 775 sys sys 1211923363 454867
 386/bin - 20000000775 sys sys 1018897690 0
 386/bin/8a - 775 sys sys 1209614029 116545
 386/bin/8c - 775 sys sys 1209614036 367225
@@ -176,7 +177,7 @@
 386/bin/calendar - 775 sys sys 1209614208 79071
 386/bin/cat - 775 sys sys 1148500611 37482
 386/bin/cb - 775 sys sys 1209614209 77569
-386/bin/cdfs - 775 sys sys 1211657559 174464
+386/bin/cdfs - 775 sys sys 1211916033 174926
 386/bin/cec - 775 sys sys 1193714267 75896
 386/bin/cfs - 775 sys sys 1190863294 130565
 386/bin/chgrp - 775 sys sys 1168402294 59522
@@ -7732,7 +7733,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 1211778510 5082
+sys/man/4/cdfs - 664 sys sys 1211917385 5263
 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
@@ -8123,7 +8124,7 @@ sys/src/9/pc/ether8003.c - 664 sys sys 1015014516 6665
 sys/src/9/pc/ether8139.c - 664 sys sys 1185650567 19974
 sys/src/9/pc/ether8169.c - 664 sys sys 1185812348 26931
 sys/src/9/pc/ether82543gc.c - 664 sys sys 1131290377 32294
-sys/src/9/pc/ether82557.c - 664 sys sys 1191886292 30411
+sys/src/9/pc/ether82557.c - 664 sys sys 1211922643 30457
 sys/src/9/pc/ether82563.c - 664 sys sys 1200342471 37076
 sys/src/9/pc/ether82598.c - 664 sys sys 1203982856 18364
 sys/src/9/pc/ether83815.c - 664 sys sys 1172259521 26346
@@ -8188,8 +8189,8 @@ sys/src/9/pc/screen.c - 664 sys sys 1184522395 13973
 sys/src/9/pc/screen.h - 664 sys sys 1147023549 4256
 sys/src/9/pc/sd53c8xx.c - 664 sys sys 1211521147 55313
 sys/src/9/pc/sd53c8xx.n - 664 sys sys 1131290556 12657
-sys/src/9/pc/sdata.c - 664 sys sys 1205986828 53185
-sys/src/9/pc/sdiahci.c - 664 sys sys 1200348596 38496
+sys/src/9/pc/sdata.c - 664 sys sys 1211924368 53297
+sys/src/9/pc/sdiahci.c - 664 sys sys 1211924442 38699
 sys/src/9/pc/sdmv50xx.c - 664 sys sys 1204232564 34031
 sys/src/9/pc/sdmylex.c - 664 sys sys 1189229947 28395
 sys/src/9/pc/sdscsi.c - 664 sys sys 1186618532 7957
@@ -9205,7 +9206,7 @@ sys/src/boot/pc/ether79c970.c - 664 sys sys 1015007950 11717
 sys/src/boot/pc/ether8003.c - 664 sys sys 1015007950 6446
 sys/src/boot/pc/ether8139.c - 664 sys sys 1121393459 14823
 sys/src/boot/pc/ether8169.c - 664 sys sys 1204324647 21870
-sys/src/boot/pc/ether82557.c - 664 sys sys 1140802406 19090
+sys/src/boot/pc/ether82557.c - 664 sys sys 1211922647 19136
 sys/src/boot/pc/ether82563.c - 664 sys sys 1209184829 26037
 sys/src/boot/pc/ether83815.c - 664 sys sys 1144961190 21993
 sys/src/boot/pc/ether8390.c - 664 sys sys 1112382847 16209
@@ -9251,9 +9252,9 @@ sys/src/boot/pc/sd.h - 664 sys sys 1200690169 2249
 sys/src/boot/pc/sd53c8xx.c - 664 sys sys 1186031515 52082
 sys/src/boot/pc/sd53c8xx.i - 664 sys sys 1015007955 27245
 sys/src/boot/pc/sdaoe.c - 664 sys sys 1204324647 11381
-sys/src/boot/pc/sdata.c - 664 sys sys 1199911580 38891
+sys/src/boot/pc/sdata.c - 664 sys sys 1211924337 39003
 sys/src/boot/pc/sdbios.c - 664 sys sys 1194145651 3282
-sys/src/boot/pc/sdiahci.c - 664 sys sys 1200349145 28259
+sys/src/boot/pc/sdiahci.c - 664 sys sys 1211924350 28355
 sys/src/boot/pc/sdmylex.c - 664 sys sys 1171783051 28694
 sys/src/boot/pc/sdscsi.c - 664 sys sys 1144961224 7006
 sys/src/boot/pc/trap.c - 664 sys sys 1193167011 7497
@@ -10035,9 +10036,9 @@ sys/src/cmd/cdfs - 20000000775 sys sys 1039727558 0
 sys/src/cmd/cdfs/buf.c - 664 sys sys 1211848647 2010
 sys/src/cmd/cdfs/dat.h - 664 sys sys 1211846577 5594
 sys/src/cmd/cdfs/fns.h - 664 sys sys 1211848622 300
-sys/src/cmd/cdfs/main.c - 664 sys sys 1211854425 12465
+sys/src/cmd/cdfs/main.c - 664 sys sys 1211917389 12543
 sys/src/cmd/cdfs/mkfile - 664 sys sys 1204937991 153
-sys/src/cmd/cdfs/mmc.c - 664 sys sys 1211854436 33195
+sys/src/cmd/cdfs/mmc.c - 664 sys sys 1211863503 33393
 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
@@ -13614,7 +13615,7 @@ sys/src/cmd/telco/mkfile - 664 sys sys 944961290 201
 sys/src/cmd/telco/telco.c - 664 sys sys 1021579996 26253
 sys/src/cmd/telco/telcodata - 775 sys sys 944961290 95
 sys/src/cmd/telco/telcofax - 664 sys sys 944961289 30
-sys/src/cmd/test.c - 664 sys sys 1164660299 5754
+sys/src/cmd/test.c - 664 sys sys 1211912897 5681
 sys/src/cmd/time.c - 664 sys sys 1014926662 1546
 sys/src/cmd/tlsclient.c - 664 sys sys 1024375149 1631
 sys/src/cmd/tlssrv.c - 664 sys sys 1161442158 3480

+ 25 - 24
dist/replica/plan9.db

@@ -1,17 +1,18 @@
 386 - 20000000775 sys sys 1010957353 0
-386/9load - 775 sys sys 1199773340 338424
-386/9loaddebug - 775 sys sys 1199773344 452196
-386/9loadlite - 775 sys sys 1199773342 161880
-386/9loadlitedebug - 775 sys sys 1199773345 237979
-386/9pc - 775 sys sys 1204234986 2108860
-386/9pc.gz - 664 sys sys 1204235000 902572
-386/9pccpu - 775 sys sys 1204235039 2235277
-386/9pccpu.gz - 664 sys sys 1204235053 916661
-386/9pcdisk - 775 sys sys 1204235093 2304320
-386/9pcdisk.gz - 664 sys sys 1204235109 979802
-386/9pcf - 775 sys sys 1204235159 2969900
-386/9pcf.gz - 664 sys sys 1204235180 1264093
-386/9pxeload - 775 sys sys 1199773341 338432
+386/9load - 775 sys sys 1211923361 340600
+386/9loaddebug - 775 sys sys 1211923364 454856
+386/9loadlite - 775 sys sys 1211923363 163376
+386/9loadlitedebug - 775 sys sys 1211923364 239871
+386/9pc - 775 sys sys 1211924417 2130755
+386/9pc.gz - 664 sys sys 1211924417 912864
+386/9pccpu - 775 sys sys 1211924426 2245510
+386/9pccpu.gz - 664 sys sys 1211924426 921192
+386/9pcdisk - 775 sys sys 1211924484 2326154
+386/9pcdisk.gz - 664 sys sys 1211924484 990096
+386/9pcf - 775 sys sys 1211924445 2991860
+386/9pcf.gz - 664 sys sys 1211924445 1273236
+386/9pxeload - 775 sys sys 1211923362 340604
+386/9pxeloaddebug - 775 sys sys 1211923363 454867
 386/bin - 20000000775 sys sys 1018897690 0
 386/bin/8a - 775 sys sys 1209614029 116545
 386/bin/8c - 775 sys sys 1209614036 367225
@@ -176,7 +177,7 @@
 386/bin/calendar - 775 sys sys 1209614208 79071
 386/bin/cat - 775 sys sys 1148500611 37482
 386/bin/cb - 775 sys sys 1209614209 77569
-386/bin/cdfs - 775 sys sys 1211657559 174464
+386/bin/cdfs - 775 sys sys 1211916033 174926
 386/bin/cec - 775 sys sys 1193714267 75896
 386/bin/cfs - 775 sys sys 1190863294 130565
 386/bin/chgrp - 775 sys sys 1168402294 59522
@@ -7732,7 +7733,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 1211778510 5082
+sys/man/4/cdfs - 664 sys sys 1211917385 5263
 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
@@ -8123,7 +8124,7 @@ sys/src/9/pc/ether8003.c - 664 sys sys 1015014516 6665
 sys/src/9/pc/ether8139.c - 664 sys sys 1185650567 19974
 sys/src/9/pc/ether8169.c - 664 sys sys 1185812348 26931
 sys/src/9/pc/ether82543gc.c - 664 sys sys 1131290377 32294
-sys/src/9/pc/ether82557.c - 664 sys sys 1191886292 30411
+sys/src/9/pc/ether82557.c - 664 sys sys 1211922643 30457
 sys/src/9/pc/ether82563.c - 664 sys sys 1200342471 37076
 sys/src/9/pc/ether82598.c - 664 sys sys 1203982856 18364
 sys/src/9/pc/ether83815.c - 664 sys sys 1172259521 26346
@@ -8188,8 +8189,8 @@ sys/src/9/pc/screen.c - 664 sys sys 1184522395 13973
 sys/src/9/pc/screen.h - 664 sys sys 1147023549 4256
 sys/src/9/pc/sd53c8xx.c - 664 sys sys 1211521147 55313
 sys/src/9/pc/sd53c8xx.n - 664 sys sys 1131290556 12657
-sys/src/9/pc/sdata.c - 664 sys sys 1205986828 53185
-sys/src/9/pc/sdiahci.c - 664 sys sys 1200348596 38496
+sys/src/9/pc/sdata.c - 664 sys sys 1211924368 53297
+sys/src/9/pc/sdiahci.c - 664 sys sys 1211924442 38699
 sys/src/9/pc/sdmv50xx.c - 664 sys sys 1204232564 34031
 sys/src/9/pc/sdmylex.c - 664 sys sys 1189229947 28395
 sys/src/9/pc/sdscsi.c - 664 sys sys 1186618532 7957
@@ -9205,7 +9206,7 @@ sys/src/boot/pc/ether79c970.c - 664 sys sys 1015007950 11717
 sys/src/boot/pc/ether8003.c - 664 sys sys 1015007950 6446
 sys/src/boot/pc/ether8139.c - 664 sys sys 1121393459 14823
 sys/src/boot/pc/ether8169.c - 664 sys sys 1204324647 21870
-sys/src/boot/pc/ether82557.c - 664 sys sys 1140802406 19090
+sys/src/boot/pc/ether82557.c - 664 sys sys 1211922647 19136
 sys/src/boot/pc/ether82563.c - 664 sys sys 1209184829 26037
 sys/src/boot/pc/ether83815.c - 664 sys sys 1144961190 21993
 sys/src/boot/pc/ether8390.c - 664 sys sys 1112382847 16209
@@ -9251,9 +9252,9 @@ sys/src/boot/pc/sd.h - 664 sys sys 1200690169 2249
 sys/src/boot/pc/sd53c8xx.c - 664 sys sys 1186031515 52082
 sys/src/boot/pc/sd53c8xx.i - 664 sys sys 1015007955 27245
 sys/src/boot/pc/sdaoe.c - 664 sys sys 1204324647 11381
-sys/src/boot/pc/sdata.c - 664 sys sys 1199911580 38891
+sys/src/boot/pc/sdata.c - 664 sys sys 1211924337 39003
 sys/src/boot/pc/sdbios.c - 664 sys sys 1194145651 3282
-sys/src/boot/pc/sdiahci.c - 664 sys sys 1200349145 28259
+sys/src/boot/pc/sdiahci.c - 664 sys sys 1211924350 28355
 sys/src/boot/pc/sdmylex.c - 664 sys sys 1171783051 28694
 sys/src/boot/pc/sdscsi.c - 664 sys sys 1144961224 7006
 sys/src/boot/pc/trap.c - 664 sys sys 1193167011 7497
@@ -10035,9 +10036,9 @@ sys/src/cmd/cdfs - 20000000775 sys sys 1039727558 0
 sys/src/cmd/cdfs/buf.c - 664 sys sys 1211848647 2010
 sys/src/cmd/cdfs/dat.h - 664 sys sys 1211846577 5594
 sys/src/cmd/cdfs/fns.h - 664 sys sys 1211848622 300
-sys/src/cmd/cdfs/main.c - 664 sys sys 1211854425 12465
+sys/src/cmd/cdfs/main.c - 664 sys sys 1211917389 12543
 sys/src/cmd/cdfs/mkfile - 664 sys sys 1204937991 153
-sys/src/cmd/cdfs/mmc.c - 664 sys sys 1211854436 33195
+sys/src/cmd/cdfs/mmc.c - 664 sys sys 1211863503 33393
 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
@@ -13614,7 +13615,7 @@ sys/src/cmd/telco/mkfile - 664 sys sys 944961290 201
 sys/src/cmd/telco/telco.c - 664 sys sys 1021579996 26253
 sys/src/cmd/telco/telcodata - 775 sys sys 944961290 95
 sys/src/cmd/telco/telcofax - 664 sys sys 944961289 30
-sys/src/cmd/test.c - 664 sys sys 1164660299 5754
+sys/src/cmd/test.c - 664 sys sys 1211912897 5681
 sys/src/cmd/time.c - 664 sys sys 1014926662 1546
 sys/src/cmd/tlsclient.c - 664 sys sys 1024375149 1631
 sys/src/cmd/tlssrv.c - 664 sys sys 1161442158 3480

+ 26 - 0
dist/replica/plan9.log

@@ -19702,3 +19702,29 @@
 1211850004 2 c sys/src/cmd/cdfs/mmc.c - 664 sys sys 1211848670 33103
 1211855406 0 c sys/src/cmd/cdfs/main.c - 664 sys sys 1211854425 12465
 1211855406 1 c sys/src/cmd/cdfs/mmc.c - 664 sys sys 1211854436 33195
+1211860804 0 c 386/bin/cdfs - 775 sys sys 1211859101 174704
+1211864407 0 c sys/src/cmd/cdfs/mmc.c - 664 sys sys 1211863503 33393
+1211913004 0 c sys/src/cmd/test.c - 664 sys sys 1211912897 5681
+1211916605 0 c 386/bin/cdfs - 775 sys sys 1211916033 174926
+1211918405 0 c sys/man/4/cdfs - 664 sys sys 1211917385 5263
+1211918405 1 c sys/src/cmd/cdfs/main.c - 664 sys sys 1211917389 12543
+1211923804 0 c sys/src/9/pc/ether82557.c - 664 sys sys 1211922643 30457
+1211923804 1 c sys/src/boot/pc/ether82557.c - 664 sys sys 1211922647 19136
+1211925604 0 c 386/9load - 775 sys sys 1211923361 340600
+1211925604 1 c 386/9loaddebug - 775 sys sys 1211923364 454856
+1211925604 2 c 386/9loadlite - 775 sys sys 1211923363 163376
+1211925604 3 c 386/9loadlitedebug - 775 sys sys 1211923364 239871
+1211925604 4 c 386/9pc - 775 sys sys 1211924417 2130755
+1211925604 5 c 386/9pc.gz - 664 sys sys 1211924417 912864
+1211925604 6 c 386/9pccpu - 775 sys sys 1211924426 2245510
+1211925604 7 c 386/9pccpu.gz - 664 sys sys 1211924426 921192
+1211925604 8 c 386/9pcdisk - 775 sys sys 1211924484 2326154
+1211925604 9 c 386/9pcdisk.gz - 664 sys sys 1211924484 990096
+1211925604 10 c 386/9pcf - 775 sys sys 1211924445 2991860
+1211925604 11 c 386/9pcf.gz - 664 sys sys 1211924445 1273236
+1211925604 12 c 386/9pxeload - 775 sys sys 1211923362 340604
+1211925604 13 a 386/9pxeloaddebug - 775 sys sys 1211923363 454867
+1211925604 14 c sys/src/9/pc/sdata.c - 664 sys sys 1211924368 53297
+1211925604 15 c sys/src/9/pc/sdiahci.c - 664 sys sys 1211924442 38699
+1211925604 16 c sys/src/boot/pc/sdata.c - 664 sys sys 1211924337 39003
+1211925604 17 c sys/src/boot/pc/sdiahci.c - 664 sys sys 1211924350 28355

+ 16 - 3
sys/man/4/cdfs

@@ -100,7 +100,7 @@ also contains a
 file, into which control messages
 may be echoed.
 The current control messages are:
-.TF "\fLquickblan"
+.TF \fLformat
 .TP
 .B format
 Format the rewritable disc (\c
@@ -126,8 +126,21 @@ Eject the disc in the drive.
 .B ingest
 Ingest a disc into the drive.
 .TP
-.B speed \fIkpbs\fR
-Set the reading and writing speed to use.
+.B speed \fIkbps\fR
+Set the reading and writing speed to use,
+in units of 1,000-bytes-per-second.
+A value of
+.L best
+requests the optimal speed for the current drive and disc.
+CD
+.L 1x
+speed is 154;
+DVD
+.L 1x
+speed is 1350;
+BD
+.L 1x
+speed is 4608.
 Drives may round down the speed to one they support.
 To set reading and writing speeds separately,
 prefix the speeds with

+ 1 - 0
sys/src/9/pc/ether82557.c

@@ -937,6 +937,7 @@ i82557pci(void)
 		case 0x103D:		/* Intel 82562 PRO/100 VE */
 		case 0x1064:		/* Intel 82562 PRO/100 VE */
 		case 0x2449:		/* Intel 82562ET */
+		case 0x27DC:		/* Intel 82801G PRO/100 VE */
 			nop = 1;
 			/*FALLTHROUGH*/
 		case 0x1209:		/* Intel 82559ER */

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

@@ -2018,6 +2018,8 @@ atapnp(void)
 		case (0x24CB<<16)|0x8086:	/* 82801DB (ICH4, High-End) */
 		case (0x24DB<<16)|0x8086:	/* 82801EB (ICH5) */
 		case (0x266F<<16)|0x8086:	/* 82801FB (ICH6) */
+		case (0x27DF<<16)|0x8086:	/* 82801G SATA (ICH7) */
+		case (0x27C0<<16)|0x8086:	/* 82801GB SATA AHCI (ICH7) */
 		case (0x27C4<<16)|0x8086:	/* 82801GBM SATA (ICH7) */
 		case (0x27C5<<16)|0x8086:	/* 82801GBM SATA AHCI (ICH7) */
 			break;

+ 7 - 2
sys/src/9/pc/sdiahci.c

@@ -1844,8 +1844,13 @@ loop:
 		/* 0x27c4 is the intel 82801 in compatibility (not sata) mode */
 		if(p->vid == 0x8086 && (p->did & 0xfffc) == 0x2680)
 			type = Tesb;
-		else if(p->vid == 0x8086 && p->did == 0x27c5)
-			type = Tich;	/* 82801g[bh]m; compat mode fails */
+		else if(p->vid == 0x8086 &&
+		    (p->did == 0x27c5 || p->did == 0x27c0))
+			type = Tich;	/* 82801g[bh]m?; compat mode fails */
+		else if(p->vid == 0x8086 && (p->did & 0xfeff) == 0x2829)
+			type = Tich;		/* ich8 */
+		else if(p->vid == 0x8086 && (p->did & 0xfffe) == 0x2922)
+			type = Tich;		/* ich8 */
 		else if(p->vid == 0x1002 && p->did == 0x4380)
 			type = Tsb600;
 		else

+ 1 - 0
sys/src/boot/pc/ether82557.c

@@ -557,6 +557,7 @@ i82557pci(void)
 		case 0x103A:		/* Intel 82562 PRO/100 VE */
 		case 0x1064:		/* Intel 82562 PRO/100 VE */
 		case 0x2449:		/* Intel 82562ET */
+		case 0x27DC:		/* Intel 82801G PRO/100 VE */
 		case 0x1209:		/* Intel 82559ER */
 		case 0x1229:		/* Intel 8255[789] */
 		case 0x1030:		/* Intel 82559 InBusiness 10/100  */

+ 2 - 0
sys/src/boot/pc/sdata.c

@@ -1538,6 +1538,8 @@ atapnp(void)
 		case (0x24CB<<16)|0x8086:	/* 82801DB (ICH4, High-End) */
 		case (0x24DB<<16)|0x8086:	/* 82801EB (ICH5) */
 		case (0x266F<<16)|0x8086:	/* 82801FB (ICH6) */
+		case (0x27DF<<16)|0x8086:	/* 82801G SATA (ICH7) */
+		case (0x27C0<<16)|0x8086:	/* 82801GB SATA AHCI (ICH7) */
 		case (0x27C4<<16)|0x8086:	/* 82801GBM SATA (ICH7) */
 		case (0x27C5<<16)|0x8086:	/* 82801GBM SATA AHCI (ICH7) */
 			break;

+ 4 - 2
sys/src/boot/pc/sdiahci.c

@@ -1536,10 +1536,12 @@ iapnp(void)
 	head = tail = nil;
 loop:
 	while((p = pcimatch(p, 0, 0)) != nil){
+		/* 0x27c4 is the intel 82801 in compatibility (not sata) mode */
 		if(p->vid == 0x8086 && (p->did & 0xfffc) == 0x2680)
 			type = Tesb;
-		else if(p->vid == 0x8086 && p->did == 0x27c5)
-			type = Tich;	/* 82801g[bh]m; compat mode fails */
+		else if(p->vid == 0x8086 &&
+		    (p->did == 0x27c5 || p->did == 0x27c0))
+			type = Tich;	/* 82801g[bh]m?; compat mode fails */
 		else if(p->vid == 0x8086 && (p->did & 0xfeff) == 0x2829)
 			type = Tich;		/* ich8 */
 		else if(p->vid == 0x8086 && (p->did & 0xfffe) == 0x2922)

+ 8 - 4
sys/src/cmd/cdfs/main.c

@@ -442,7 +442,7 @@ fsread(Req *r)
 	respond(r, nil);
 }
 
-static char *Ebadmsg = "bad cdfs control message";
+static char Ebadmsg[] = "bad cdfs control message";
 
 static char*
 writectl(void *v, long count)
@@ -471,9 +471,13 @@ writectl(void *v, long count)
 					return Ebadmsg;
 				what = f[i][0];
 			}else{
-				n = strtol(f[i], &p, 0);
-				if(*p != '\0' || n <= 0)
-					return Ebadmsg;
+				if (strcmp(f[i], "best") == 0)
+					n = (1<<16) - 1;
+				else {
+					n = strtol(f[i], &p, 0);
+					if(*p != '\0' || n <= 0)
+						return Ebadmsg;
+				}
 				switch(what){
 				case 0:
 					if(r >= 0 || w >= 0)

+ 13 - 3
sys/src/cmd/cdfs/mmc.c

@@ -334,12 +334,17 @@ mmcgetspeed(Drive *drive)
 
 	memset(buf, 0, 22);
 	n = mmcgetpage(drive, Pagcapmechsts, buf);	/* legacy page */
+	if (n < 22) {
+		if (vflag)
+			fprint(2, "no Pagcapmechsts mode page!\n");
+		return;
+	}
 	maxread =   (buf[8]<<8)|buf[9];
 	curread =  (buf[14]<<8)|buf[15];
 	maxwrite = (buf[18]<<8)|buf[19];
 	curwrite = (buf[20]<<8)|buf[21];
 
-	if(n < 22 || (maxread && maxread < 170) || (curread && curread < 170))
+	if(maxread && maxread < 170 || curread && curread < 170)
 		return;			/* bogus data */
 
 	drive->readspeed = curread;
@@ -409,7 +414,9 @@ mmcprobe(Scsi *scsi)
 	else if(mmcgetpage6(drive, Pagcapmechsts, buf) >= 0)
 		aux->pagecmdsz = 6;
 	else {
-		werrstr("can't read mode page %d", Pagcapmechsts);
+		if (vflag)
+			fprint(2, "no Pagcapmechsts mode page!\n");
+		werrstr("can't read mode page %d!", Pagcapmechsts);
 		free(aux);
 		free(drive);
 		return nil;
@@ -432,8 +439,11 @@ mmcprobe(Scsi *scsi)
 		cap |= Cwrite;
 		if (vflag)
 			fprint(2, "mmcprobe: got page 5, assuming drive can write\n");
-	} else
+	} else {
+		if (vflag)
+			fprint(2, "no Pagwrparams mode page!\n");
 		cap &= ~Cwrite;
+	}
 	drive->cap = cap;
 
 	mmcgetspeed(drive);

+ 70 - 79
sys/src/cmd/test.c

@@ -228,92 +228,69 @@ tio(char *a, int f)
 	return access (a, f) >= 0;
 }
 
-/* copy to local memory; clear names for safety */
-int
-localstat(char *f, Dir *dir)
-{
-	Dir *d;
-
-	d = dirstat(f);
-	if(d == nil)
-		return(-1);
-	*dir = *d;
-	free(d);
-	dir->name = 0;
-	dir->uid = 0;
-	dir->gid = 0;
-	dir->muid = 0;
-	return 0;
-}
-
-/* copy to local memory; clear names for safety */
-int
-localfstat(int f, Dir *dir)
-{
-	Dir *d;
-
-	d = dirfstat(f);
-	if(d == nil)
-		return(-1);
-	*dir = *d;
-	free(d);
-	dir->name = 0;
-	dir->uid = 0;
-	dir->gid = 0;
-	dir->muid = 0;
-	return 0;
-}
+/*
+ * note that the name strings pointed to by Dir members are
+ * allocated with the Dir itself (by the same call to malloc),
+ * but are not included in sizeof(Dir), so copying a Dir won't
+ * copy the strings it points to.
+ */
 
 int
 hasmode(char *f, ulong m)
 {
-	Dir dir;
+	int r;
+	Dir *dir;
 
-	if(localstat(f,&dir)<0)
-		return(0);
-	return(dir.mode&m);
+	dir = dirstat(f);
+	if (dir == nil)
+		return 0;
+	r = (dir->mode & m) != 0;
+	free(dir);
+	return r;
 }
 
 int
 isdir(char *f)
 {
-	Dir dir;
-
-	if(localstat(f,&dir)<0)
-		return(0);
-	return(dir.mode&DMDIR);
+	return hasmode(f, DMDIR);
 }
 
 int
 isreg(char *f)
 {
-	Dir dir;
-
-	if(localstat(f,&dir)<0)
-		return(0);
-	return(!(dir.mode&DMDIR));
+	return !isdir(f);
 }
 
 int
 isatty(int fd)
 {
-	Dir d1, d2;
-
-	if(localfstat(fd, &d1) < 0)
-		return 0;
-	if(localstat("/dev/cons", &d2) < 0)
-		return 0;
-	return d1.type==d2.type && d1.dev==d2.dev && d1.qid.path==d2.qid.path;
+	int r;
+	Dir *d1, *d2;
+
+	d1 = dirfstat(fd);
+	d2 = dirstat("/dev/cons");
+	if (d1 == nil || d2 == nil)
+		r = 0;
+	else
+		r = d1->type == d2->type && d1->dev == d2->dev &&
+			d1->qid.path == d2->qid.path;
+	free(d1);
+	free(d2);
+	return r;
 }
 
 int
 fsizep(char *f)
 {
-	Dir dir;
+	int r;
+	Dir *dir;
 
-	if(localstat(f,&dir)<0)
-		return(0);
-	return(dir.length>0);
+	dir = dirstat(f);
+	if (dir == nil)
+		return 0;
+	r = dir->length > 0;
+	free(dir);
+	return r;
 }
 
 void
@@ -342,12 +319,14 @@ isint(char *s, int *pans)
 int
 isolder(char *pin, char *f)
 {
-	char *p = pin;
+	int r;
 	ulong n, m;
-	Dir dir;
+	char *p = pin;
+	Dir *dir;
 
-	if(localstat(f,&dir)<0)
-		return(0);
+	dir = dirstat(f);
+	if (dir == nil)
+		return 0;
 
 	/* parse time */
 	n = 0;
@@ -381,29 +360,41 @@ isolder(char *pin, char *f)
 		}
 	}
 
-	return(dir.mtime+n < time(0));
+	r = dir->mtime + n < time(0);
+	free(dir);
+	return r;
 }
 
 int
 isolderthan(char *a, char *b)
 {
-	Dir ad, bd;
-
-	if(localstat(a, &ad)<0)
-		return(0);
-	if(localstat(b, &bd)<0)
-		return(0);
-	return ad.mtime > bd.mtime;
+	int r;
+	Dir *ad, *bd;
+
+	ad = dirstat(a);
+	bd = dirstat(b);
+	if (ad == nil || bd == nil)
+		r = 0;
+	else
+		r = ad->mtime > bd->mtime;
+	free(ad);
+	free(bd);
+	return r;
 }
 
 int
 isnewerthan(char *a, char *b)
 {
-	Dir ad, bd;
-
-	if(localstat(a, &ad)<0)
-		return(0);
-	if(localstat(b, &bd)<0)
-		return(0);
-	return ad.mtime < bd.mtime;
+	int r;
+	Dir *ad, *bd;
+
+	ad = dirstat(a);
+	bd = dirstat(b);
+	if (ad == nil || bd == nil)
+		r = 0;
+	else
+		r = ad->mtime < bd->mtime;
+	free(ad);
+	free(bd);
+	return r;
 }