Subject: console stuff
To: None <adamg@microsoft.com>
From: Gordon W. Ross <gwr@jericho.mc.com>
List: port-sun3
Date: 02/22/1994 13:13:23
> From: Adam Glass <adamg@microsoft.com>
> Date: Tue, 22 Feb 94 09:28:37 TZ
> 
> actually this is not enough.  You need to get reads on the /dev/console 
> which opens /dev/prom (essentially) to work.  I rewrote large portions 
> of the driver but didn't get anywhere on input.  I'll play with your 
> nmi change.  I thought i had simulated that but maybe not.

Right.  Sorry if I got your hopes up too much.  I can not yet get
the system sufficiently alive to open /dev/console.

I have an idea for the temporary prom console input:

Use a ring buffer that gets filled by a polling function called
by hard_clock() i.e.:

static char ringbuf[256];
static int ringget, ringput;
static int ringmax = 256;
static int readwant;

promcnpoll() {
	int c;
	while ((c = (romVectorPtr->mayGet)()) >= 0) {
		ringbuf[ringput++] = c;
		if (ringput >= ringmax)
			ringput = 0;
		if (ringput == ringget)
			promcnputc('\007'); /* overrun */
	}
	if (readwant && (ringput != ringput)) {
		readwant = 0;
		wakeup(ringbuf);
	}
}

promcnread(...)
{
	while (ringet == ringput) {
		readwant = 1;
		sleep(ringbuf, ...);
	}
	/* copy ring to uio */
}

------------------------------------------------------------------------------