From Tor.Egge@idt.ntnu.no  Thu Oct 24 11:29:38 1996
Received: from pat.idt.unit.no (pat.idt.unit.no [129.241.103.5])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id LAA12457
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 24 Oct 1996 11:29:37 -0700 (PDT)
Received: from ikke.idt.unit.no (ikke.idt.unit.no [129.241.111.65]) by pat.idt.unit.no (8.7.5/8.7.3) with ESMTP id UAA07236 for <FreeBSD-gnats-submit@freebsd.org>; Thu, 24 Oct 1996 20:29:32 +0200 (MET DST)
Received: (from tegge@localhost) by ikke.idt.unit.no (8.7.6/8.7.3) id UAA09542; Thu, 24 Oct 1996 20:29:31 +0200 (MET DST)
Message-Id: <199610241829.UAA09542@ikke.idt.unit.no>
Date: Thu, 24 Oct 1996 20:29:31 +0200 (MET DST)
From: Tor Egge <Tor.Egge@idt.ntnu.no>
Reply-To: Tor.Egge@idt.ntnu.no
To: FreeBSD-gnats-submit@freebsd.org
Subject: kernel crash during boot when using 512 MB memory
X-Send-Pr-Version: 3.2

>Number:         1880
>Category:       kern
>Synopsis:       kernel crash during boot when using 512 MB memory
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 24 11:30:01 PDT 1996
>Closed-Date:    Sun Apr 26 03:12:40 PDT 1998
>Last-Modified:  Sun Apr 26 03:12:55 PDT 1998
>Originator:     Tor Egge
>Release:        FreeBSD 2.2-CURRENT i386
>Organization:
Norwegian University of Science and Technology, Trondheim, Norway

>Environment:

FreeBSD ikke.idt.unit.no 2.2-CURRENT FreeBSD 2.2-CURRENT #1: Thu Oct 24 02:55:40 MET DST 1996     root@ikke.idt.unit.no:/usr/src/sys-UP/compile/TEGGE  i386

>Description:

Using

	option	"MAXMEM=(512*1024)"

did not result in a running kernel utilizing all available memory.
It resulted in a very quick crash during boot:

	kmem_suballloc: bad status return of 3
	panic: kmem_suballoc

>How-To-Repeat:

	Install 512 MB in a PC, and configure the kernel to use it.

>Fix:
	One alternative is to increase the kernel virtual memory area
	from 252 MB to 508 MB. A patch for this is appended here.
	libkvm, ps and gdb must be recompiled.

Index: sys/i386/conf/Makefile.i386
===================================================================
RCS file: /export/akg1/cvs/src/sys/i386/conf/Makefile.i386,v
retrieving revision 1.89
diff -c -r1.89 Makefile.i386
*** Makefile.i386	1996/10/08 22:08:44	1.89
--- Makefile.i386	1996/10/23 14:01:24
***************
*** 36,42 ****
  .endif
  COPTS=	${INCLUDES} ${IDENT} -DKERNEL
  CFLAGS=	${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS}
! LOAD_ADDRESS?=	F0100000
  
  NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $<
  NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
--- 36,42 ----
  .endif
  COPTS=	${INCLUDES} ${IDENT} -DKERNEL
  CFLAGS=	${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS}
! LOAD_ADDRESS?=	E0100000
  
  NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $<
  NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
Index: sys/i386/include/pmap.h
===================================================================
RCS file: /export/akg1/cvs/src/sys/i386/include/pmap.h,v
retrieving revision 1.46
diff -c -r1.46 pmap.h
*** pmap.h	1996/10/13 03:14:57	1.46
--- pmap.h	1996/10/23 03:23:56
***************
*** 91,97 ****
  #define	NKPT			9	/* actual number of kernel page tables */
  #endif
  #ifndef NKPDE
! #define NKPDE			63	/* addressable number of page tables/pde's */
  #endif
  
  /*
--- 91,97 ----
  #define	NKPT			9	/* actual number of kernel page tables */
  #endif
  #ifndef NKPDE
! #define NKPDE			127	/* addressable number of page tables/pde's */
  #endif
  
  /*
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Sun Apr 26 03:12:40 PDT 1998 
State-Changed-Why:  
fixed in current 
>Unformatted:
