Browse Source

Plan 9 from Bell Labs 2005-11-08

David du Colombier 15 years ago
parent
commit
e2ce0c4a96

+ 8 - 8
dist/replica/_plan9.db

@@ -6058,7 +6058,7 @@ sys/lib/acid/alef - 664 sys sys 944955985 2293
 sys/lib/acid/alpha - 664 sys sys 944955985 4849
 sys/lib/acid/arm - 664 sys sys 984696197 1842
 sys/lib/acid/coverage - 664 sys sys 944955985 1746
-sys/lib/acid/kernel - 664 sys sys 1126699644 6303
+sys/lib/acid/kernel - 664 sys sys 1131375651 6370
 sys/lib/acid/leak - 664 sys sys 1131289472 2363
 sys/lib/acid/mips - 664 sys sys 944955985 5472
 sys/lib/acid/network - 664 sys sys 1020313817 2499
@@ -7912,7 +7912,6 @@ sys/src/9/mtx/raven.c - 664 sys sys 1018721288 2587
 sys/src/9/mtx/trap.c - 664 sys sys 1105030157 15882
 sys/src/9/mtx/uarti8250.c - 664 sys sys 1018721288 11590
 sys/src/9/pc - 20000000775 sys sys 1018721225 0
-sys/src/9/pc/apbootstrap.h - 664 sys sys 1018553448 928
 sys/src/9/pc/apbootstrap.s - 664 sys sys 1131293655 3037
 sys/src/9/pc/apic.c - 664 sys sys 1131290206 8748
 sys/src/9/pc/apm.c - 664 sys sys 1131290210 3723
@@ -8007,7 +8006,7 @@ sys/src/9/pc/sdata.c - 664 sys sys 1131290578 52168
 sys/src/9/pc/sdmv50xx.c - 664 sys sys 1131290638 25780
 sys/src/9/pc/sdmylex.c - 664 sys sys 1131290583 27737
 sys/src/9/pc/sdscsi.c - 664 sys sys 1131293342 7133
-sys/src/9/pc/trap.c - 664 sys sys 1131306249 21180
+sys/src/9/pc/trap.c - 664 sys sys 1131375347 21210
 sys/src/9/pc/uarti8250.c - 664 sys sys 1102820421 13958
 sys/src/9/pc/uartisa.c - 664 sys sys 1127126907 1777
 sys/src/9/pc/uartpci.c - 664 sys sys 1096379063 2891
@@ -8027,7 +8026,7 @@ sys/src/9/pc/vgai81x.c - 664 sys sys 1131290601 4030
 sys/src/9/pc/vgamach64xx.c - 664 sys sys 1131290601 28257
 sys/src/9/pc/vgamga2164w.c - 664 sys sys 1131290602 4637
 sys/src/9/pc/vgamga4xx.c - 664 sys sys 1131290602 10201
-sys/src/9/pc/vganeomagic.c - 664 sys sys 1131290602 10143
+sys/src/9/pc/vganeomagic.c - 664 sys sys 1131422294 10255
 sys/src/9/pc/vganvidia.c - 664 sys sys 1131290602 11783
 sys/src/9/pc/vgargb524.c - 664 sys sys 1131290602 4251
 sys/src/9/pc/vgas3.c - 664 sys sys 1131290603 10994
@@ -8035,7 +8034,7 @@ sys/src/9/pc/vgasavage.c - 664 sys sys 1064679984 16251
 sys/src/9/pc/vgat2r4.c - 664 sys sys 1131290603 9351
 sys/src/9/pc/vgatvp3020.c - 664 sys sys 1131290603 4507
 sys/src/9/pc/vgatvp3026.c - 664 sys sys 1131290603 3956
-sys/src/9/pc/vgavesa.c - 664 sys sys 1131290603 2369
+sys/src/9/pc/vgavesa.c - 664 sys sys 1131402428 2396
 sys/src/9/pc/vgavmware.c - 664 sys sys 1131290604 5840
 sys/src/9/pc/vgax.c - 664 sys sys 1131290604 1671
 sys/src/9/pc/wavelan.c - 664 sys sys 1127743243 27879
@@ -9604,7 +9603,7 @@ sys/src/cmd/aux/vga/io.c - 664 sys sys 1131110425 6329
 sys/src/cmd/aux/vga/mach32.c - 664 sys sys 1014925009 6004
 sys/src/cmd/aux/vga/mach64.c - 664 sys sys 1014925009 8279
 sys/src/cmd/aux/vga/mach64xx.c - 664 sys sys 1097900455 30266
-sys/src/cmd/aux/vga/main.c - 664 sys sys 1116769799 9583
+sys/src/cmd/aux/vga/main.c - 664 sys sys 1131375677 9584
 sys/src/cmd/aux/vga/mga2164w.c - 664 sys sys 1014925010 13196
 sys/src/cmd/aux/vga/mga4xx.c - 664 sys sys 1014925010 35895
 sys/src/cmd/aux/vga/mkfile - 664 sys sys 1115734903 927
@@ -12742,7 +12741,7 @@ sys/src/cmd/rio/data.c - 664 sys sys 1014926356 6169
 sys/src/cmd/rio/fns.h - 664 sys sys 1039133251 1065
 sys/src/cmd/rio/fsys.c - 664 sys sys 1019678647 13259
 sys/src/cmd/rio/mkfile - 664 sys sys 1111249068 431
-sys/src/cmd/rio/rio.c - 664 sys sys 1121977163 22142
+sys/src/cmd/rio/rio.c - 664 sys sys 1131375663 22143
 sys/src/cmd/rio/scrl.c - 664 sys sys 1014926357 3245
 sys/src/cmd/rio/time.c - 664 sys sys 1014926357 1829
 sys/src/cmd/rio/util.c - 664 sys sys 1014926357 2061
@@ -14567,7 +14566,7 @@ sys/src/libmach/kdb.c - 664 sys sys 1131289381 21161
 sys/src/libmach/kobj.c - 664 sys sys 1091732625 2217
 sys/src/libmach/machdata.c - 664 sys sys 1131289377 8799
 sys/src/libmach/map.c - 664 sys sys 1131289376 3056
-sys/src/libmach/mkfile - 664 sys sys 1114459827 467
+sys/src/libmach/mkfile - 664 sys sys 1131375713 479
 sys/src/libmach/obj.c - 664 sys sys 1131289376 5929
 sys/src/libmach/obj.h - 664 sys sys 1131292890 604
 sys/src/libmach/q.c - 664 sys sys 1131289379 3630
@@ -14974,3 +14973,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/aux/vga - 775 sys sys 1131422827 333645

+ 8 - 9
dist/replica/plan9.db

@@ -148,7 +148,7 @@
 386/bin/aux/tr2post - 775 sys sys 1104121987 176578
 386/bin/aux/trampoline - 775 sys sys 1130594716 83677
 386/bin/aux/typepasswd - 775 sys sys 1130594716 69535
-386/bin/aux/vga - 775 sys sys 1131163701 333645
+386/bin/aux/vga - 775 sys sys 1131422827 333645
 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
@@ -6058,7 +6058,7 @@ sys/lib/acid/alef - 664 sys sys 944955985 2293
 sys/lib/acid/alpha - 664 sys sys 944955985 4849
 sys/lib/acid/arm - 664 sys sys 984696197 1842
 sys/lib/acid/coverage - 664 sys sys 944955985 1746
-sys/lib/acid/kernel - 664 sys sys 1126699644 6303
+sys/lib/acid/kernel - 664 sys sys 1131375651 6370
 sys/lib/acid/leak - 664 sys sys 1131289472 2363
 sys/lib/acid/mips - 664 sys sys 944955985 5472
 sys/lib/acid/network - 664 sys sys 1020313817 2499
@@ -7912,7 +7912,6 @@ sys/src/9/mtx/raven.c - 664 sys sys 1018721288 2587
 sys/src/9/mtx/trap.c - 664 sys sys 1105030157 15882
 sys/src/9/mtx/uarti8250.c - 664 sys sys 1018721288 11590
 sys/src/9/pc - 20000000775 sys sys 1018721225 0
-sys/src/9/pc/apbootstrap.h - 664 sys sys 1018553448 928
 sys/src/9/pc/apbootstrap.s - 664 sys sys 1131293655 3037
 sys/src/9/pc/apic.c - 664 sys sys 1131290206 8748
 sys/src/9/pc/apm.c - 664 sys sys 1131290210 3723
@@ -8007,7 +8006,7 @@ sys/src/9/pc/sdata.c - 664 sys sys 1131290578 52168
 sys/src/9/pc/sdmv50xx.c - 664 sys sys 1131290638 25780
 sys/src/9/pc/sdmylex.c - 664 sys sys 1131290583 27737
 sys/src/9/pc/sdscsi.c - 664 sys sys 1131293342 7133
-sys/src/9/pc/trap.c - 664 sys sys 1131306249 21180
+sys/src/9/pc/trap.c - 664 sys sys 1131375347 21210
 sys/src/9/pc/uarti8250.c - 664 sys sys 1102820421 13958
 sys/src/9/pc/uartisa.c - 664 sys sys 1127126907 1777
 sys/src/9/pc/uartpci.c - 664 sys sys 1096379063 2891
@@ -8027,7 +8026,7 @@ sys/src/9/pc/vgai81x.c - 664 sys sys 1131290601 4030
 sys/src/9/pc/vgamach64xx.c - 664 sys sys 1131290601 28257
 sys/src/9/pc/vgamga2164w.c - 664 sys sys 1131290602 4637
 sys/src/9/pc/vgamga4xx.c - 664 sys sys 1131290602 10201
-sys/src/9/pc/vganeomagic.c - 664 sys sys 1131290602 10143
+sys/src/9/pc/vganeomagic.c - 664 sys sys 1131422294 10255
 sys/src/9/pc/vganvidia.c - 664 sys sys 1131290602 11783
 sys/src/9/pc/vgargb524.c - 664 sys sys 1131290602 4251
 sys/src/9/pc/vgas3.c - 664 sys sys 1131290603 10994
@@ -8035,7 +8034,7 @@ sys/src/9/pc/vgasavage.c - 664 sys sys 1064679984 16251
 sys/src/9/pc/vgat2r4.c - 664 sys sys 1131290603 9351
 sys/src/9/pc/vgatvp3020.c - 664 sys sys 1131290603 4507
 sys/src/9/pc/vgatvp3026.c - 664 sys sys 1131290603 3956
-sys/src/9/pc/vgavesa.c - 664 sys sys 1131290603 2369
+sys/src/9/pc/vgavesa.c - 664 sys sys 1131402428 2396
 sys/src/9/pc/vgavmware.c - 664 sys sys 1131290604 5840
 sys/src/9/pc/vgax.c - 664 sys sys 1131290604 1671
 sys/src/9/pc/wavelan.c - 664 sys sys 1127743243 27879
@@ -9604,7 +9603,7 @@ sys/src/cmd/aux/vga/io.c - 664 sys sys 1131110425 6329
 sys/src/cmd/aux/vga/mach32.c - 664 sys sys 1014925009 6004
 sys/src/cmd/aux/vga/mach64.c - 664 sys sys 1014925009 8279
 sys/src/cmd/aux/vga/mach64xx.c - 664 sys sys 1097900455 30266
-sys/src/cmd/aux/vga/main.c - 664 sys sys 1116769799 9583
+sys/src/cmd/aux/vga/main.c - 664 sys sys 1131375677 9584
 sys/src/cmd/aux/vga/mga2164w.c - 664 sys sys 1014925010 13196
 sys/src/cmd/aux/vga/mga4xx.c - 664 sys sys 1014925010 35895
 sys/src/cmd/aux/vga/mkfile - 664 sys sys 1115734903 927
@@ -12742,7 +12741,7 @@ sys/src/cmd/rio/data.c - 664 sys sys 1014926356 6169
 sys/src/cmd/rio/fns.h - 664 sys sys 1039133251 1065
 sys/src/cmd/rio/fsys.c - 664 sys sys 1019678647 13259
 sys/src/cmd/rio/mkfile - 664 sys sys 1111249068 431
-sys/src/cmd/rio/rio.c - 664 sys sys 1121977163 22142
+sys/src/cmd/rio/rio.c - 664 sys sys 1131375663 22143
 sys/src/cmd/rio/scrl.c - 664 sys sys 1014926357 3245
 sys/src/cmd/rio/time.c - 664 sys sys 1014926357 1829
 sys/src/cmd/rio/util.c - 664 sys sys 1014926357 2061
@@ -14567,7 +14566,7 @@ sys/src/libmach/kdb.c - 664 sys sys 1131289381 21161
 sys/src/libmach/kobj.c - 664 sys sys 1091732625 2217
 sys/src/libmach/machdata.c - 664 sys sys 1131289377 8799
 sys/src/libmach/map.c - 664 sys sys 1131289376 3056
-sys/src/libmach/mkfile - 664 sys sys 1114459827 467
+sys/src/libmach/mkfile - 664 sys sys 1131375713 479
 sys/src/libmach/obj.c - 664 sys sys 1131289376 5929
 sys/src/libmach/obj.h - 664 sys sys 1131292890 604
 sys/src/libmach/q.c - 664 sys sys 1131289379 3630

+ 9 - 0
dist/replica/plan9.log

@@ -22841,3 +22841,12 @@
 1131327235 5 c 386/9pcdisk.gz - 664 sys sys 1131327148 746868
 1131327235 6 c 386/9pcf - 775 sys sys 1131327153 2415653
 1131327235 7 c 386/9pcf.gz - 664 sys sys 1131327156 900998
+1131375721 0 c sys/lib/acid/kernel - 664 sys sys 1131375651 6370
+1131375721 1 c sys/src/9/pc/trap.c - 664 sys sys 1131375347 21210
+1131375721 2 c sys/src/cmd/aux/vga/main.c - 664 sys sys 1131375677 9584
+1131375721 3 c sys/src/cmd/rio/rio.c - 664 sys sys 1131375663 22143
+1131375721 4 c sys/src/libmach/mkfile - 664 sys sys 1131375713 479
+1131375721 5 d sys/src/9/pc/apbootstrap.h - 664 sys sys 1018553448 0
+1131402435 0 c sys/src/9/pc/vgavesa.c - 664 sys sys 1131402428 2396
+1131422433 0 c sys/src/9/pc/vganeomagic.c - 664 sys sys 1131422294 10255
+1131424234 0 c 386/bin/aux/vga - 775 sys sys 1131422827 333645

+ 12 - 6
sys/lib/acid/kernel

@@ -319,17 +319,21 @@ defn segaddr(s, a) {
 	}
 
 	complex Page pg;
-	return (0x80000000|(pg.pa+(a%BY2PG)))\X;
+	return (KZERO|(pg.pa+(a%BY2PG)))\X;
+}
+
+defn kzero() {
+	return main - (main & 0x0FFFFFFF);
 }
 
 // PC only
-MACHADDR = 0x80004000;
 PTEMAPMEM = (1024*1024);
 BY2PG = 4096;
 PTEPERTAB = (PTEMAPMEM/BY2PG);
 defn up() {
 	local mach;
 
+	MACHADDR = KZERO+0x4000;
 	mach = MACHADDR;
 	complex Mach mach;
 	return mach.externup;
@@ -362,20 +366,22 @@ defn needacid(s){
 	print("\tinclude(\"/sys/src/9/", kdir, "/", s, ".acid\")\n");
 }
 
+defn kinit() {
 if (map()[2]) != {} then {	// map has more than two elements -> active proc
 	kdir = "unknown";
-
+	KZERO = kzero();
+	
 	if objtype == "386" then {
-		map({"*data", 0x80000000, 0xffffffff, 0x80000000});
+		map({"*data", KZERO, 0xffffffff, KZERO});
 		kdir="pc";
 	}
 	if (objtype == "mips" || objtype == "mips2") then {
 		kdir = "ch";
 	}
 	if objtype == "alpha" then {
-		map({"*data", 0x80000000, 0xffffffff, 0x80000000});
+		map({"*data", KZERO, 0xffffffff, KZERO});
 		kdir = "alpha";
 	}
 	needacid("proc");
 }
-
+}

+ 0 - 15
sys/src/9/pc/apbootstrap.h

@@ -1,15 +0,0 @@
-uchar apbootstrap[]={
-0xea,0x14,0x10,0x00,0x00,0x90,0x90,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x8c,0xc8,0x8e,0xd8,0x0f,0x01,0x16,0xac,0x10,0x0f,0x20,0xc0,
-0x83,0xc8,0x01,0x0f,0x22,0xc0,0xeb,0x00,0xb8,0x08,0x00,0x8e,0xd8,0x8e,0xc0,0x8e,
-0xe0,0x8e,0xe8,0x8e,0xd0,0x66,0xea,0x3d,0x10,0x00,0x00,0x10,0x00,0x8b,0x0d,0x0c,
-0x10,0x00,0x00,0x8b,0x91,0x00,0x08,0x00,0x00,0x89,0x11,0x0f,0x22,0xd9,0x0f,0x20,
-0xc2,0x81,0xca,0x00,0x00,0x01,0x80,0x81,0xe2,0xf5,0xff,0xff,0x9f,0xb8,0x67,0x10,
-0x00,0x80,0x0f,0x22,0xc2,0xff,0xe0,0x89,0xc8,0x0d,0x00,0x00,0x00,0x80,0xc7,0x00,
-0x00,0x00,0x00,0x00,0x0f,0x22,0xd9,0xbc,0xfc,0x5f,0x00,0x80,0x31,0xc0,0x50,0x9d,
-0x8b,0x05,0x10,0x10,0x00,0x80,0x89,0x04,0x24,0x8b,0x05,0x08,0x10,0x00,0x80,0xff,
-0xd0,0xf4,0xeb,0xfd,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x00,
-0x00,0x92,0xcf,0x00,0xff,0xff,0x00,0x00,0x00,0x9a,0xcf,0x00,0x17,0x00,0x94,0x10,
-0x00,0x00,
-
-};

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

@@ -591,6 +591,7 @@ unexpected(Ureg* ureg, void*)
 	print("unexpected trap %lud; ignoring\n", ureg->trap);
 }
 
+extern void checkpages(void);
 static void
 fault386(Ureg* ureg, void*)
 {

+ 8 - 6
sys/src/9/pc/vganeomagic.c

@@ -34,6 +34,8 @@ neomagicenable(VGAscr* scr)
 	 * scr->mmio holds the virtual address of the cursor registers
 	 * in the MMIO space. This may need to change for older chips
 	 * which have the MMIO space offset in the framebuffer region.
+	 *
+	 * scr->io holds the offset into mmio of the CursorNM struct.
 	 */
 	if(scr->mmio)
 		return;
@@ -88,7 +90,7 @@ neomagicenable(VGAscr* scr)
 	 * last 2KB of the framebuffer.
 	 */
 	scr->storage = vmsize-2*1024;
-	scr->mmio = (ulong*)((uchar*)scr->mmio + curoff);
+	scr->io = curoff;
 	vgalinearpci(scr);
 	if(scr->paddr)
 		addvgaseg("neomagicscreen", scr->paddr, scr->apsize);
@@ -101,7 +103,7 @@ neomagiccurdisable(VGAscr* scr)
 
 	if(scr->mmio == 0)
 		return;
-	cursornm = (void*)scr->mmio;
+	cursornm = (void*)((char*)scr->mmio + scr->io);
 	cursornm->enable = 0;
 }
 
@@ -112,7 +114,7 @@ neomagicinitcursor(VGAscr* scr, int xo, int yo, int index)
 	uint p0, p1;
 	int x, y;
 
-	p = (uchar*)scr->mmio;
+	p = (uchar*)scr->vaddr;
 	p += scr->storage + index*1024;
 
 	for(y = yo; y < 16; y++){
@@ -156,7 +158,7 @@ neomagiccurload(VGAscr* scr, Cursor* curs)
 
 	if(scr->mmio == 0)
 		return;
-	cursornm = (void*)scr->mmio;
+	cursornm = (void*)((char*)scr->mmio + scr->io);
 
 	cursornm->enable = 0;
 	memmove(&scr->Cursor, curs, sizeof(Cursor));
@@ -172,7 +174,7 @@ neomagiccurmove(VGAscr* scr, Point p)
 
 	if(scr->mmio == 0)
 		return 1;
-	cursornm = (void*)scr->mmio;
+	cursornm = (void*)((char*)scr->mmio + scr->io);
 
 	index = 0;
 	if((x = p.x+scr->offset.x) < 0){
@@ -211,7 +213,7 @@ neomagiccurenable(VGAscr* scr)
 	neomagicenable(scr);
 	if(scr->mmio == 0)
 		return;
-	cursornm = (void*)scr->mmio;
+	cursornm = (void*)((char*)scr->mmio + scr->io);
 	cursornm->enable = 0;
 
 	/*

+ 6 - 3
sys/src/9/pc/vgavesa.c

@@ -23,11 +23,14 @@ extern void realmode(Ureg*);
 static uchar*
 vbesetup(Ureg *u, int ax)
 {
+	ulong pa;
+	
+	pa = PADDR(RMBUF);
 	memset(u, 0, sizeof *u);
 	u->ax = ax;
-	u->es = (RMBUF>>4)&0xF000;
-	u->di = RMBUF&0xFFFF;
-	return KADDR(RMBUF);
+	u->es = (pa>>4)&0xF000;
+	u->di = pa&0xFFFF;
+	return (void*)RMBUF;
 }
 
 static void

+ 1 - 1
sys/src/cmd/aux/vga/main.c

@@ -455,7 +455,7 @@ main(int argc, char** argv)
 			vgactlw("drawinit", "");
 
 			if(vga->hwgc == 0 || cflag)
-				vgactlw("hwgc", "off");
+				vgactlw("hwgc", "soft");
 			else
 				vgactlw("hwgc", vga->hwgc->name);
 

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

@@ -639,7 +639,8 @@ resized(void)
 			wsendctlmesg(w, Reshaped, r, im);
 	}
 	viewr = screen->r;
-	flushimage(display, 1);}
+	flushimage(display, 1);
+}
 
 void
 button3menu(void)

+ 1 - 1
sys/src/libmach/mkfile

@@ -38,7 +38,7 @@ FILES=executable\
 	qobj\
 	vcodas\
 
-HFILES=/sys/include/mach.h
+HFILES=/sys/include/mach.h elf.h obj.h
 
 CFILES=${FILES:%=%.c}