From owner-FreeBSD-users-jp@jp.freebsd.org  Wed Jan 29 05:58:16 1997
Received: by jaz.jp.freebsd.org (8.8.5+2.7Wbeta4/8.7.3) id FAA01086
	Wed, 29 Jan 1997 05:58:16 +0900 (JST)
Received: by jaz.jp.freebsd.org (8.8.5+2.7Wbeta4/8.7.3) with SMTP id FAA01060
	Wed, 29 Jan 1997 05:58:12 +0900 (JST)
Received: from miserver.minet.my (j7.brf53.jaring.my [161.142.235.213]) by relay3.jaring.my (8.6.13/8.6.12) with ESMTP id EAA12985; Wed, 29 Jan 1997 04:57:50 +0800
Message-Id: <199701282057.EAA12985@relay3.jaring.my>
Received: from localhost (localhost [127.0.0.1]) by miserver.minet.my (8.8.5/3.4W3) with ESMTP id EAA00303; Wed, 29 Jan 1997 04:56:08 +0800 (MYT)
To: FreeBSD-users-jp@jp.freebsd.org, hosokawa@mt.cs.keio.ac.jp
Cc: FreeBSD-tech-jp@jp.freebsd.org, iwasaki@pc.jaring.my
In-Reply-To: Your message of "Wed, 29 Jan 1997 02:44:32 +0900"
References: <199701281744.CAA19538@frig.mt.cs.keio.ac.jp>
X-Mailer: Mew version 1.54 on Emacs 19.28.1, Mule 2.3
Mime-Version: 1.0
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Date: Wed, 29 Jan 1997 04:56:07 +0800
From: Mitsuru IWASAKI <iwasaki@pc.jaring.my>
Reply-To: FreeBSD-users-jp@jp.freebsd.org
Precedence: bulk
X-Distribute: distribute [version 2.1 (Alpha) patchlevel=19]
X-Sequence: FreeBSD-users-jp 9161
Subject: [FreeBSD-users-jp 9161] Re: [bde@zeta.org.au: Re: MAXMEM and userconfig]
Errors-To: owner-FreeBSD-users-jp@jp.freebsd.org
Sender: owner-FreeBSD-users-jp@jp.freebsd.org

Message-ID: <199701281744.CAA19538@frig.mt.cs.keio.ac.jp> $B$N5-;v$K$F(B
hosokawa@mt.cs.keio.ac.jp (HOSOKAWA Tatsumi) $B$5$s$O=q$+$l$^$7$?(B :

> >> $B%+!<%M%k:F9=C[$7$J$/$F$b$G$-$k$_$?$$$G$9$1$I!"$J$s$+<YF;$C$D$&$+(B...
> 
> $B$@$l$+!"$3$l$b$C$H$^$H$b$K$8$C$=$&$7$^$;$s$+!)(B

$B$^$H$b$8$c$J$$$1$I!"$A$g$C$H$$$8$C$F$_$^$7$?!#(B
$BF0$$$F$$$k$h$&$G$9(B :-)

> $BNc$($P!"(Bvisual $B$N$J$+$K(B Parameters $B$_$?$$$J9`L\$,$"$C$F$=$l$r3+$/$H@_(B
> $BDj$G$-$k$H$+!D!#(B

$B8@$o$l$k$^$^$K1n$N$h$&$K$7$^$7$?!#(B Flags $B$K(B hex $B$G(B MByte $BC10L$C$D$&$+!#(B
Parameters $B$N(B memory0 $B$H$$$&$d$D$G$9!#(B

> $B!t(B -tech-jp $B$K0\F0$+!)(B

Cc $B$7$H$-$^$9!#(B

-current $B$N(B /sys/i386/i386/userconfig.c $B$X$N%Q%C%A$G$9!#(B
# $B$[$H$s$I$o$+$i$J$$$^$^$$$$2C8:$K$d$C$D$1$?$N$G!"$"$HC/$+$h$m$7$/(B..._O_

--- userconfig.c.org	Wed Jan 29 02:44:52 1997
+++ userconfig.c	Wed Jan 29 03:47:22 1997
@@ -184,6 +184,7 @@
 #define CLS_MMEDIA	5		/* "multimedia" devices (sound, video, etc) */
 #define CLS_PCI		254		/* PCI devices */
 #define CLS_MISC	255		/* none of the above */
+#define CLS_PARAM	256		/* system parameters */
 
 
 typedef struct 
@@ -200,6 +201,7 @@
 {	"Multimedia :     ",	CLS_MMEDIA},
 {	"PCI :            ",	CLS_PCI},
 {	"Miscellaneous :  ",	CLS_MISC},
+{	"Parameters    :  ",	CLS_PARAM},
 {	"",0}};
 
 
@@ -298,6 +300,8 @@
 {"vga",		"Catchall PCI VGA driver",		FLG_INVISIBLE,	CLS_MISC},
 {"chip",	"PCI chipset support",			FLG_INVISIBLE,	CLS_MISC},
 {"piix",        "Intel 82371 Bus-master IDE controller", FLG_INVISIBLE, CLS_MISC},
+
+{"memory",      "System Memory Parameters",             FLG_IMMUTABLE, CLS_PARAM},
 {"","",0,0}};
 
 
@@ -342,6 +346,7 @@
 
 static void redraw(void);
 static void insdev(DEV_LIST *dev, DEV_LIST *list);
+static void setnpxiosize(DEV_LIST *list);	/* added by iwasaki */
 static int  devinfo(DEV_LIST *dev);
 static int  visuserconfig(void);
 
@@ -441,6 +446,24 @@
 	}
     }
 #endif	/* NPCI > 0 */
+
+/* Puseudo device for system memory */
+    strcpy(scratch.dev, "memory");
+    scratch.iobase = 0;
+    scratch.irq = -2;
+    scratch.drq = -2;
+    scratch.maddr = -2;
+    scratch.msize = -2;
+    scratch.flags = 0;
+    scratch.conflict_ok = 0;		/* shouldn't conflict */
+    scratch.comment = DEV_DEVICE;	/* is a device */
+    scratch.unit = 0;			/* arbitrary number of them */
+    scratch.conflicts = 0;
+    scratch.device = NULL;	
+    scratch.changed = 0;
+
+    if (!devinfo(&scratch))		/* look up name, set class and flags */
+      insdev(&scratch,active);		/* always active */
 }
 
 
@@ -665,7 +688,6 @@
     }
 }
 
-
 /**
  ** savelist
  **
@@ -681,6 +703,7 @@
 {
     struct isa_device	*id_p,*id_pn;
 
+    setnpxiosize(list);		/* added by iwasaki */
     while (list)
     {
 	if ((list->comment == DEV_DEVICE) &&		/* is a device */
@@ -3144,4 +3167,36 @@
 	return 0;
 }
 
+/**
+ ** setnpxiosize
+ ** 
+ ** Get the flags value of memory0 as max memory size in hex.
+ ** Then pass the value to parse_cmd with ios command for npx0.
+ ** Wed Jan 29 03:42:27 MYT 1997 iwasaki@pc.jaring.my
+ **/
+
+static void
+setnpxiosize(DEV_LIST *list)
+{
+    char command[20];	/* "ios npx0 65536 " */
+                        /*  123456789012345  */
+    Cmd *cmd;
+
+    /* search the pointer for memory0 */
+    while (list)
+    {
+	if ((list->comment == DEV_DEVICE) &&		/* is a device */
+	    (list->changed) &&				/* has been changed */
+	    (list->iobase != -2) &&			/* is not a PCI device */
+	    (!strncmp(list->dev, "memory", 6))) {	/* is a puseudo device for memory */
+		break;
+	}
+	list = list->next;
+    }
+    if (!list) return;
 
+    sprintf(command, "ios npx0 %d ", list->flags * 1024); /* flags in MB */
+    cmd = parse_cmd(command);
+    if (!cmd) return;
+    (*cmd->handler)(cmd->parms);
+}
--
                                    o
                              [=]   O
                             (.~.)_P
+=======================oooO==( )//Oooo======================+
|       --- Mitsuru IWASAKI ----                             |
|15A-1-3, Scots Tower, MONT' KIARA CONDOMINIUM, Jalan 1/70C, |
|Off Bikit Kiara, 50480 Kuala Lumpur, Malaysia               |
|TEL/FAX: +60-2538579                        _/_/_/    _/    |
|e-mail:  iwasaki@sirim.my(OFFICE)          _/  _/ _/ _/     |
| iwasaki@pc.jaring.my(HOME) iwasaki@jp.FreeBSD.ORG(FreeBSD) |
+============================================================+
