*BSD News Article 24674


Return to BSD News archive

Newsgroups: comp.os.386bsd.development
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!usenet.ins.cwru.edu!news.csuohio.edu!stever
From: stever@csuohio.edu (Steve Ratliff)
Subject: further HGA patches to syscons
Message-ID: <1993Dec4.230914.23829@news.csuohio.edu>
Sender: news@news.csuohio.edu (USENET News System)
Organization: Cleveland State University
X-Newsreader: Tin 1.1 PL5
Date: Sat, 4 Dec 1993 23:09:14 GMT
Lines: 157

	Here are further patches against the recently posted version of
syscons to make it friendlier to HGA/MDA systems.


*** syscons.c.orig	Sun Nov 21 17:14:33 1993
--- syscons.c	Sat Dec  4 17:41:31 1993
***************
*** 144,150 ****
  	int 		posx;			/* current X position */
  	int 		posy;			/* current Y position */
  	int 		max_posx;		/* X size */
! 	int 		max_posy;		/* X size */
  	term_stat 	term;			/* terminal emulation stuff */
  	char		cursor_start;		/* cursor start line # */
  	char		cursor_end;		/* cursor start end # */
--- 144,150 ----
  	int 		posx;			/* current X position */
  	int 		posy;			/* current Y position */
  	int 		max_posx;		/* X size */
! 	int 		max_posy;		/* Y size */
  	term_stat 	term;			/* terminal emulation stuff */
  	char		cursor_start;		/* cursor start line # */
  	char		cursor_end;		/* cursor start end # */
***************
*** 552,558 ****
  		return 0;
  
  	case CONS_80x25TEXT:	/* set 80x25 text mode */
! 		if (!crtc_vga)
  			return ENXIO;
  		scp->mode = TEXT80x25;
  		scp->max_posy = 25;
--- 552,558 ----
  		return 0;
  
  	case CONS_80x25TEXT:	/* set 80x25 text mode */
! 		if (!crtc_vga && crtc_addr != MONO_BASE)
  			return ENXIO;
  		scp->mode = TEXT80x25;
  		scp->max_posy = 25;
***************
*** 1114,1130 ****
  
  static void scrn_saver(int test)
  {
! 	u_char val;
  
  	if (test) {
! 		scrn_blanked = 1;
!   		outb(TSIDX, 0x01); val = inb(TSREG); 
! 		outb(TSIDX, 0x01); outb(TSREG, val | 0x20);
  	}
  	else {
  		scrn_blanked = 0;
!   		outb(TSIDX, 0x01); val = inb(TSREG); 
! 		outb(TSIDX, 0x01); outb(TSREG, val & 0xDF);
  	}
  }
  #endif
--- 1114,1146 ----
  
  static void scrn_saver(int test)
  {
! 	u_char 		val;
! 	scr_stat	*scp = cur_console;
  
  	if (test) {
! 		if (crtc_vga) {
! 			scrn_blanked = 1;
!   			outb(TSIDX, 0x01); val = inb(TSREG); 
! 			outb(TSIDX, 0x01); outb(TSREG, val | 0x20);
! 		}
! 		else {
! 			if (crtc_addr == MONO_BASE &&
! 			    scp->mode == TEXT80x25) {
! 			    	scrn_blanked = 1;
! 			    	/* text mode on, text blinker on, screen blank*/
! 			    	outb(crtc_addr+4, 0x20);
! 			}
! 		}
  	}
  	else {
  		scrn_blanked = 0;
! 		if (crtc_vga) {
!   			outb(TSIDX, 0x01); val = inb(TSREG); 
! 			outb(TSIDX, 0x01); outb(TSREG, val & 0xDF);
! 		}
! 		else {
! 			set_mode(scp);
! 		}
  	}
  }
  #endif
***************
*** 1331,1337 ****
  	if (new_scp->proc && (new_scp->proc != pfind(new_scp->pid)))
  		new_scp->smode.mode = VT_AUTO;
  
! 	/* check the modes and switch approbiatly */
  	if (old_scp->smode.mode == VT_PROCESS) {
  		old_scp->status |= SWITCH_WAIT_REL;
  		psignal(old_scp->proc, old_scp->smode.relsig);
--- 1347,1353 ----
  	if (new_scp->proc && (new_scp->proc != pfind(new_scp->pid)))
  		new_scp->smode.mode = VT_AUTO;
  
! 	/* check the modes and switch appropriately */
  	if (old_scp->smode.mode == VT_PROCESS) {
  		old_scp->status |= SWITCH_WAIT_REL;
  		psignal(old_scp->proc, old_scp->smode.relsig);
***************
*** 2408,2416 ****
  	if (scp->cursor_start != -1 && scp->cursor_end != -1)
  		cursor_shape(scp->cursor_start, scp->cursor_end);
  
! 	/* mode change only on VGA's */
! 	if (!crtc_vga) 
  		return;
  
  	/* setup video hardware for the given mode */
  	s = splhigh();
--- 2424,2458 ----
  	if (scp->cursor_start != -1 && scp->cursor_end != -1)
  		cursor_shape(scp->cursor_start, scp->cursor_end);
  
! 	/* mode change only on VGA's & HGA's */
! 	if (!crtc_vga) {
! 	/* attempt at mode change on HGA's */
! 	 	if (crtc_addr == MONO_BASE &&
! 		    scp->mode == TEXT80x25) {
! 			s = splhigh();
! 			/* text mode on, text blinker on, screen blank */
! 			outb(crtc_addr+4, 0x20);
! 
! 			/* set up 6845 registers for text mode */
! 			outb(crtc_addr, 0x00); outb(crtc_addr+1, 0x61);
! 			outb(crtc_addr, 0x01); outb(crtc_addr+1, 0x50);
! 			outb(crtc_addr, 0x02); outb(crtc_addr+1, 0x52);
! 			outb(crtc_addr, 0x03); outb(crtc_addr+1, 0x0F);
! 			outb(crtc_addr, 0x04); outb(crtc_addr+1, 0x19);
! 			outb(crtc_addr, 0x05); outb(crtc_addr+1, 0x06);
! 			outb(crtc_addr, 0x06); outb(crtc_addr+1, 0x19);
! 			outb(crtc_addr, 0x07); outb(crtc_addr+1, 0x19);
! 			outb(crtc_addr, 0x08); outb(crtc_addr+1, 0x02);
! 			outb(crtc_addr, 0x09); outb(crtc_addr+1, 0x0D);
! 			outb(crtc_addr, 0x0A); outb(crtc_addr+1, 0x0B);
! 			outb(crtc_addr, 0x0B); outb(crtc_addr+1, 0x0C);
! 
! 			/* text mode on, text blinker on, screen on */
! 			outb(crtc_addr+4, 0x28);
! 			splx(s);
! 		}
  		return;
+ 	}
  
  	/* setup video hardware for the given mode */
  	s = splhigh();