Rudimentary support for the VS3100 builtin graphics console.
This commit is contained in:
parent
e167016fdb
commit
78ebccfc2d
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: GENERIC,v 1.31 1998/05/22 09:59:55 ragge Exp $
|
||||
# $NetBSD: GENERIC,v 1.32 1998/06/04 15:59:04 ragge Exp $
|
||||
#
|
||||
# GENERIC VAX configuration file; all supported devices.
|
||||
#
|
||||
|
@ -147,9 +147,14 @@ dz0 at uba? csr 0160100 # DZ-11
|
|||
dz0 at vsbus0 # DC-367
|
||||
dl0 at uba? csr 0176500 # DL-11
|
||||
|
||||
# VAXstation graphics support
|
||||
smg0 at vsbus0 # Small monochrome display ctlr.
|
||||
wsdisplay0 at smg0 # display device driver.
|
||||
lkc0 at dz0 # Keyboard LK201
|
||||
|
||||
pseudo-device loop 1
|
||||
pseudo-device pty 48
|
||||
pseudo-device bpfilter 8 # Not supported by de or qe yet.
|
||||
pseudo-device bpfilter 8 # Not supported by de yet.
|
||||
pseudo-device sl 2
|
||||
pseudo-device ppp 2
|
||||
pseudo-device tun 2
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: files.vax,v 1.36 1998/05/22 09:59:55 ragge Exp $
|
||||
# $NetBSD: files.vax,v 1.37 1998/06/04 15:59:04 ragge Exp $
|
||||
#
|
||||
# new style config file for vax architecture
|
||||
#
|
||||
|
@ -50,6 +50,9 @@ device ht: tape
|
|||
attach ht at mba
|
||||
file arch/vax/mba/ht.c ht needs-flag
|
||||
|
||||
# wscons files.
|
||||
include "dev/wscons/files.wscons"
|
||||
|
||||
# MSCP device drivers
|
||||
include "arch/vax/mscp/files.mscp"
|
||||
major {ra = 9}
|
||||
|
@ -98,7 +101,7 @@ attach dhu at uba
|
|||
file arch/vax/uba/dhu.c dhu needs-count
|
||||
|
||||
# DZ11(-compatible) at UBA/vsbus
|
||||
device dz: tty
|
||||
device dz { }: tty
|
||||
file arch/vax/uba/dz.c dz needs-count
|
||||
|
||||
attach dz at uba with dz_uba
|
||||
|
@ -137,24 +140,22 @@ device ln: ifnet, ether
|
|||
attach ln at vsbus
|
||||
file arch/vax/vsa/if_ln.c ln
|
||||
|
||||
# DC367-B in VAXstation 2000/3100 (DZ-like 4-port serial line controller,
|
||||
# controls keyboard, mouse, modem, and printer/console)
|
||||
device dc: tty
|
||||
attach dc at vsbus
|
||||
file arch/vax/vsa/dc.c dc needs-flag
|
||||
file arch/vax/vsa/lk201.c dc
|
||||
# Monochrome framebuffer on VS3100.
|
||||
device smg: wsemuldisplaydev, wsrasteremulops
|
||||
attach smg at vsbus
|
||||
file arch/vax/vsa/smg.c smg needs-flag
|
||||
|
||||
# PM Framebuffer in VAXstation 2000/3100
|
||||
device pm
|
||||
attach pm at vsbus
|
||||
file arch/vax/vsa/pm.c pm needs-flag
|
||||
device lkc # : wskbddev, wsmousedev
|
||||
attach lkc at dz
|
||||
file arch/vax/vsa/lkc.c lkc needs-flag
|
||||
|
||||
# QDSS at UBA
|
||||
device qd
|
||||
attach qd at uba
|
||||
file arch/vax/uba/qd.c qd needs-count
|
||||
file arch/vax/uba/qfont.c qd
|
||||
file arch/vax/uba/qfont.c qd | smg
|
||||
|
||||
# DL-11 at UBA
|
||||
device dl: tty
|
||||
attach dl at uba
|
||||
file arch/vax/uba/dl.c dl needs-flag
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: conf.c,v 1.34 1998/05/21 13:02:20 ragge Exp $ */
|
||||
/* $NetBSD: conf.c,v 1.35 1998/06/04 15:52:49 ragge Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1982, 1986 The Regents of the University of California.
|
||||
|
@ -147,11 +147,22 @@ int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]);
|
|||
*/
|
||||
#include <dev/cons.h>
|
||||
|
||||
#include "lkc.h"
|
||||
#if NLKC
|
||||
#define smgcngetc lkccngetc
|
||||
#else
|
||||
#define smgcngetc nullcngetc
|
||||
#endif
|
||||
|
||||
#define smgcnputc wsdisplay_cnputc
|
||||
|
||||
cons_decl(gen);
|
||||
cons_decl(dz);
|
||||
cons_decl(qd);
|
||||
cons_decl(smg);
|
||||
#include "qv.h"
|
||||
#include "qd.h"
|
||||
#include "smg.h"
|
||||
|
||||
struct consdev constab[]={
|
||||
#if VAX8600 || VAX780 || VAX750 || VAX650 || VAX630
|
||||
|
@ -171,6 +182,9 @@ struct consdev constab[]={
|
|||
cons_init(qd),
|
||||
#endif
|
||||
#endif
|
||||
#if 0 /* NSMG XXX fails due to wscons */
|
||||
cons_init(smg),
|
||||
#endif
|
||||
|
||||
#ifdef notyet
|
||||
/* We may not always use builtin console, sometimes RD */
|
||||
|
@ -355,6 +369,13 @@ cdev_decl(uk);
|
|||
|
||||
dev_decl(filedesc,open);
|
||||
|
||||
#include "wsdisplay.h"
|
||||
cdev_decl(wsdisplay);
|
||||
#include "wskbd.h"
|
||||
cdev_decl(wskbd);
|
||||
#include "wsmouse.h"
|
||||
cdev_decl(wsmouse);
|
||||
|
||||
struct cdevsw cdevsw[] =
|
||||
{
|
||||
cdev_cn_init(1,cn), /* 0: virtual console */
|
||||
|
@ -425,6 +446,12 @@ struct cdevsw cdevsw[] =
|
|||
cdev_uk_init(NUK,uk), /* 65: SCSI unknown */
|
||||
cdev_tty_init(NDL,dl), /* 66: DL11 */
|
||||
cdev_rnd_init(NRND,rnd), /* 67: random source pseudo-device */
|
||||
cdev_wsdisplay_init(NWSDISPLAY,
|
||||
wsdisplay), /* 68: frame buffers, etc. */
|
||||
|
||||
cdev_mouse_init(NWSKBD, wskbd), /* 69: keyboards */
|
||||
cdev_mouse_init(NWSMOUSE,
|
||||
wsmouse), /* 70: mice */
|
||||
};
|
||||
int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ka410.c,v 1.9 1998/05/22 09:26:33 ragge Exp $ */
|
||||
/* $NetBSD: ka410.c,v 1.10 1998/06/04 15:52:48 ragge Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
|
||||
* All rights reserved.
|
||||
|
@ -52,6 +52,8 @@
|
|||
#include <machine/clock.h>
|
||||
#include <machine/vsbus.h>
|
||||
|
||||
#include "smg.h"
|
||||
|
||||
static void ka410_conf __P((struct device*, struct device*, void*));
|
||||
static void ka410_steal_pages __P((void));
|
||||
static void ka410_memerr __P((void));
|
||||
|
@ -162,6 +164,14 @@ ka410_steal_pages()
|
|||
if (((int)le_iomem & ~KERNBASE) > 0xffffff)
|
||||
parctl = PARCTL_DMA;
|
||||
|
||||
#if NSMG > 0
|
||||
if ((vax_confdata & 0x80) == 0) { /* Video controller present */
|
||||
MAPVIRT(sm_addr, (SMSIZE / NBPG));
|
||||
pmap_map((vm_offset_t)sm_addr, (vm_offset_t)SMADDR,
|
||||
(vm_offset_t)SMADDR + SMSIZE, VM_PROT_READ|VM_PROT_WRITE);
|
||||
((struct vs_cpu *)VS_REGS)->vc_vdcorg = 0;
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* Clear restart and boot in progress flags
|
||||
* in the CPMBX. (ie. clear bits 4 and 5)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: machdep.c,v 1.54 1998/05/08 16:55:17 kleink Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.55 1998/06/04 15:52:48 ragge Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
|
||||
|
@ -458,7 +458,11 @@ setstatclockrate(hzrate)
|
|||
void
|
||||
consinit()
|
||||
{
|
||||
extern int smgprobe(void), smgcninit(void);
|
||||
cninit();
|
||||
/* XXX - do this probe after everything else due to wscons trouble */
|
||||
if (smgprobe())
|
||||
smgcninit();
|
||||
#ifdef DDB
|
||||
/* db_machine_init(); */
|
||||
ddb_init();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: dz_vsbus.c,v 1.3 1998/05/23 12:49:31 ragge Exp $ */
|
||||
/* $NetBSD: dz_vsbus.c,v 1.4 1998/06/04 15:51:12 ragge Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1998 Ludd, University of Lule}, Sweden.
|
||||
* All rights reserved.
|
||||
|
@ -54,9 +54,11 @@
|
|||
#include <vax/uba/dzvar.h>
|
||||
|
||||
#include "ioconf.h"
|
||||
#include "lkc.h"
|
||||
|
||||
static int dz_vsbus_match __P((struct device *, struct cfdata *, void *));
|
||||
static void dz_vsbus_attach __P((struct device *, struct device *, void *));
|
||||
static int dz_print __P((void *, const char *));
|
||||
static void txon __P((void));
|
||||
static void rxon __P((void));
|
||||
|
||||
|
@ -76,6 +78,16 @@ txon()
|
|||
vsbus_intr_enable(INR_ST);
|
||||
}
|
||||
|
||||
int
|
||||
dz_print(aux, name)
|
||||
void *aux;
|
||||
const char *name;
|
||||
{
|
||||
if (name)
|
||||
printf ("lkc at %s", name);
|
||||
return (UNCONF);
|
||||
}
|
||||
|
||||
static int
|
||||
dz_vsbus_match(parent, cf, aux)
|
||||
struct device *parent;
|
||||
|
@ -114,6 +126,9 @@ dz_vsbus_attach(parent, self, aux)
|
|||
printf(": DC367");
|
||||
|
||||
dzattach(sc);
|
||||
|
||||
if ((vax_confdata & 0x80) == 0) /* workstation, have lkc */
|
||||
config_found(self, 0, dz_print);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
@ -188,10 +203,6 @@ dzcninit(cndev)
|
|||
dz = (void*)dz_regs;
|
||||
|
||||
dz->csr = 0; /* Disable scanning until initting is done */
|
||||
dz->rbuf = 0; /* Turn off line 0's receiver */
|
||||
dz->rbuf = 1; /* Turn off line 1's receiver */
|
||||
dz->rbuf = 2; /* Turn off line 2's receiver */
|
||||
/* Leave line 3 alone */
|
||||
dz->tcr = 8; /* Turn off all but line 3's xmitter */
|
||||
dz->csr = 0x20; /* Turn scanning back on */
|
||||
}
|
||||
|
@ -229,3 +240,44 @@ dzcnpollc(dev, pollflag)
|
|||
int pollflag;
|
||||
{
|
||||
}
|
||||
|
||||
#if NLKC
|
||||
cons_decl(lkc);
|
||||
|
||||
void
|
||||
lkccninit(cndev)
|
||||
struct consdev *cndev;
|
||||
{
|
||||
dz = (void*)dz_regs;
|
||||
|
||||
dz->csr = 0; /* Disable scanning until initting is done */
|
||||
dz->tcr = 1; /* Turn off all but line 0's xmitter */
|
||||
dz->rbuf = 0x1c18; /* XXX */
|
||||
dz->csr = 0x20; /* Turn scanning back on */
|
||||
}
|
||||
|
||||
int
|
||||
lkccngetc(dev)
|
||||
dev_t dev;
|
||||
{
|
||||
int c;
|
||||
u_char mask;
|
||||
extern unsigned short q_key[];
|
||||
|
||||
mask = vs_cpu->vc_intmsk; /* save old state */
|
||||
vs_cpu->vc_intmsk = 0; /* disable all interrupts */
|
||||
|
||||
loop:
|
||||
while ((dz->csr & 0x80) == 0)
|
||||
; /* Wait for char */
|
||||
|
||||
c = q_key[dz->rbuf & 255];
|
||||
if (c == 0)
|
||||
goto loop;
|
||||
|
||||
vs_cpu->vc_intclr = 0x80; /* clear te interrupt request */
|
||||
vs_cpu->vc_intmsk = mask; /* restore interrupt mask */
|
||||
|
||||
return (c);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -0,0 +1,136 @@
|
|||
/* $NetBSD: lkc.c,v 1.1 1998/06/04 15:51:12 ragge Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1998 Ludd, University of Lule}, Sweden.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed at Ludd, University of
|
||||
* Lule}, Sweden and its contributors.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
#include <dev/wscons/wscons_callbacks.h>
|
||||
|
||||
#include <dev/dec/lk201.h>
|
||||
|
||||
#include <machine/vsbus.h>
|
||||
|
||||
#include <vax/uba/dzreg.h>
|
||||
#include <vax/uba/dzvar.h>
|
||||
|
||||
#include "ioconf.h"
|
||||
|
||||
static int lkc_match __P((struct device *, struct cfdata *, void *));
|
||||
static void lkc_attach __P((struct device *, struct device *, void *));
|
||||
static int lkc_catch __P((int, int));
|
||||
|
||||
struct lkc_softc {
|
||||
struct device ls_dev;
|
||||
int ls_shifted; /* Shift key pressed */
|
||||
int ls_ctrl; /* Ctrl key pressed */
|
||||
int ls_lastchar; /* last key pressed (for repeat) */
|
||||
};
|
||||
|
||||
struct cfattach lkc_ca = {
|
||||
sizeof(struct lkc_softc), lkc_match, lkc_attach,
|
||||
};
|
||||
|
||||
int
|
||||
lkc_match(parent, cf, aux)
|
||||
struct device *parent;
|
||||
struct cfdata *cf;
|
||||
void *aux;
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
lkc_attach(parent, self, aux)
|
||||
struct device *parent, *self;
|
||||
void *aux;
|
||||
{
|
||||
struct dz_softc *dz = (void *)parent;
|
||||
|
||||
printf("\n");
|
||||
dz->sc_catch = lkc_catch; /* Catch keyb & mouse chars fast */
|
||||
*dz->sc_dr.dr_lpr = 0x1c18; /* XXX */
|
||||
vsbus_intr_enable(INR_SR);
|
||||
}
|
||||
|
||||
int
|
||||
lkc_catch(line, ch)
|
||||
int line, ch;
|
||||
{
|
||||
struct lkc_softc *ls = lkc_cd.cd_devs[0]; /* XXX */
|
||||
extern unsigned short q_key[], q_shift_key[];
|
||||
extern char *q_special[];
|
||||
u_short hej;
|
||||
char c, *cp;
|
||||
|
||||
if (line > 1)
|
||||
return 0;
|
||||
|
||||
switch (ch) {
|
||||
case KEY_SHIFT:
|
||||
ls->ls_shifted ^= 1;
|
||||
return 1;
|
||||
|
||||
case KEY_UP:
|
||||
ls->ls_shifted = ls->ls_ctrl = 0;
|
||||
return 1;
|
||||
|
||||
case KEY_CONTROL:
|
||||
ls->ls_ctrl ^= 1;
|
||||
return 1;
|
||||
|
||||
case KEY_REPEAT:
|
||||
ch = ls->ls_lastchar;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
hej = (ls->ls_shifted ? q_shift_key[ch] : q_key[ch]);
|
||||
c = hej;
|
||||
ls->ls_lastchar = ch;
|
||||
|
||||
if (ls->ls_ctrl && c > 64)
|
||||
c &= 31;
|
||||
|
||||
if (hej > 255) {
|
||||
cp = q_special[hej & 255];
|
||||
wsdisplay_kbdinput(wsdisplay_cd.cd_devs[0], cp, strlen(cp));
|
||||
} else
|
||||
wsdisplay_kbdinput(wsdisplay_cd.cd_devs[0], &c, 1);
|
||||
return 1;
|
||||
}
|
|
@ -0,0 +1,373 @@
|
|||
/* $NetBSD: smg.c,v 1.1 1998/06/04 15:51:12 ragge Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1998 Ludd, University of Lule}, Sweden.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed at Ludd, University of
|
||||
* Lule}, Sweden and its contributors.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/device.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/conf.h>
|
||||
|
||||
#include <dev/cons.h>
|
||||
|
||||
#include <dev/wscons/wsdisplayvar.h>
|
||||
#include <dev/wscons/wsconsio.h>
|
||||
#include <dev/wscons/wscons_callbacks.h>
|
||||
|
||||
#include <machine/vsbus.h>
|
||||
#include <machine/sid.h>
|
||||
|
||||
#include "lkc.h"
|
||||
|
||||
#define SM_COLS 128 /* char width of screen */
|
||||
#define SM_ROWS 57 /* rows of char on screen */
|
||||
#define SM_CHEIGHT 15 /* lines a char consists of */
|
||||
#define SM_NEXTROW (SM_COLS * SM_CHEIGHT)
|
||||
|
||||
static int smg_match __P((struct device *, struct cfdata *, void *));
|
||||
static void smg_attach __P((struct device *, struct device *, void *));
|
||||
|
||||
struct smg_softc {
|
||||
struct device ss_dev;
|
||||
};
|
||||
|
||||
struct cfattach smg_ca = {
|
||||
sizeof(struct smg_softc), smg_match, smg_attach,
|
||||
};
|
||||
|
||||
static void smg_cursor __P((void *, int, int, int));
|
||||
static void smg_putstr __P((void *, int, int, char *, int, long));
|
||||
static void smg_copycols __P((void *, int, int, int,int));
|
||||
static void smg_erasecols __P((void *, int, int, int, long));
|
||||
static void smg_copyrows __P((void *, int, int, int));
|
||||
static void smg_eraserows __P((void *, int, int, long));
|
||||
static int smg_alloc_attr __P((void *, int, int, int, long *));
|
||||
|
||||
const struct wsdisplay_emulops smg_emulops = {
|
||||
smg_cursor,
|
||||
smg_putstr,
|
||||
smg_copycols,
|
||||
smg_erasecols,
|
||||
smg_copyrows,
|
||||
smg_eraserows,
|
||||
smg_alloc_attr
|
||||
};
|
||||
|
||||
const struct wsscreen_descr smg_stdscreen = {
|
||||
"128x57", 128, 57,
|
||||
&smg_emulops,
|
||||
8, 15,
|
||||
0, /* WSSCREEN_UNDERLINE??? */
|
||||
};
|
||||
|
||||
const struct wsscreen_descr *_smg_scrlist[] = {
|
||||
&smg_stdscreen,
|
||||
};
|
||||
|
||||
const struct wsscreen_list smg_screenlist = {
|
||||
sizeof(_smg_scrlist) / sizeof(struct wsscreen_descr *),
|
||||
_smg_scrlist,
|
||||
};
|
||||
|
||||
static int smg_ioctl __P((void *, u_long, caddr_t, int, struct proc *));
|
||||
static int smg_mmap __P((void *, off_t, int));
|
||||
static int smg_alloc_screen __P((void *, const struct wsscreen_descr *,
|
||||
void **, int *, int *, long *));
|
||||
static void smg_free_screen __P((void *, void *));
|
||||
static void smg_show_screen __P((void *, void *));
|
||||
static int smg_load_font __P((void *, void *, int, int, int, void *));
|
||||
|
||||
const struct wsdisplay_accessops smg_accessops = {
|
||||
smg_ioctl,
|
||||
smg_mmap,
|
||||
smg_alloc_screen,
|
||||
smg_free_screen,
|
||||
smg_show_screen,
|
||||
smg_load_font
|
||||
};
|
||||
|
||||
struct smg_screen {
|
||||
int ss_curx;
|
||||
int ss_cury;
|
||||
};
|
||||
|
||||
struct smg_config {
|
||||
struct smg_screen ss_devs[8]; /* XXX */
|
||||
};
|
||||
|
||||
int
|
||||
smg_match(parent, match, aux)
|
||||
struct device *parent;
|
||||
struct cfdata *match;
|
||||
void *aux;
|
||||
{
|
||||
struct vsbus_attach_args *va = aux;
|
||||
|
||||
if (va->va_type != INR_VF)
|
||||
return 0;
|
||||
#ifdef DIAGNOSTIC
|
||||
if (sm_addr == 0)
|
||||
panic("smg: inconsistency in smg address mapping");
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
smg_attach(parent, self, aux)
|
||||
struct device *parent, *self;
|
||||
void *aux;
|
||||
{
|
||||
struct wsemuldisplaydev_attach_args aa;
|
||||
struct smg_config *sc;
|
||||
|
||||
printf("\n");
|
||||
sc = malloc(sizeof(struct smg_config), M_DEVBUF, M_WAITOK);
|
||||
aa.console = !(vax_confdata & 0x20);
|
||||
aa.scrdata = &smg_screenlist;
|
||||
aa.accessops = &smg_accessops;
|
||||
aa.accesscookie = sc;
|
||||
|
||||
config_found(self, &aa, wsemuldisplaydevprint);
|
||||
}
|
||||
|
||||
void
|
||||
smg_cursor(id, on, row, col)
|
||||
void *id;
|
||||
int on, row, col;
|
||||
{
|
||||
sm_addr[(row * 15 * 128) + col + (14 * 128)] = on ? 255 : 0;
|
||||
}
|
||||
|
||||
static void
|
||||
smg_putstr(id, row, col, cp, len, attr)
|
||||
void *id;
|
||||
int row, col;
|
||||
char *cp;
|
||||
int len;
|
||||
long attr;
|
||||
{
|
||||
int i, j;
|
||||
extern char q_font[];
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
for (j = 0; j < 15; j++)
|
||||
sm_addr[col + i + (row * 15 * 128) + j * 128] =
|
||||
q_font[(cp[i] - 32) * 15 + j];
|
||||
}
|
||||
|
||||
/*
|
||||
* copies columns inside a row.
|
||||
*/
|
||||
static void
|
||||
smg_copycols(id, row, srccol, dstcol, ncols)
|
||||
void *id;
|
||||
int row, srccol, dstcol, ncols;
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < SM_CHEIGHT; i++)
|
||||
bcopy(&sm_addr[(row * SM_NEXTROW) + srccol + (i * 128)],
|
||||
&sm_addr[(row * SM_NEXTROW) + dstcol + i*128], ncols);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Erases a bunch of chars inside one row.
|
||||
*/
|
||||
static void
|
||||
smg_erasecols(id, row, startcol, ncols, fillattr)
|
||||
void *id;
|
||||
int row, startcol, ncols;
|
||||
long fillattr;
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < SM_CHEIGHT; i++)
|
||||
bzero(&sm_addr[(row * SM_NEXTROW) + startcol + i * 128], ncols);
|
||||
}
|
||||
|
||||
static void
|
||||
smg_copyrows(id, srcrow, dstrow, nrows)
|
||||
void *id;
|
||||
int srcrow, dstrow, nrows;
|
||||
{
|
||||
int frows;
|
||||
|
||||
if (nrows > 25) {
|
||||
frows = nrows >> 1;
|
||||
if (srcrow > dstrow) {
|
||||
bcopy(&sm_addr[(srcrow * SM_NEXTROW)],
|
||||
&sm_addr[(dstrow * SM_NEXTROW)],
|
||||
frows * SM_NEXTROW);
|
||||
bcopy(&sm_addr[((srcrow + frows) * SM_NEXTROW)],
|
||||
&sm_addr[((dstrow + frows) * SM_NEXTROW)],
|
||||
(nrows - frows) * SM_NEXTROW);
|
||||
} else {
|
||||
bcopy(&sm_addr[((srcrow + frows) * SM_NEXTROW)],
|
||||
&sm_addr[((dstrow + frows) * SM_NEXTROW)],
|
||||
(nrows - frows) * SM_NEXTROW);
|
||||
bcopy(&sm_addr[(srcrow * SM_NEXTROW)],
|
||||
&sm_addr[(dstrow * SM_NEXTROW)],
|
||||
frows * SM_NEXTROW);
|
||||
}
|
||||
} else
|
||||
bcopy(&sm_addr[(srcrow * SM_NEXTROW)],
|
||||
&sm_addr[(dstrow * SM_NEXTROW)], nrows * SM_NEXTROW);
|
||||
}
|
||||
|
||||
static void
|
||||
smg_eraserows(id, startrow, nrows, fillattr)
|
||||
void *id;
|
||||
int startrow, nrows;
|
||||
long fillattr;
|
||||
{
|
||||
int frows;
|
||||
|
||||
if (nrows > 25) {
|
||||
frows = nrows >> 1;
|
||||
bzero(&sm_addr[(startrow * SM_NEXTROW)], frows * SM_NEXTROW);
|
||||
bzero(&sm_addr[((startrow + frows) * SM_NEXTROW)],
|
||||
(nrows - frows) * SM_NEXTROW);
|
||||
} else
|
||||
bzero(&sm_addr[(startrow * SM_NEXTROW)], nrows * SM_NEXTROW);
|
||||
}
|
||||
|
||||
static int
|
||||
smg_alloc_attr(id, fg, bg, flags, attrp)
|
||||
void *id;
|
||||
int fg, bg;
|
||||
int flags;
|
||||
long *attrp;
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
smg_ioctl(v, cmd, data, flag, p)
|
||||
void *v;
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
int flag;
|
||||
struct proc *p;
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
smg_mmap(v, offset, prot)
|
||||
void *v;
|
||||
off_t offset;
|
||||
int prot;
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
smg_alloc_screen(v, type, cookiep, curxp, curyp, defattrp)
|
||||
void *v;
|
||||
const struct wsscreen_descr *type;
|
||||
void **cookiep;
|
||||
int *curxp, *curyp;
|
||||
long *defattrp;
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
smg_free_screen(v, cookie)
|
||||
void *v;
|
||||
void *cookie;
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
smg_show_screen(v, cookie)
|
||||
void *v;
|
||||
void *cookie;
|
||||
{
|
||||
}
|
||||
|
||||
static int
|
||||
smg_load_font(v, cookie, first, num, stride, data)
|
||||
void *v;
|
||||
void *cookie;
|
||||
int first, num, stride;
|
||||
void *data;
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
cons_decl(smg);
|
||||
|
||||
#define WSCONSOLEMAJOR 68
|
||||
|
||||
void
|
||||
smgcninit(cndev)
|
||||
struct consdev *cndev;
|
||||
{
|
||||
extern void lkccninit __P((struct consdev *));
|
||||
extern int lkccngetc __P((dev_t));
|
||||
/* Clear screen */
|
||||
blkclr(sm_addr, 128*864);
|
||||
|
||||
wsdisplay_cnattach(&smg_stdscreen, 0, 0, 0, 0);
|
||||
cn_tab->cn_dev = makedev(WSCONSOLEMAJOR, 0);
|
||||
#if NLKC
|
||||
lkccninit(cndev);
|
||||
wsdisplay_set_cons_kbd(lkccngetc, nullcnpollc);
|
||||
#endif
|
||||
}
|
||||
|
||||
int smgprobe(void);
|
||||
int
|
||||
smgprobe()
|
||||
{
|
||||
switch (vax_boardtype) {
|
||||
case VAX_BTYP_410:
|
||||
case VAX_BTYP_420:
|
||||
case VAX_BTYP_43:
|
||||
if (vax_confdata & 0x20) /* doesn't use graphics console */
|
||||
break;
|
||||
if (sm_addr == 0) /* Haven't mapped graphic area */
|
||||
break;
|
||||
|
||||
return 1;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: vsbus.c,v 1.10 1998/05/21 13:10:59 ragge Exp $ */
|
||||
/* $NetBSD: vsbus.c,v 1.11 1998/06/04 15:51:12 ragge Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
|
||||
* All rights reserved.
|
||||
|
@ -142,6 +142,12 @@ vsbus_attach(parent, self, aux)
|
|||
/* Always have serial line */
|
||||
va.va_type = INR_SR;
|
||||
config_found(self, &va, vsbus_print);
|
||||
|
||||
/* If sm_addr is set, a monochrome graphics adapter is found */
|
||||
if (sm_addr) {
|
||||
va.va_type = INR_VF;
|
||||
config_found(self, &va, vsbus_print);
|
||||
}
|
||||
}
|
||||
|
||||
static void stray __P((int));
|
||||
|
|
Loading…
Reference in New Issue