Plan 9 from Bell Labs’s /usr/web/sources/contrib/uriel/changes/2005/1107/1

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


Figure out KZERO.
 [rsc] --rw-rw-r-- M 489211 glenda sys 6370 Nov  7 10:00 sys/lib/acid/kernel
	/n/sourcesdump/2005/1107/plan9/sys/lib/acid/kernel:319,329 - 
	/n/sourcesdump/2005/1108/plan9/sys/lib/acid/kernel:319,332
	  	}
	  
	  	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);
	/n/sourcesdump/2005/1107/plan9/sys/lib/acid/kernel:330,335 - 
	/n/sourcesdump/2005/1108/plan9/sys/lib/acid/kernel:333,339
	  defn up() {
	  	local mach;
	  
	+ 	MACHADDR = KZERO+0x4000;
	  	mach = MACHADDR;
	  	complex Mach mach;
	  	return mach.externup;
	/n/sourcesdump/2005/1107/plan9/sys/lib/acid/kernel:362,372 - 
	/n/sourcesdump/2005/1108/plan9/sys/lib/acid/kernel:366,378
	  	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 {
	/n/sourcesdump/2005/1107/plan9/sys/lib/acid/kernel:373,381 - 
	/n/sourcesdump/2005/1108/plan9/sys/lib/acid/kernel:379,387
	  		kdir = "ch";
	  	}
	  	if objtype == "alpha" then {
	- 		map({"*data", 0x80000000, 0xffffffff, 0x80000000});
	+ 		map({"*data", KZERO, 0xffffffff, KZERO});
	  		kdir = "alpha";
	  	}
	  	needacid("proc");
	  }
	- 
	+ }


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.