Browse Source

Plan 9 from Bell Labs 2006-04-25

David du Colombier 15 years ago
parent
commit
45379a0ad9

+ 9 - 9
dist/replica/_plan9.db

@@ -149,7 +149,7 @@
 386/bin/aux/trampoline - 775 sys sys 1144688920 84240
 386/bin/aux/typepasswd - 775 sys sys 1143777767 69833
 386/bin/aux/usage - 775 sys sys 1143777768 59904
-386/bin/aux/vga - 775 sys sys 1144688921 335018
+386/bin/aux/vga - 775 sys sys 1145933837 335827
 386/bin/aux/vmmousepoll - 775 sys sys 1032480572 41434
 386/bin/aux/vmware - 775 sys sys 1049428256 453
 386/bin/aux/vmwarefs - 775 sys sys 1095563640 99117
@@ -7253,7 +7253,7 @@ sys/man/1/acid - 664 sys sys 1134233059 9730
 sys/man/1/acme - 664 sys sys 1134233060 18105
 sys/man/1/ap - 664 sys sys 1068471657 364
 sys/man/1/ar - 664 sys sys 1079397701 3153
-sys/man/1/ascii - 664 sys sys 1134233061 2737
+sys/man/1/ascii - 664 sys sys 1145881662 2726
 sys/man/1/awk - 664 sys sys 1134233061 10881
 sys/man/1/basename - 664 sys sys 944959673 535
 sys/man/1/bc - 664 sys sys 1134233060 3784
@@ -7310,7 +7310,7 @@ sys/man/1/hoc - 664 sys sys 1136378274 2357
 sys/man/1/htmlroff - 664 sys sys 1138396051 1831
 sys/man/1/idiff - 664 sys sys 1113743324 914
 sys/man/1/join - 664 sys sys 1113743324 2561
-sys/man/1/jpg - 664 sys sys 1113743325 4842
+sys/man/1/jpg - 664 sys sys 1145882310 4843
 sys/man/1/kbmap - 664 sys sys 1079969760 845
 sys/man/1/kill - 664 sys sys 1018369246 1193
 sys/man/1/ktrace - 664 sys sys 957920006 1330
@@ -7593,7 +7593,7 @@ sys/man/4/cfs - 664 sys sys 1015024813 1758
 sys/man/4/consolefs - 664 sys sys 1144424854 4245
 sys/man/4/dossrv - 664 sys sys 1015024813 4176
 sys/man/4/execnet - 664 sys sys 1019866708 1069
-sys/man/4/exportfs - 664 sys sys 1115314261 4653
+sys/man/4/exportfs - 664 sys sys 1145881912 4655
 sys/man/4/ext2srv - 664 sys sys 1055692986 2409
 sys/man/4/factotum - 664 sys sys 1131294573 14841
 sys/man/4/fossil - 664 sys sys 1112368411 9546
@@ -7687,7 +7687,7 @@ sys/man/7/scat - 664 sys sys 970069855 8904
 sys/man/8 - 20000000775 sys sys 1018384448 0
 sys/man/8/0intro - 664 sys sys 944959679 247
 sys/man/8/9load - 664 sys sys 1094676489 9170
-sys/man/8/9pcon - 664 sys sys 1018973955 2226
+sys/man/8/9pcon - 664 sys sys 1145881850 2234
 sys/man/8/INDEX - 664 sys sys 1141357442 2768
 sys/man/8/INDEX.html - 664 sys sys 1141352367 8470
 sys/man/8/aan - 664 sys sys 1045501064 1670
@@ -7745,7 +7745,7 @@ sys/man/8/stats - 664 sys sys 1067722908 4291
 sys/man/8/statusbar - 664 sys sys 1141313214 1253
 sys/man/8/stub - 664 sys sys 1044830500 943
 sys/man/8/swap - 664 sys sys 944959679 880
-sys/man/8/timesync - 664 sys sys 1107606876 1717
+sys/man/8/timesync - 664 sys sys 1145882352 1717
 sys/man/8/tlssrv - 664 sys sys 1037580152 2594
 sys/man/8/trampoline - 664 sys sys 1126104844 1199
 sys/man/8/udpecho - 664 sys sys 954305553 303
@@ -8047,7 +8047,7 @@ sys/src/9/pc/vgamach64xx.c - 664 sys sys 1131290601 28257
 sys/src/9/pc/vgamga2164w.c - 664 sys sys 1132331257 4769
 sys/src/9/pc/vgamga4xx.c - 664 sys sys 1143927896 9573
 sys/src/9/pc/vganeomagic.c - 664 sys sys 1131422294 10255
-sys/src/9/pc/vganvidia.c - 664 sys sys 1137689150 12395
+sys/src/9/pc/vganvidia.c - 664 sys sys 1145906148 12373
 sys/src/9/pc/vgargb524.c - 664 sys sys 1131290602 4251
 sys/src/9/pc/vgas3.c - 664 sys sys 1131290603 10994
 sys/src/9/pc/vgasavage.c - 664 sys sys 1064679984 16251
@@ -9713,7 +9713,7 @@ sys/src/cmd/aux/vga/mga4xx.c - 664 sys sys 1143927895 36098
 sys/src/cmd/aux/vga/mkfile - 664 sys sys 1115734903 927
 sys/src/cmd/aux/vga/neomagic.c - 664 sys sys 1104430499 8975
 sys/src/cmd/aux/vga/notes.txt - 664 sys sys 1028334647 14376
-sys/src/cmd/aux/vga/nvidia.c - 664 sys sys 1140615970 31488
+sys/src/cmd/aux/vga/nvidia.c - 664 sys sys 1145906420 33115
 sys/src/cmd/aux/vga/palette.c - 664 sys sys 1014925010 2201
 sys/src/cmd/aux/vga/pci.c - 664 sys sys 1014925011 8659
 sys/src/cmd/aux/vga/pci.h - 664 sys sys 1014925011 3290
@@ -13394,7 +13394,7 @@ sys/src/cmd/tcs/misc.h - 664 sys sys 1138382780 19274
 sys/src/cmd/tcs/mkfile - 664 sys sys 1143673021 601
 sys/src/cmd/tcs/ms.h - 664 sys sys 1138382780 44069
 sys/src/cmd/tcs/plan9.h - 664 sys sys 944961287 751
-sys/src/cmd/tcs/tcs.c - 664 sys sys 1143727175 19206
+sys/src/cmd/tcs/tcs.c - 664 sys sys 1145881809 19215
 sys/src/cmd/tcs/tune.c - 664 sys sys 1143723685 6283
 sys/src/cmd/tcs/utf.c - 664 sys sys 1143673021 7975
 sys/src/cmd/tee.c - 664 sys sys 954970286 1062

+ 9 - 9
dist/replica/plan9.db

@@ -149,7 +149,7 @@
 386/bin/aux/trampoline - 775 sys sys 1144688920 84240
 386/bin/aux/typepasswd - 775 sys sys 1143777767 69833
 386/bin/aux/usage - 775 sys sys 1143777768 59904
-386/bin/aux/vga - 775 sys sys 1144688921 335018
+386/bin/aux/vga - 775 sys sys 1145933837 335827
 386/bin/aux/vmmousepoll - 775 sys sys 1032480572 41434
 386/bin/aux/vmware - 775 sys sys 1049428256 453
 386/bin/aux/vmwarefs - 775 sys sys 1095563640 99117
@@ -7253,7 +7253,7 @@ sys/man/1/acid - 664 sys sys 1134233059 9730
 sys/man/1/acme - 664 sys sys 1134233060 18105
 sys/man/1/ap - 664 sys sys 1068471657 364
 sys/man/1/ar - 664 sys sys 1079397701 3153
-sys/man/1/ascii - 664 sys sys 1134233061 2737
+sys/man/1/ascii - 664 sys sys 1145881662 2726
 sys/man/1/awk - 664 sys sys 1134233061 10881
 sys/man/1/basename - 664 sys sys 944959673 535
 sys/man/1/bc - 664 sys sys 1134233060 3784
@@ -7310,7 +7310,7 @@ sys/man/1/hoc - 664 sys sys 1136378274 2357
 sys/man/1/htmlroff - 664 sys sys 1138396051 1831
 sys/man/1/idiff - 664 sys sys 1113743324 914
 sys/man/1/join - 664 sys sys 1113743324 2561
-sys/man/1/jpg - 664 sys sys 1113743325 4842
+sys/man/1/jpg - 664 sys sys 1145882310 4843
 sys/man/1/kbmap - 664 sys sys 1079969760 845
 sys/man/1/kill - 664 sys sys 1018369246 1193
 sys/man/1/ktrace - 664 sys sys 957920006 1330
@@ -7593,7 +7593,7 @@ sys/man/4/cfs - 664 sys sys 1015024813 1758
 sys/man/4/consolefs - 664 sys sys 1144424854 4245
 sys/man/4/dossrv - 664 sys sys 1015024813 4176
 sys/man/4/execnet - 664 sys sys 1019866708 1069
-sys/man/4/exportfs - 664 sys sys 1115314261 4653
+sys/man/4/exportfs - 664 sys sys 1145881912 4655
 sys/man/4/ext2srv - 664 sys sys 1055692986 2409
 sys/man/4/factotum - 664 sys sys 1131294573 14841
 sys/man/4/fossil - 664 sys sys 1112368411 9546
@@ -7687,7 +7687,7 @@ sys/man/7/scat - 664 sys sys 970069855 8904
 sys/man/8 - 20000000775 sys sys 1018384448 0
 sys/man/8/0intro - 664 sys sys 944959679 247
 sys/man/8/9load - 664 sys sys 1094676489 9170
-sys/man/8/9pcon - 664 sys sys 1018973955 2226
+sys/man/8/9pcon - 664 sys sys 1145881850 2234
 sys/man/8/INDEX - 664 sys sys 1141357442 2768
 sys/man/8/INDEX.html - 664 sys sys 1141352367 8470
 sys/man/8/aan - 664 sys sys 1045501064 1670
@@ -7745,7 +7745,7 @@ sys/man/8/stats - 664 sys sys 1067722908 4291
 sys/man/8/statusbar - 664 sys sys 1141313214 1253
 sys/man/8/stub - 664 sys sys 1044830500 943
 sys/man/8/swap - 664 sys sys 944959679 880
-sys/man/8/timesync - 664 sys sys 1107606876 1717
+sys/man/8/timesync - 664 sys sys 1145882352 1717
 sys/man/8/tlssrv - 664 sys sys 1037580152 2594
 sys/man/8/trampoline - 664 sys sys 1126104844 1199
 sys/man/8/udpecho - 664 sys sys 954305553 303
@@ -8047,7 +8047,7 @@ sys/src/9/pc/vgamach64xx.c - 664 sys sys 1131290601 28257
 sys/src/9/pc/vgamga2164w.c - 664 sys sys 1132331257 4769
 sys/src/9/pc/vgamga4xx.c - 664 sys sys 1143927896 9573
 sys/src/9/pc/vganeomagic.c - 664 sys sys 1131422294 10255
-sys/src/9/pc/vganvidia.c - 664 sys sys 1137689150 12395
+sys/src/9/pc/vganvidia.c - 664 sys sys 1145906148 12373
 sys/src/9/pc/vgargb524.c - 664 sys sys 1131290602 4251
 sys/src/9/pc/vgas3.c - 664 sys sys 1131290603 10994
 sys/src/9/pc/vgasavage.c - 664 sys sys 1064679984 16251
@@ -9713,7 +9713,7 @@ sys/src/cmd/aux/vga/mga4xx.c - 664 sys sys 1143927895 36098
 sys/src/cmd/aux/vga/mkfile - 664 sys sys 1115734903 927
 sys/src/cmd/aux/vga/neomagic.c - 664 sys sys 1104430499 8975
 sys/src/cmd/aux/vga/notes.txt - 664 sys sys 1028334647 14376
-sys/src/cmd/aux/vga/nvidia.c - 664 sys sys 1140615970 31488
+sys/src/cmd/aux/vga/nvidia.c - 664 sys sys 1145906420 33115
 sys/src/cmd/aux/vga/palette.c - 664 sys sys 1014925010 2201
 sys/src/cmd/aux/vga/pci.c - 664 sys sys 1014925011 8659
 sys/src/cmd/aux/vga/pci.h - 664 sys sys 1014925011 3290
@@ -13394,7 +13394,7 @@ sys/src/cmd/tcs/misc.h - 664 sys sys 1138382780 19274
 sys/src/cmd/tcs/mkfile - 664 sys sys 1143673021 601
 sys/src/cmd/tcs/ms.h - 664 sys sys 1138382780 44069
 sys/src/cmd/tcs/plan9.h - 664 sys sys 944961287 751
-sys/src/cmd/tcs/tcs.c - 664 sys sys 1143727175 19206
+sys/src/cmd/tcs/tcs.c - 664 sys sys 1145881809 19215
 sys/src/cmd/tcs/tune.c - 664 sys sys 1143723685 6283
 sys/src/cmd/tcs/utf.c - 664 sys sys 1143673021 7975
 sys/src/cmd/tee.c - 664 sys sys 954970286 1062

+ 9 - 0
dist/replica/plan9.log

@@ -29516,3 +29516,12 @@
 1145509257 0 c sys/games/lib/fortunes - 664 sys sys 1145507816 258670
 1145554271 0 c sys/games/lib/fortunes - 664 sys sys 1145553099 258781
 1145777424 0 c sys/games/lib/fortunes - 664 sys sys 1145776709 258931
+1145881858 0 c sys/man/1/ascii - 664 sys sys 1145881662 2726
+1145881858 1 c sys/man/8/9pcon - 664 sys sys 1145881850 2234
+1145881858 2 c sys/src/cmd/tcs/tcs.c - 664 sys sys 1145881809 19215
+1145883658 0 c sys/man/1/jpg - 664 sys sys 1145882310 4843
+1145883658 1 c sys/man/4/exportfs - 664 sys sys 1145881912 4655
+1145883658 2 c sys/man/8/timesync - 664 sys sys 1145882352 1717
+1145907066 0 c sys/src/9/pc/vganvidia.c - 664 sys sys 1145906148 12373
+1145907066 1 c sys/src/cmd/aux/vga/nvidia.c - 664 sys sys 1145906420 33115
+1145934074 0 c 386/bin/aux/vga - 775 sys sys 1145933837 335827

+ 0 - 3
sys/man/1/ascii

@@ -17,9 +17,6 @@ ascii, unicode \- interpret ASCII, Unicode characters
 ]
 .PP
 .B unicode
-[
-.B -nt
-]
 .IB hexmin - hexmax
 .PP
 .B unicode

+ 1 - 1
sys/man/1/jpg

@@ -221,7 +221,7 @@ specified,
 .I ico
 reads from standard input.
 Icon files
-contain sets of icons represeted by an image and a mask.
+contain sets of icons represented by an image and a mask.
 Clicking the right button pops up a menu that lets you
 write any icon's image as a Plan 9 image (\fIwidth\fBx\fIheight\fB.image),
 write any icon's mask as a Plan 9 image (\fIwidth\fBx\fIheight\fB.mask),

+ 3 - 3
sys/man/4/exportfs

@@ -202,9 +202,9 @@ To export the archive of one user for one month, except for secrets,
 .IP
 .EX
 cd /n/dump
-echo '+ ^\.(/2003(/10..(/usr(/glenda/?)?)?)?)?' > /tmp/pattern
-echo '- \.(aes|pgp)$' >> /tmp/pattern
-exportfs -p /tmp/pattern
+echo '+ ^\e.(/2003(/10..(/usr(/glenda/?)?)?)?)?' > /tmp/pattern
+echo '- \e.(aes|pgp)$' >> /tmp/pattern
+exportfs -P /tmp/pattern
 .EE
 .LP
 Use

+ 1 - 1
sys/man/8/9pcon

@@ -150,7 +150,7 @@ For example,
 .EE
 sends a
 .I wstat
-message that attempts to change the group id associated with 
+message that attempts to change the group id associated with fid 101.
 .SH SOURCE
 .B /sys/src/cmd/aux/9pcon.c
 .SH SEE ALSO

+ 1 - 1
sys/man/8/timesync

@@ -93,7 +93,7 @@ options are allowed.
 .TP
 .B -S
 sets the stratum number to
-.IR startum .
+.IR stratum .
 .TP
 .B -l
 turns on logging to

+ 12 - 12
sys/src/9/pc/vganvidia.c

@@ -146,11 +146,11 @@ nvidiaenable(VGAscr* scr)
 		scr->storage = (((tmp >> 4) & 127) + 1) * 1024 * 1024;
 		break;
 	default:
-		q = (void*)((uchar*)scr->mmio + Pfb +  0x020C);
-		tmp = (*q >> 20) & 0xFF;
+		q = (void*)((uchar*)scr->mmio + Pfb + 0x020C);
+		tmp = (*q >> 20) & 0xFFF;
 		if (tmp == 0)
 			tmp = 16;
-		scr->storage =  tmp*1024*1024;
+		scr->storage = tmp*1024*1024;
 		break;
 	}
 }
@@ -294,7 +294,7 @@ nvdmanext(ulong data)
 	nv.dmabase[nv.dmacurrent++] = data;
 }
 
-void 
+void
 nvdmawait(VGAscr *scr, int size)
 {
 	int dmaget;
@@ -318,7 +318,7 @@ nvdmawait(VGAscr *scr, int size)
 				nv.dmacurrent = nv.dmaput = SKIPS;
 				nv.dmafree = dmaget - (SKIPS + 1);
 			}
-		} else 
+		} else
 			nv.dmafree = dmaget - nv.dmacurrent - 1;
 	}
 }
@@ -411,21 +411,21 @@ nvresetgraphics(VGAscr *scr)
 	case 24:
 		surfaceFormat = SURFACE_FORMAT_DEPTH24;
 		patternFormat = PATTERN_FORMAT_DEPTH24;
-		rectFormat    = RECT_FORMAT_DEPTH24;
-		lineFormat    = LINE_FORMAT_DEPTH24;
+		rectFormat = RECT_FORMAT_DEPTH24;
+		lineFormat = LINE_FORMAT_DEPTH24;
 		break;
 	case 16:
 	case 15:
 		surfaceFormat = SURFACE_FORMAT_DEPTH16;
 		patternFormat = PATTERN_FORMAT_DEPTH16;
-		rectFormat    = RECT_FORMAT_DEPTH16;
-		lineFormat    = LINE_FORMAT_DEPTH16;
+		rectFormat = RECT_FORMAT_DEPTH16;
+		lineFormat = LINE_FORMAT_DEPTH16;
 		break;
 	default:
 		surfaceFormat = SURFACE_FORMAT_DEPTH8;
 		patternFormat = PATTERN_FORMAT_DEPTH8;
-		rectFormat    = RECT_FORMAT_DEPTH8;
-		lineFormat    = LINE_FORMAT_DEPTH8;
+		rectFormat = RECT_FORMAT_DEPTH8;
+		lineFormat = LINE_FORMAT_DEPTH8;
 		break;
 	}
 
@@ -452,7 +452,7 @@ nvresetgraphics(VGAscr *scr)
 
 	nvdmastart(scr, ROP_SET, 1);
 	nvdmanext(0xCC);
- 
+
 	nvdmakickoff(scr);
 	waitforidle(scr);
 }

+ 104 - 44
sys/src/cmd/aux/vga/nvidia.c

@@ -158,13 +158,13 @@ snarf(Vga* vga, Ctlr* ctlr)
 		nv->pfb = mmio+0x00100000/4;
 		nv->pramdac = mmio+0x00680000/4;
 		nv->pextdev = mmio+0x00101000/4;
-		nv->pmc	= mmio+0x00000000/4;
+		nv->pmc = mmio+0x00000000/4;
 		nv->ptimer = mmio+0x00009000/4;
 		nv->pfifo = mmio+0x00002000/4;
 		nv->pramin = mmio+0x00710000/4;
 		nv->pgraph = mmio+0x00400000/4;
 		nv->fifo = mmio+0x00800000/4;
-		nv->pcrtc= mmio+0x00600000/4;		
+		nv->pcrtc= mmio+0x00600000/4;
 
 		nv->did = p->did;
 		if ((nv->did & 0xfff0) == 0x00f0)
@@ -175,32 +175,32 @@ snarf(Vga* vga, Ctlr* ctlr)
 		case 0x00A0:
 			nv->arch = 4;
 			break;
-		case 0x0100:   /* GeForce 256 */
-		case 0x0110:   /* GeForce2 MX */
-		case 0x0150:   /* GeForce2 */
-		case 0x0170:   /* GeForce4 MX */
-		case 0x0180:   /* GeForce4 MX (8x AGP) */
-		case 0x01A0:   /* nForce */
-		case 0x01F0:   /* nForce2 */
+		case 0x0100:	/* GeForce 256 */
+		case 0x0110:	/* GeForce2 MX */
+		case 0x0150:	/* GeForce2 */
+		case 0x0170:	/* GeForce4 MX */
+		case 0x0180:	/* GeForce4 MX (8x AGP) */
+		case 0x01A0:	/* nForce */
+		case 0x01F0:	/* nForce2 */
 			nv->arch = 10;
 			break;
-		case 0x0200:   /* GeForce3 */
-		case 0x0250:   /* GeForce4 Ti */
-		case 0x0280:   /* GeForce4 Ti (8x AGP) */
+		case 0x0200:	/* GeForce3 */
+		case 0x0250:	/* GeForce4 Ti */
+		case 0x0280:	/* GeForce4 Ti (8x AGP) */
 			nv->arch = 20;
 			break;
-		case 0x0300:   /* GeForceFX 5800 */
-		case 0x0310:   /* GeForceFX 5600 */
-		case 0x0320:   /* GeForceFX 5200 */
-		case 0x0330:   /* GeForceFX 5900 */
-		case 0x0340:   /* GeForceFX 5700 */
+		case 0x0300:	/* GeForceFX 5800 */
+		case 0x0310:	/* GeForceFX 5600 */
+		case 0x0320:	/* GeForceFX 5200 */
+		case 0x0330:	/* GeForceFX 5900 */
+		case 0x0340:	/* GeForceFX 5700 */
 			nv->arch = 30;
 			break;
 		case 0x0040:
 		case 0x00C0:
 		case 0x0120:
 		case 0x0130:
-		case 0x0140:
+		case 0x0140:	/* GeForce 6600 */
 		case 0x0160:
 		case 0x01D0:
 		case 0x0090:
@@ -342,7 +342,7 @@ snarf(Vga* vga, Ctlr* ctlr)
 
 	nv->vpll = nv->pramdac[0x00000508/4];
 	if (nv->twoheads)
-		nv->vpll2	= nv->pramdac[0x00000520/4];
+		nv->vpll2 = nv->pramdac[0x00000520/4];
 	if (nv->twostagepll) {
 		nv->vpllB = nv->pramdac[0x00000578/4];
 		nv->vpll2B = nv->pramdac[0x0000057C/4];
@@ -374,8 +374,8 @@ snarf(Vga* vga, Ctlr* ctlr)
 	 * DFP.
 	 */
 	if (nv->islcd) {
-       		nv->fpwidth = nv->pramdac[0x0820/4] + 1;
-       		nv->fpheight = nv->pramdac[0x0800/4] + 1;
+		nv->fpwidth = nv->pramdac[0x0820/4] + 1;
+		nv->fpheight = nv->pramdac[0x0800/4] + 1;
 		nv->crtcsync = nv->pramdac[0x0828/4];
 	}
 
@@ -484,7 +484,7 @@ init(Vga* vga, Ctlr* ctlr)
 		nv->cursor0 = 0x00;
 		nv->cursor1 = 0xBC;
 		nv->cursor2 = 0;
-		nv->config  = 0x00001114;
+		nv->config = 0x00001114;
 	} else if(nv->arch >= 10) {
 		cursorstart = vga->vmz - 96 * 1024;
 		nv->cursor0 = 0x80 | (cursorstart >> 17);
@@ -493,8 +493,8 @@ init(Vga* vga, Ctlr* ctlr)
 		nv->config = nv->pfb[0x200/4];
 	}
 
-	nv->vpll    = (vga->p[0] << 16) | (vga->n[0] << 8) | vga->m[0];
-	nv->pllsel  = 0x10000700;
+	nv->vpll = (vga->p[0] << 16) | (vga->n[0] << 8) | vga->m[0];
+	nv->pllsel = 0x10000700;
 	if (mode->z == 16)
 		nv->general = 0x00001100;
 	else
@@ -567,7 +567,7 @@ init(Vga* vga, Ctlr* ctlr)
 		else
 			vga->crt[0x09] &= ~0x20;
 
-		vga->crt[0x04] =  vga->crt[0x00] - 5;
+		vga->crt[0x04] = vga->crt[0x00] - 5;
 
 		vga->crt[0x05] &= ~0x1F;
 		vga->crt[0x05] |= (0x1F & (vga->crt[0x00] - 2));
@@ -642,7 +642,8 @@ static void
 load(Vga* vga, Ctlr* ctlr)
 {
 	Nvidia *nv;
-	int i;
+	int i, regions;
+	ulong tmp;
 
 	nv = vga->private;
 
@@ -662,10 +663,24 @@ load(Vga* vga, Ctlr* ctlr)
 
 	if (nv->arch == 4)
 		nv->pfb[0x00000200/4] = nv->config;
-	else {
-		for(i=0; i<8; i++) {
-			nv->pfb[0x240/4+(i * 4)] = 0;
-			nv->pfb[0x244/4+(i * 4)] = vga->vmz - 1;
+	else if((nv->arch < 40) || ((nv->did & 0xfff0) == 0x0040)){
+		for(i = 0; i < 8; i++){
+			nv->pfb[(0x0240 + (i * 0x10))/4] = 0;
+			nv->pfb[(0x0244 + (i * 0x10))/4] = vga->vmz - 1;;
+		}
+	}
+	else{
+		if(((nv->did & 0xfff0) == 0x0090)
+		|| ((nv->did & 0xfff0) == 0x01D0)
+		|| ((nv->did & 0xfff0) == 0x0290)
+		|| ((nv->did & 0xfff0) == 0x0390))
+			regions = 15;
+		else
+			regions = 12;
+ 
+		for(i = 0; i < regions; i++){
+			nv->pfb[(0x0600 + (i * 0x10))/4] = 0;
+			nv->pfb[(0x0604 + (i * 0x10))/4] = vga->vmz - 1;
 		}
 	}
 
@@ -742,9 +757,9 @@ load(Vga* vga, Ctlr* ctlr)
 		nv->pramin[0x084E] = (vga->vmz - 128 * 1024) | 0x00000002;
 	} else {
 		nv->pramin[0x0000] = 0x80000010;
-		nv->pramin[0x0001] = 0x80011201;  
+		nv->pramin[0x0001] = 0x80011201;
 		nv->pramin[0x0002] = 0x80000011;
-		nv->pramin[0x0003] = 0x80011202; 
+		nv->pramin[0x0003] = 0x80011202;
 		nv->pramin[0x0004] = 0x80000012;
 		nv->pramin[0x0005] = 0x80011203;
 		nv->pramin[0x0006] = 0x80000013;
@@ -855,6 +870,12 @@ load(Vga* vga, Ctlr* ctlr)
 				nv->pgraph[0x0090/4] = 0x00008000;
 				nv->pgraph[0x0610/4] = 0x00be3c5f;
 
+
+				tmp = nv->pgraph[0x1540] & 0xff;
+				for(i = 0; tmp && !(tmp & 1); tmp >>= 1, i++)
+					;
+				nv->pgraph[0x5000] = i;
+
 				if ((nv->did & 0xfff0) == 0x0040) {
 					nv->pgraph[0x09b0/4] = 0x83280fff;
 					nv->pgraph[0x09b4/4] = 0x000000a0;
@@ -870,10 +891,13 @@ load(Vga* vga, Ctlr* ctlr)
 					nv->pfb[0x033C/4] &= 0xffff7fff;
 					break;
 				case 0x00C0:
+				case 0x0120:
 					nv->pgraph[0x0828/4] = 0x007596ff;
 					nv->pgraph[0x082C/4] = 0x00000108;
 					break;
 				case 0x0160:
+				case 0x01D0:
+				case 0x0240:
 					nv->pmc[0x1700/4] = nv->pfb[0x020C/4];
 					nv->pmc[0x1704/4] = 0;
 					nv->pmc[0x1708/4] = 0;
@@ -886,13 +910,25 @@ load(Vga* vga, Ctlr* ctlr)
 					nv->pgraph[0x0828/4] = 0x0072cb77;
 					nv->pgraph[0x082C/4] = 0x00000108;
 					break;
+				case 0x0220:
+					nv->pgraph[0x0860/4] = 0;
+					nv->pgraph[0x0864/4] = 0;
+					nv->pramdac[0x0608/4] |= 0x00100000;
+					break;
+				case 0x0090:
+				case 0x0290:
+				case 0x0390:
+					nv->pgraph[0x0608/4] |= 0x00100000;
+					nv->pgraph[0x0828/4] = 0x07830610;
+					nv->pgraph[0x082C/4] = 0x0000016A;
+					break;
 				default:
 					break;
-				};
+				}
 
 				nv->pgraph[0x0b38/4] = 0x2ffff800;
 				nv->pgraph[0x0b3c/4] = 0x00006000;
-				nv->pgraph[0x032C/4] = 0x01000000; 
+				nv->pgraph[0x032C/4] = 0x01000000;
 				nv->pgraph[0x0220/4] = 0x00001200;
 			} else if (nv->arch == 30) {
 				nv->pgraph[0x0084/4] = 0x40108700;
@@ -910,15 +946,15 @@ load(Vga* vga, Ctlr* ctlr)
 
 				if((nv->did & 0x0ff0) >= 0x0250) {
 					nv->pgraph[0x0890/4] = 0x00080000;
-					nv->pgraph[0x0610/4] = 0x304B1FB6; 
-					nv->pgraph[0x0B80/4] = 0x18B82880; 
-					nv->pgraph[0x0B84/4] = 0x44000000; 
-					nv->pgraph[0x0098/4] = 0x40000080; 
-					nv->pgraph[0x0B88/4] = 0x000000ff; 
+					nv->pgraph[0x0610/4] = 0x304B1FB6;
+					nv->pgraph[0x0B80/4] = 0x18B82880;
+					nv->pgraph[0x0B84/4] = 0x44000000;
+					nv->pgraph[0x0098/4] = 0x40000080;
+					nv->pgraph[0x0B88/4] = 0x000000ff;
 				} else {
 					nv->pgraph[0x0880/4] = 0x00080000;
 					nv->pgraph[0x0094/4] = 0x00000005;
-					nv->pgraph[0x0B80/4] = 0x45CAA208; 
+					nv->pgraph[0x0B80/4] = 0x45CAA208;
 					nv->pgraph[0x0B84/4] = 0x24000000;
 					nv->pgraph[0x0098/4] = 0x00000040;
 					nv->pgraph[0x0750/4] = 0x00E00038;
@@ -928,8 +964,32 @@ load(Vga* vga, Ctlr* ctlr)
 				}
 			}
 
-			for(i = 0; i < 32; i++)
-				nv->pgraph[(0x0900/4) + i] = nv->pfb[(0x0240/4) + i];
+			if((nv->arch < 40) || ((nv->did & 0xfff0) == 0x0040)){
+				for(i = 0; i < 32; i++) {
+					nv->pgraph[(0x0900/4) + i] = nv->pfb[(0x0240/4) + i];
+					nv->pgraph[(0x6900/4) + i] = nv->pfb[(0x0240/4) + i];
+				}
+			}
+			else{
+				if(((nv->did & 0xfff0) == 0x0090)
+				|| ((nv->did & 0xfff0) == 0x01D0)
+				|| ((nv->did & 0xfff0) == 0x0290)
+				|| ((nv->did & 0xfff0) == 0x0390)){
+					for(i = 0; i < 60; i++) {
+						nv->pgraph[(0x0D00/4) + i] = nv->pfb[(0x0600/4) + i];
+						nv->pgraph[(0x6900/4) + i] = nv->pfb[(0x0600/4) + i];
+					}
+				}
+				else{
+					for(i = 0; i < 48; i++) {
+						nv->pgraph[(0x0900/4) + i] = nv->pfb[(0x0600/4) + i];
+						if(((nv->did & 0xfff0) != 0x0160)
+						&& ((nv->did & 0xfff0) != 0x0220)
+						&& ((nv->did & 0xfff0) != 0x0240))
+							nv->pgraph[(0x6900/4) + i] = nv->pfb[(0x0600/4) + i];
+					}
+				}
+			}
 
 			if(nv->arch >= 40) {
 				if((nv->did & 0xfff0) == 0x0040) {
@@ -1052,8 +1112,8 @@ load(Vga* vga, Ctlr* ctlr)
 	vgaxo(Crtx, 0x39, nv->interlace);
 
 	if (nv->islcd) {
-		nv->pramdac[0x00000848/4] = nv->scale;	
-		nv->pramdac[0x00000828/4] = nv->crtcsync;	
+		nv->pramdac[0x00000848/4] = nv->scale;
+		nv->pramdac[0x00000828/4] = nv->crtcsync;
 	} else {
 		nv->pramdac[0x0000050C/4] = nv->pllsel;
 		nv->pramdac[0x00000508/4] = nv->vpll;

+ 9 - 9
sys/src/cmd/tcs/tcs.c

@@ -577,14 +577,14 @@ struct convert convert[] =
 	{ "viet1", "Vietnamese VSCII-1 (1993)", Table, (void *)tabviet1 },
 	{ "viet2", "Vietnamese VSCII-2 (1993)", Table, (void *)tabviet2 },
 	{ "vscii", "Vietnamese VISCII 1.1 (1992)", Table, (void *)tabviscii },
-	{ "windows1250", "Windows Code Page 1250 (Central Europe)", Table, (void *)tabcp1250 },
-	{ "windows1251", "Windows Code Page 1251 (Cyrillic)", Table, (void *)tabcp1251 },
-	{ "windows1252", "Windows Code Page 1252 (Latin I)", Table, (void *)tabcp1252 },
-	{ "windows1253", "Windows Code Page 1253 (Greek)", Table, (void *)tabcp1253 },
-	{ "windows1254", "Windows Code Page 1254 (Turkish)", Table, (void *)tabcp1254 },
-	{ "windows1255", "Windows Code Page 1255 (Hebrew)", Table, (void *)tabcp1255 },
-	{ "windows1256", "Windows Code Page 1256 (Arabic)", Table, (void *)tabcp1256 },
-	{ "windows1257", "Windows Code Page 1257 (Baltic)", Table, (void *)tabcp1257 },
-	{ "windows1258", "Windows Code Page 1258 (Vietnam)", Table, (void *)tabcp1258 },
+	{ "windows-1250", "Windows Code Page 1250 (Central Europe)", Table, (void *)tabcp1250 },
+	{ "windows-1251", "Windows Code Page 1251 (Cyrillic)", Table, (void *)tabcp1251 },
+	{ "windows-1252", "Windows Code Page 1252 (Latin I)", Table, (void *)tabcp1252 },
+	{ "windows-1253", "Windows Code Page 1253 (Greek)", Table, (void *)tabcp1253 },
+	{ "windows-1254", "Windows Code Page 1254 (Turkish)", Table, (void *)tabcp1254 },
+	{ "windows-1255", "Windows Code Page 1255 (Hebrew)", Table, (void *)tabcp1255 },
+	{ "windows-1256", "Windows Code Page 1256 (Arabic)", Table, (void *)tabcp1256 },
+	{ "windows-1257", "Windows Code Page 1257 (Baltic)", Table, (void *)tabcp1257 },
+	{ "windows-1258", "Windows Code Page 1258 (Vietnam)", Table, (void *)tabcp1258 },
 	{ 0 },
 };