Subject: Re: m68k: almost boot, console, faq
To: Douglas Thain <>
From: Zach Brown <>
List: port-next68k
Date: 10/13/1998 09:05:34
> 	* Adapt the NextLinux console into a real device driver.

talk to matt debergalis <deberg@MIT.EDU>, he's mentioned he's been hacking
on it.  Matt, here is what I have going.. I should have sent you this long
ago but have been held up.  Sorry.

o	hook the keyboard/mouse int (int 3) 
o	grab the mon control/status register (32bits at offset 0x0 from
	bus addr 0x0200e000) 
o	if the int (0x00800000) and data available bits (0x00400000) 
	are set in the csr then read the mon data reg (32bits from
	offset 0x8 in the mon).  ack the int by clearing the int
	bit and writing back the csr.

the high 4 bits of the data word are the 'address' of the device
reporting.  0 for keyboard, 1 for mouse.  the low 16 bits of the keyboard
version have flags for which key is being pressed (flags for metakeys, a
keycode for the key being pressed) while the mouse has delta values from
its last position and button up/down flags.. so, something alot like:

/* bits in km_data for keyboard */

#define KD_KEYMASK      0x007f
#define KD_DIRECTION    0x0080 /* pressed or released */
#define KD_CNTL         0x0100
#define KD_LSHIFT       0x0200
#define KD_RSHIFT       0x0400
#define KD_LCOMM        0x0800
#define KD_RCOMM        0x1000
#define KD_LALT         0x2000
#define KD_RALT         0x4000
#define KD_VALID        0x8000 /* only set for scancode keys ? */

/* bits in km_data for mouse */
typedef union {
        __u32   data;
        __u32   junk : 16,
                dy: 7, 
                rbut: 1,
                dx: 7,
} kmdata;

the frame buffer is very straight forward and is even well described
(phys addr, len, bit depth) by the prom and put in the mon_global struct.
in addition to the usual memory mapped frame buffer, it has a 'backing
store' region that I haven't played with.. and there are also those funky
'memory write functions' at 16meg increments starting at 0x0c.. I haven't
even touched those.

anyway, do toss me some email if you want to talk NeXT shop.  I could use
some help with the random ass dma controllers.  They're making me angry at
the moment :)

-- zach

- - - - - -
007 373 5963