[comp.os.minix] Putting color into Minix

hall@cod.NOSC.MIL (Robert R. Hall) (07/21/89)

I have an EGA monitor on my computer system and with such I find  the Minix
default colors of gray on black depressing.  Here are my patches that I have
made to get my color preference, if you don't like them, the diff show where
the constants are define so you can change to suit youself.

The diff are relative to Bruce Evans protected mode patches but also work
on version 1.3d files with offset messages beening produced.

--------------------     cut here   ---------------
echo x - bootblok.s.cdi
sed '/^X/s///' > bootblok.s.cdi << '/'
X*** /usr/v1.3d/tools/bootblok.s	Fri May 12 10:22:19 1989
X--- bootblok.s	Tue Jul 18 09:26:31 1989
X***************
X*** 24,29 ****
X--- 24,30 ----
X          BIOSSEG = 0x07C0         | here the boot block itself is loaded
X          BOOTSEG = 0x2FE0         | here it will copy itself (192K-512b)
X          DSKBASE = 120            | 120 = 4 * 0x1E = ptr to disk parameters
X+         VIDATT	= 0x1f		 | Video attributes for screen (GLM)
X  
X  final   = 504
X  fsck_ds = 506
X***************
X*** 67,72 ****
X--- 68,79 ----
X  	mov	ax,#2		| reset video
X  	int	0x10
X  
X+         mov	ax,#0x0600	| Use scroll window to clear screen (GLM)
X+         movb	bh,#VIDATT	| and set the video attribute (GLM)
X+         xor	cx,cx		| (GLM)
X+         mov	dx,#0x184f	| (GLM)
X+         int	0x10		| (GLM)
X+ 
X          mov     ax,#0x0200	| BIOS call in put cursor in ul corner
X          xor     bx,bx
X          xor     dx,dx
/
echo x - console.c.cdif
sed '/^X/s///' > console.c.cdif << '/'
X*** m286pm/kernel/console.c	Fri Jul 17 16:09:36 1998
X--- console.c	Fri Jul 17 16:17:51 1998
X***************
X*** 25,31 ****
X  #define M_RETRACE     0x7000	/* how many characters to display at once */
X  #define BEEP_FREQ     0x0533	/* value to put into timer to set beep freq */
X  #define B_TIME		   3	/* length of CTRL-G beep is ticks */
X! #define BLANK         0x0700	/* determines  cursor color on blank screen */
X  #define LINE_WIDTH        80	/* # characters on a line */
X  #define SCR_LINES         25	/* # lines on the screen */
X  #define SCR_BYTES	8000	/* size video RAM. multiple of 2*LINE_WIDTH */
X--- 25,32 ----
X  #define M_RETRACE     0x7000	/* how many characters to display at once */
X  #define BEEP_FREQ     0x0533	/* value to put into timer to set beep freq */
X  #define B_TIME		   3	/* length of CTRL-G beep is ticks */
X! #define BLANK         0x1F00	/* determines screen color on blank screen */
X! #define REVERSE       0x4F00    /* determines screen color on reverse screen */
X  #define LINE_WIDTH        80	/* # characters on a line */
X  #define SCR_LINES         25	/* # lines on the screen */
X  #define SCR_BYTES	8000	/* size video RAM. multiple of 2*LINE_WIDTH */
X***************
X*** 78,84 ****
X  PUBLIC  message keybd_mess;	/* message used for console input chars */
X  PUBLIC int vid_mask;		/* 037777 for color (16K) or 07777 for mono */
X  PUBLIC int vid_port;		/* I/O port for accessing 6845 */
X! PUBLIC int blank_color = 0x0700; /* display code for blank */
X  PRIVATE vid_retrace;		/* how many characters to display per burst */
X  PRIVATE unsigned vid_base;	/* base of video ram (0xB000 or 0xB800) */
X  PRIVATE int esc;		/* escape scan code detected? */
X--- 79,85 ----
X  PUBLIC  message keybd_mess;	/* message used for console input chars */
X  PUBLIC int vid_mask;		/* 037777 for color (16K) or 07777 for mono */
X  PUBLIC int vid_port;		/* I/O port for accessing 6845 */
X! PUBLIC int blank_color = BLANK; /* display code for blank */
X  PRIVATE vid_retrace;		/* how many characters to display per burst */
X  PRIVATE unsigned vid_base;	/* base of video ram (0xB000 or 0xB800) */
X  PRIVATE int esc;		/* escape scan code detected? */
X***************
X*** 634,642 ****
X   
X   			    case 7: /*  REVERSE  (black on light grey)  */
X  				if (color)
X! 	 				tp->tty_attribute = 
X! 					 ((attr & 0xf000) >> 4) |
X! 					 ((attr & 0x0f00) << 4);
X  				else if ((attr & 0x7000) == 0)
X  					tp->tty_attribute =
X  					 (attr & 0x8800) | 0x7000;
X--- 635,644 ----
X   
X   			    case 7: /*  REVERSE  (black on light grey)  */
X  				if (color)
X! 					if ((attr & 0x1f00) == 0x1f00)
X! 						tp->tty_attribute = REVERSE;
X! 					else
X! 						tp->tty_attribute = BLANK;
X  				else if ((attr & 0x7000) == 0)
X  					tp->tty_attribute =
X  					 (attr & 0x8800) | 0x7000;
/