Subject: Re: pcvt-320b24 anyone ?
To: Manuel Bouyer <bouyer@ensta.fr>
From: Rob Windsor <windsor@punk.weru.ksu.edu>
List: current-users
Date: 05/07/1995 04:45:36
Content-Type: text/plain; charset=ISO-8859-1
Content-Length: 7094

By reproducing Charles' changes to pcvt-3.00 on the last 3.20-beta 
I got it working with a current kernel.

No nice and easy to integrate patch this time - sorry, I realy was in
a hurry and needed a new kernel.


Martin

P.S.: I would vote for an integration of the new pcvt version into
      the main tree as soon as possible.

-- 
Real Programmers don't know how to cook. Grocery stores aren't open at three
in the morning. Real Programmers survive on Twinkies and coffee.
	-- Ed Post


diff -rc pcvt-b24/pcvt_drv.c pcvt/pcvt_drv.c
*** pcvt-b24/pcvt_drv.c	Tue Apr  4 13:15:44 1995
--- pcvt/pcvt_drv.c	Sat Apr 29 16:12:52 1995
***************
*** 138,144 ****
  pcattach(struct device *parent, struct device *self, void *aux)
  {
  	struct isa_attach_args *ia = aux;
! 	static struct intrhand vthand;
  #else
  int
  pcattach(struct isa_device *dev)
--- 138,144 ----
  pcattach(struct device *parent, struct device *self, void *aux)
  {
  	struct isa_attach_args *ia = aux;
! 	static void * vthand;
  #else
  int
  pcattach(struct isa_device *dev)
***************
*** 313,318 ****
--- 313,322 ----
  	
  #if PCVT_NETBSD > 9
  
+ #if 1
+ 	vthand = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_TTY,
+ 					pcrint, 0);
+ #else
  	vthand.ih_fun = pcrint;
  	vthand.ih_arg = 0;
  	vthand.ih_level = IPL_TTY;
***************
*** 322,327 ****
--- 326,332 ----
  #else /* PCVT_NETBSD > 100 */
  	intr_establish(ia->ia_irq, &vthand);
  #endif /* PCVT_NETBSD > 100 */
+ #endif
  
  #else /* PCVT_NETBSD > 9 */
  
***************
*** 554,559 ****
--- 559,575 ----
  	return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
  }
  
+ struct tty *
+ pctty(Dev_t dev)
+ {
+ 	register struct tty *tp;
+ 
+ 	if((tp = get_pccons(dev)) == NULL)
+ 		return 0;
+ 
+ 	return tp;
+ }
+ 
  int
  pcioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
  {
***************
*** 837,843 ****
  
  
  int
! pcrint(void)
  {
  
  #if PCVT_KBD_FIFO
--- 853,859 ----
  
  
  int
! pcrint(void * dummy)
  {
  
  #if PCVT_KBD_FIFO
***************
*** 1207,1213 ****
  		 * won't get any further interrupts.
  		 */
  		s = spltty();
! 		pcrint();
  		splx(s);
  	}
  }
--- 1223,1229 ----
  		 * won't get any further interrupts.
  		 */
  		s = spltty();
! 		pcrint(NULL);
  		splx(s);
  	}
  }
diff -rc pcvt-b24/pcvt_ext.c pcvt/pcvt_ext.c
*** pcvt-b24/pcvt_ext.c	Thu Apr  6 10:07:20 1995
--- pcvt/pcvt_ext.c	Sat Apr 29 15:58:10 1995
***************
*** 80,85 ****
--- 80,87 ----
  static int  s3_928_col( int );
  static int  cl_gd542x_col( int );
  
+ u_short *Crtat;			/* pointer to backing store */
+ 
  /* storage to save video timing values of 80 columns text mode */
  static union {
  	u_char generic[11];
diff -rc pcvt-b24/pcvt_hdr.h pcvt/pcvt_hdr.h
*** pcvt-b24/pcvt_hdr.h	Fri Apr  7 10:16:58 1995
--- pcvt/pcvt_hdr.h	Sat Apr 29 20:18:48 1995
***************
*** 107,113 ****
  #endif
  
  #if PCVT_NETBSD > 9
! #include "i386/isa/isavar.h"
  #include "i386/cpufunc.h"
  #elif PCVT_FREEBSD >= 200
  #include <i386/isa/isa_device.h>
--- 107,113 ----
  #endif
  
  #if PCVT_NETBSD > 9
! #include "dev/isa/isavar.h"
  #include "i386/cpufunc.h"
  #elif PCVT_FREEBSD >= 200
  #include <i386/isa/isa_device.h>
***************
*** 122,128 ****
  #endif
  
  #if PCVT_NETBSD > 100
! #include "i386/isa/isareg.h"
  #elif PCVT_FREEBSD >= 200
  #include <i386/isa/isa.h>
  #else
--- 122,128 ----
  #endif
  
  #if PCVT_NETBSD > 100
! #include "dev/isa/isareg.h"
  #elif PCVT_FREEBSD >= 200
  #include <i386/isa/isa.h>
  #else
***************
*** 154,159 ****
--- 154,160 ----
  #endif
  
  #if PCVT_NETBSD > 9
+ #include "i386/isa/isa_machdep.h"
  #include "i386/isa/pcvt/pcvt_ioctl.h"
  #elif PCVT_FREEBSD >= 200
  #include <machine/pcvt_ioctl.h>
***************
*** 1204,1215 ****
--- 1205,1222 ----
  int	pcclose ( Dev_t dev, int flag, int mode, struct proc *p );
  int	pcread ( Dev_t dev, struct uio *uio, int flag );
  int	pcwrite ( Dev_t dev, struct uio *uio, int flag );
+ struct tty *
+ 	pctty ( Dev_t dev );
  int	pcioctl ( Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p );
  int	pcmmap ( Dev_t dev, int offset, int nprot );
  #if PCVT_FREEBSD > 205
  struct tty *pcdevtotty ( Dev_t dev );
  #endif /* PCVT_FREEBSD > 205 */
+ #if 1
+ int	pcrint ( void * );
+ #else
  int	pcrint ( void );
+ #endif
  int	pcparam ( struct tty *tp, struct termios *t );
  int	pccnprobe ( struct consdev *cp );
  int	pccninit ( struct consdev *cp );
diff -rc pcvt-b24/pcvt_out.c pcvt/pcvt_out.c
*** pcvt-b24/pcvt_out.c	Tue Apr  4 13:15:44 1995
--- pcvt/pcvt_out.c	Sat Apr 29 20:19:41 1995
***************
*** 892,902 ****
  	extern u_short csd_ascii[];		/* pcvt_tbl.h */
  	extern u_short csd_supplemental[];
  	
- 	u_short volatile *cp = Crtat + (CGA_BUF-MONO_BUF)/CHR;
  	u_short was;
  	int nscr, charset;
  	int equipment;
- 	u_short *SaveCrtat = Crtat;
  	struct video_state *svsp;
  
  	do_initialization = 0;		/* reset init necessary flag */
--- 892,900 ----
***************
*** 911,930 ****
  
  			/* set memory start to CGA == B8000 */
  			
! 			Crtat = Crtat + (CGA_BUF-MONO_BUF)/CHR;
  		
  			/* find out, what monitor is connected */
  			
! 			was = *cp;
! 			*cp = (u_short) 0xA55A;
! 			if (*cp != 0xA55A)
  			{
  				addr_6845 = MONO_BASE;
  				color = 0;
  			}
  			else
  			{
! 				*cp = was;
  				addr_6845 = CGA_BASE;
  				color = 1;
  			}
--- 909,929 ----
  
  			/* set memory start to CGA == B8000 */
  			
! 			Crtat = ISA_HOLE_VADDR(CGA_BUF);
  		
  			/* find out, what monitor is connected */
  			
! 			was = *Crtat;
! 			*Crtat = (u_short) 0xA55A;
! 			if (*Crtat != 0xA55A)
  			{
+ 				Crtat = ISA_HOLE_VADDR(MONO_BUF);
  				addr_6845 = MONO_BASE;
  				color = 0;
  			}
  			else
  			{
! 				*Crtat = was;
  				addr_6845 = CGA_BASE;
  				color = 1;
  			}
***************
*** 937,943 ****
  				if(color == 0)
  				{
  					mda2egaorvga();
! 					Crtat = SaveCrtat; /* mono start */
  				}
  
  				/* find out which chipset we are running on */
--- 936,942 ----
  				if(color == 0)
  				{
  					mda2egaorvga();
! 					Crtat = ISA_HOLE_VADDR(MONO_BUF);
  				}
  
  				/* find out which chipset we are running on */
***************
*** 951,957 ****
  				if(color == 0)
  				{
  					mda2egaorvga();
! 					Crtat = SaveCrtat; /* mono start */
  				}	
  			}
  	
--- 950,956 ----
  				if(color == 0)
  				{
  					mda2egaorvga();
! 					Crtat = ISA_HOLE_VADDR(MONO_BUF);
  				}	
  			}
  	
***************
*** 962,968 ****
  
  		case EQ_40COLOR:	/* XXX should panic in 40 col mode ! */
  		case EQ_80COLOR:
! 			Crtat = Crtat + (CGA_BUF-MONO_BUF)/CHR;
  			addr_6845 = CGA_BASE;
  			adaptor_type = CGA_ADAPTOR;
  			color = 1;
--- 961,967 ----
  
  		case EQ_40COLOR:	/* XXX should panic in 40 col mode ! */
  		case EQ_80COLOR:
! 			Crtat = ISA_HOLE_VADDR(CGA_BUF);
  			addr_6845 = CGA_BASE;
  			adaptor_type = CGA_ADAPTOR;
  			color = 1;
***************
*** 970,975 ****
--- 969,975 ----
  			break;
  
  		case EQ_80MONO:
+ 			Crtat = ISA_HOLE_VADDR(MONO_BUF);
  			addr_6845 = MONO_BASE;
  			adaptor_type = MDA_ADAPTOR;
  			color = 0;