~kris/9p

9hist

01821c8f44982b7f05d7a925bacb36b48f1f6ab8 — David du Colombier 34 years ago 9e3fc7f
Plan 9 from Bell Labs 1992-04-02
3 files changed, 10 insertions(+), 25 deletions(-)

M pc/devhard.c
M pc/vga.c
M port/devmnt.c
M pc/devhard.c => pc/devhard.c +6 -5
@@ 225,13 225,14 @@ hardattach(char *spec)
	for(dp = hard; dp < &hard[conf.nhard]; dp++){
		if(!waserror()){
			dp->bytes = 512;
			hardsetbuf(dp, 1);
			hardsetbuf(dp, 0);
			hardident(dp);
			switch(dp->id.magic){
			case 0xA5A:	/* conner drive on the AT&T NSX (safari) */
				dp->cyl = dp->id.lcyls;
				dp->heads = dp->id.lheads;
				dp->sectors = dp->id.ls2t;
				hardsetbuf(dp, 1);
				break;
			case 0x324A:	/* hard drive on the AT&T 6386 */
				dp->cyl = dp->id.lcyls - 4;


@@ 494,7 495,7 @@ hardxfer(Drive *dp, Partition *pp, int cmd, long start, long len)
print("\tnsecs %d, sofar %d\n", cp->nsecs, cp->sofar);/**/
	outb(cp->pbase+Pcount, cp->nsecs);
	outb(cp->pbase+Psector, cp->tsec);
	outb(cp->pbase+Pdh, (dp->drive<<4) | cp->thead);
	outb(cp->pbase+Pdh, 0x20 | (dp->drive<<4) | cp->thead);
	outb(cp->pbase+Pcyllsb, cp->tcyl);
	outb(cp->pbase+Pcylmsb, cp->tcyl>>8);
	outb(cp->pbase+Pcmd, cmd);


@@ 536,8 537,8 @@ hardsetbuf(Drive *dp, int on)
	cmdreadywait(cp);

	cp->cmd = Csetbuf;
	outb(cp->pbase+Pprecomp, on ? 0xAA : 0x55);
	outb(cp->pbase+Pdh, (dp->drive<<4));
	outb(cp->pbase+Pprecomp, on ? 0xAA : 0xFF);
	outb(cp->pbase+Pdh, 0x20 | (dp->drive<<4));
	outb(cp->pbase+Pcmd, Csetbuf);

	sleep(&cp->r, cmddone, cp);


@@ 567,7 568,7 @@ hardident(Drive *dp)
	cp->sofar = 0;
	cp->cmd = Cident;
	cp->dp = dp;
	outb(cp->pbase+Pdh, (dp->drive<<4));
	outb(cp->pbase+Pdh, 0x20 | (dp->drive<<4));
	outb(cp->pbase+Pcmd, Cident);
	sleep(&cp->r, cmddone, cp);
	if(cp->status & Serr){

M pc/vga.c => pc/vga.c +4 -6
@@ 187,10 187,6 @@ screeninit(void)
		*l = (*l<<24) | ((*l>>8)&0x0000ff00) | ((*l<<8)&0x00ff0000) | (*l>>24);

	gbitblt(&gscreen, Pt(0, 0), &gscreen, gscreen.r, flipD[0]);
	delay(2000);
	gbitblt(&gscreen, Pt(0, 0), &gscreen, gscreen.r, flipD[F]);
	delay(2000);
	gbitblt(&gscreen, Pt(0, 0), &gscreen, gscreen.r, flipD[0]);
	out.pos.x = MINX;
	out.pos.y = 0;
	out.bwid = defont0.info[' '].width;


@@ 207,6 203,8 @@ screenputnl(void)
	    Rect(0, out.pos.y, gscreen.r.max.x, out.pos.y+2*defont0.height), flipD[0]);
}

Lock screenlock;

void
screenputs(char *s, int n)
{


@@ 214,7 212,7 @@ screenputs(char *s, int n)
	int i;
	char buf[4];

	lock(&printq);
	lock(&screenlock);
	while(n > 0){
		i = chartorune(&r, s);
		if(i == 0){


@@ 243,7 241,7 @@ screenputs(char *s, int n)
			out.pos = gsubfstring(&gscreen, out.pos, defont, buf, flipD[S]);
		}
	}
	unlock(&printq);
	unlock(&screenlock);
}

int

M port/devmnt.c => port/devmnt.c +0 -14
@@ 125,8 125,6 @@ Chan*
mntattach(char *muxattach)
{
	Mnt *m, *e;
	Stream *s;
	Qinfo *qi;
	Chan *c;
	struct bogus{
		Chan	*chan;


@@ 183,18 181,6 @@ mntattach(char *muxattach)
		nexterror();
	}

	/* If we have a stream based protocol (TCP/IP) we push fcall to block
	 * up P9 protocol messages into single deliminted blocks
	 */
	s = m->c->stream;
	qi = qinfofind("fcall");
	if(s)
	if(s->procq->next)
	if(s->procq->next->info->nodelim) {
		if(qi == 0)
			error(Ebadctl);
		pushq(s, qi);
	}
	c = mattach(m, bogus.spec, bogus.serv);
	poperror();
	return c;