Allow MAXMEM to be larger than the detected physical memory. This change

was supposed to have already been made, but got botched somewhere.
Don't clobber the last page of memory (where the message buffer is). Some
BIOS don't gratuitously wipe it out on reboot.
This commit is contained in:
David Greenman 1994-11-16 00:41:06 +00:00
parent 7c85e00e1c
commit 288c2640aa
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=4517
2 changed files with 6 additions and 8 deletions

View file

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
* $Id: machdep.c,v 1.91 1994/11/14 14:23:54 bde Exp $
* $Id: machdep.c,v 1.92 1994/11/15 14:12:55 bde Exp $
*/
#include "npx.h"
@ -1307,8 +1307,7 @@ init386(first)
Maxmem = pagesinext + 0x100000/PAGE_SIZE;
#ifdef MAXMEM
if (MAXMEM/4 < Maxmem)
Maxmem = MAXMEM/4;
Maxmem = MAXMEM/4;
#endif
/*
* Calculate number of physical pages, but account for Maxmem
@ -1326,7 +1325,7 @@ init386(first)
*/
printf("Testing memory (%dMB)...", ptoa(Maxmem)/1024/1024);
for (target_page = Maxmem - 1; target_page >= atop(first); target_page--) {
for (target_page = Maxmem - 2; target_page >= atop(first); target_page--) {
/*
* map page into kernel: valid, read/write, non-cacheable

View file

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
* $Id: machdep.c,v 1.91 1994/11/14 14:23:54 bde Exp $
* $Id: machdep.c,v 1.92 1994/11/15 14:12:55 bde Exp $
*/
#include "npx.h"
@ -1307,8 +1307,7 @@ init386(first)
Maxmem = pagesinext + 0x100000/PAGE_SIZE;
#ifdef MAXMEM
if (MAXMEM/4 < Maxmem)
Maxmem = MAXMEM/4;
Maxmem = MAXMEM/4;
#endif
/*
* Calculate number of physical pages, but account for Maxmem
@ -1326,7 +1325,7 @@ init386(first)
*/
printf("Testing memory (%dMB)...", ptoa(Maxmem)/1024/1024);
for (target_page = Maxmem - 1; target_page >= atop(first); target_page--) {
for (target_page = Maxmem - 2; target_page >= atop(first); target_page--) {
/*
* map page into kernel: valid, read/write, non-cacheable