~kris/9p

9hist

5cc42e31208637a6e65809698933b63c4987142e — David du Colombier 36 years ago 5cd66a0
Plan 9 from Bell Labs 1990-07-09
5 files changed, 46 insertions(+), 7 deletions(-)

M gnot/main.c
M gnot/mmu.c
M gnot/page.c
M gnot/screen.c
M port/devbit.c
M gnot/main.c => gnot/main.c +6 -4
@@ 290,7 290,7 @@ confinit(void)
	conf.npage = conf.npage0+conf.npage1;
	mul = 1 + (conf.npage1>0);
	conf.nproc = 40*mul;
	conf.npgrp = 15*mul;
	conf.npgrp = 12*mul;
	conf.npte = 700*mul;
	conf.nmod = 400*mul;
	conf.nalarm = 1000;


@@ 300,15 300,17 @@ confinit(void)
	conf.nenvchar = 8000*mul;
	conf.npgenv = 200*mul;
	conf.nmtab = 50*mul;
	conf.nmount = 100*mul;
	conf.nmount = 80*mul;
	conf.nmntdev = 10*mul;
	conf.nmntbuf = 2*conf.nmntdev;
	conf.nmnthdr = 2*conf.nmntdev;
	conf.nstream = 64*mul;
	conf.nstream = 64;
	conf.nqueue = 5 * conf.nstream;
	conf.nblock = 12 * conf.nstream;
	conf.nsrv = 32*mul;
	conf.nbitmap = 100*mul;
	conf.nbitbyte = 300*1024*mul*mul;
	conf.nbitbyte = 300*1024*mul;
	if(*(uchar*)MOUSE & (1<<4))
		conf.nbitbyte *= 2;	/* ldepth 1 */
	conf.nfont = 10*mul;
}

M gnot/mmu.c => gnot/mmu.c +5 -2
@@ 63,7 63,7 @@ kmapinit(void)

	if(kmapalloc.init == 0){
		k = &kmapalloc.arena[0];
		k->va = KZERO|(3*1024*1024);
		k->va = KZERO|(4*1024*1024-256*1024-BY2PG);
		k->next = 0;
		kmapalloc.free = k;
		kmapalloc.init = 1;


@@ 71,6 71,7 @@ kmapinit(void)
	}
	e = (4*1024*1024 - 256*1024)/BY2PG;	/* screen lives at top 256K */
	i = (((ulong)ialloc(0, 0))&~KZERO)/BY2PG;
	print("%lud free map registers\n", e-i);
	kmapalloc.free = 0;
	for(k=&kmapalloc.arena[i]; i<e; i++,k++){
		k->va = i*BY2PG|KZERO;


@@ 85,8 86,10 @@ kmap(Page *pg)

	lock(&kmapalloc);
	k = kmapalloc.free;
	if(k == 0)
	if(k == 0){
		dumpstack();
		panic("kmap");
	}
	kmapalloc.free = k->next;
	unlock(&kmapalloc);
	k->pa = pg->pa;

M gnot/page.c => gnot/page.c +2 -0
@@ 71,6 71,8 @@ ialloc(ulong n, int align)
		palloc.addr += BY2PG-1;
		palloc.addr &= ~(BY2PG-1);
	}
	if(palloc.addr >= (4*1024*1024-256*1024-BY2PG))
		panic("keep bill joy away");
	return (void*)(p|KZERO);
}


M gnot/screen.c => gnot/screen.c +1 -1
@@ 275,7 275,7 @@ duartintr(Ureg *ur)
	 * Is it 0?
	 */
	if(cause & IM_CRDY){
		kproftimer(ur->pc);
/*		kproftimer(ur->pc);/**/
		c = duart[1].scc_ropbc;
		duart[0].ctur = (Kptime)>>8;
		duart[0].ctlr = (Kptime)&255;

M port/devbit.c => port/devbit.c +32 -0
@@ 120,11 120,13 @@ enum{
	Qdir,
	Qbitblt,
	Qmouse,
	Qscreen,
};

Dirtab bitdir[]={
	"bitblt",	Qbitblt,	0,			0600,
	"mouse",	Qmouse,		0,			0600,
	"screen",	Qscreen,	0,			0400,
};

#define	NBIT	(sizeof bitdir/sizeof(Dirtab))


@@ 425,6 427,36 @@ bitread(Chan *c, void *va, long n)
		}
		error(0, Ebadblt);

	case Qscreen:
		if(c->offset==0){
			if(n < 5*12)
				error(0, Eio);
			sprint(va, "%11d %11d %11d %11d %11d ",
				screen.ldepth, screen.r.min.x,
				screen.r.min.y, screen.r.max.x,
				screen.r.max.y);
			n = 5*12;
			break;
		}
		ws = 1<<(3-screen.ldepth);	/* pixels per byte */
		l = (screen.r.max.x+ws-1)/ws - screen.r.min.x/ws;
		t = c->offset-5*12;
		miny = t/l;
		maxy = (t+n)/l;
		if(miny >= screen.r.max.y)
			return 0;
		if(maxy >= screen.r.max.y)
			maxy = screen.r.max.y;
		n = 0;
		p = va;
		for(y=miny; y<maxy; y++){
			q = (uchar*)addr(&screen, Pt(0, y));
			for(x=0; x<l; x++)
				*p++ = K2U(*q++);
			n += l;
		}
		break;

	default:
		error(0, Egreg);
	}