From 045b6fefd86fb0589b7927cef51cc569d5947035 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Thu, 12 Feb 1998 22:00:01 +0000 Subject: [PATCH] Fixed initialization of the 4MB page. Kernels larger than about 2.75MB (from _btext to _end) crashed in pmap_bootstrap(). Smaller kernels worked accidentally. --- sys/amd64/amd64/pmap.c | 4 ++-- sys/i386/i386/pmap.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 7d911e2d1f2..7efe94da8d1 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 - * $Id: pmap.c,v 1.184 1998/02/09 06:08:16 eivind Exp $ + * $Id: pmap.c,v 1.185 1998/02/10 17:30:26 eivind Exp $ */ /* @@ -384,7 +384,7 @@ pmap_bootstrap(firstaddr, loadaddr) * Note that we have enabled PSE mode */ pseflag = PG_PS; - ptditmp = (unsigned) kernel_pmap->pm_pdir[KPTDI]; + ptditmp = *((unsigned *)PTmap + i386_btop(KERNBASE)); ptditmp &= ~(NBPDR - 1); ptditmp |= PG_V | PG_RW | PG_PS | PG_U | pgeflag; pdir4mb = ptditmp; diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 7d911e2d1f2..7efe94da8d1 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 - * $Id: pmap.c,v 1.184 1998/02/09 06:08:16 eivind Exp $ + * $Id: pmap.c,v 1.185 1998/02/10 17:30:26 eivind Exp $ */ /* @@ -384,7 +384,7 @@ pmap_bootstrap(firstaddr, loadaddr) * Note that we have enabled PSE mode */ pseflag = PG_PS; - ptditmp = (unsigned) kernel_pmap->pm_pdir[KPTDI]; + ptditmp = *((unsigned *)PTmap + i386_btop(KERNBASE)); ptditmp &= ~(NBPDR - 1); ptditmp |= PG_V | PG_RW | PG_PS | PG_U | pgeflag; pdir4mb = ptditmp;