From ohki@gssm.otsuka.tsukuba.ac.jp  Tue Nov 19 00:44:23 1996
Received: from utogw.gssm.otsuka.tsukuba.ac.jp (utogwgw.gssm.otsuka.tsukuba.ac.jp [130.158.176.189])
          by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id AAA23424
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 19 Nov 1996 00:43:48 -0800 (PST)
Received: from smri01.gssm.otsuka.tsukuba.ac.jp (smri01 [192.50.17.160]) by utogw.gssm.otsuka.tsukuba.ac.jp (8.6.12/8.6.9) with ESMTP id RAA02236 for <FreeBSD-gnats-submit@freebsd.org>; Tue, 19 Nov 1996 17:42:55 +0900
Received: (from ohki@localhost) by smri01.gssm.otsuka.tsukuba.ac.jp (8.7.5/8.7.3) id RAA07432; Tue, 19 Nov 1996 17:42:23 +0900 (JST)
Message-Id: <199611190842.RAA07432@smri01.gssm.otsuka.tsukuba.ac.jp>
Date: Tue, 19 Nov 1996 17:42:23 +0900 (JST)
From: ohki@gssm.otsuka.tsukuba.ac.jp
Reply-To: ohki@gssm.otsuka.tsukuba.ac.jp
To: FreeBSD-gnats-submit@freebsd.org
Subject: amity series machines can not show installation menu
X-Send-Pr-Version: 3.2

>Number:         2058
>Category:       i386
>Synopsis:       amity series machines can not show installation menu
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    sos
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 19 00:50:01 PST 1996
>Closed-Date:    Mon May 26 12:06:00 PDT 1997
>Last-Modified:  Mon May 26 12:08:44 PDT 1997
>Originator:     Atsuo Ohki
>Release:        FreeBSD 2.2-ALPHA
>Organization:
GSSM, Univ. of Tsukuba, otsuka, tokyo, japan
>Environment:

	Mitsubish Amity series Pen Computer (amity/vc, amity/sp)
	FreeBSD-961014-SNAP and later

>Description:

	After booting the machine with boot.flp,
	Installation menu should be displayed on the screen,
	but the screen is filled with meaningless color patches.

>How-To-Repeat:

	Just boot the machine with boot.flp
	(of 2.2-961014-SNAP or later)

>Fix:
	
	Video mode map tables of Mitsubishi Amity series machines
	are somehow different from other DOS machines.
   	In order to make M_VGA_C80x25 mode works (at least),
	video_mode_ptr (fetched by scinit()) should be adjusted
	via boot configuration or kernel configuration time.

	Following context diff supports:

	 boot configuration:
		via id_flags of sc0 (bit 8 to bit 11)

	 kernel configuration:
		options		"VIDEO_MODE_OFFSET=x"
	 where x=7 for amity/sp, x=5 for amity/vc


--- syscons.h	Tue Nov 12 18:08:00 1996
+++ syscons.h-new	Mon Nov 18 17:50:04 1996
@@ -71,6 +71,7 @@
 #define CHAR_CURSOR	0x00004
 #define DETECT_KBD	0x00008
 #define XT_KEYBD	0x00010
+#define	VIDEO_OFF(x)	((x) >> 8)
 
 /* attribute flags */
 #define NORMAL_ATTR             0x00

--- syscons.c	Tue Nov 19 17:28:49 1996
+++ syscons.c-new	Tue Nov 19 17:29:09 1996
@@ -102,6 +102,7 @@
 static  default_attr    *current_default;
 static  int     	flags = 0;
 static  char        	init_done = COLD;
+static	char		vmp_modified = 0;	/* XXX */
 static  u_short		sc_buffer[ROW*COL];
 static  char        	switch_in_progress = FALSE;
 static  char        	write_in_progress = FALSE;
@@ -383,6 +384,14 @@
 #endif
 
     scinit();
+#if 1	/* local modification */
+    if (!vmp_modified && video_mode_ptr != NULL) {
+	int off = VIDEO_OFF(dev->id_flags);
+        if (off & 0x10) off |= ~0x0f;
+            video_mode_ptr -= off * 64;
+	vmp_modified = 1;
+    }
+#endif
     flags = dev->id_flags;
 
     scp = console[0];
@@ -883,6 +892,10 @@
 
 	if (!crtc_vga || video_mode_ptr == NULL)
 	    return ENXIO;
+#ifdef VIDEO_MODE_OFFSET
+        if ((cmd & 0xff) < VIDEO_MODE_OFFSET)
+            return ENXIO;
+#endif
 	switch (cmd & 0xff) {
 	case M_VGA_C80x60: case M_VGA_M80x60:
 	    if (!(fonts_loaded & FONT_8))
@@ -2331,6 +2344,11 @@
 	    pa = (((segoff & 0xffff0000) >> 12) + (segoff & 0xffff));
 	    if (ISMAPPED(pa, 64))
 		video_mode_ptr = (char *)pa_to_va(pa);
+#ifdef VIDEO_MODE_OFFSET
+            if (video_mode_ptr != NULL)
+                video_mode_ptr -= (VIDEO_MODE_OFFSET)*64;
+	    vmp_modified = 1;
+#endif
 	}
     }
     current_default = &user_default;
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: mpp 
Responsible-Changed-When: Sat Feb 22 21:12:03 PST 1997 
Responsible-Changed-Why:  
sos is the syscons man. 

Soren, mail to the originator bounces, so don't expect  
any help from that front. 
State-Changed-From-To: open->closed 
State-Changed-By: sos 
State-Changed-When: Mon May 26 12:06:00 PDT 1997 
State-Changed-Why:  


Fixed in 2.2.2 and 3.0-current. Syscons now does some 
simple sanity checks on the modetable, and inhibits 
the use if doomed faulty. 
>Unformatted:
