diff --git a/sys/arch/algor/algor/machdep.c b/sys/arch/algor/algor/machdep.c index baf51d0a80ae..e6daae3ffd1f 100644 --- a/sys/arch/algor/algor/machdep.c +++ b/sys/arch/algor/algor/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.8 2001/06/14 15:29:23 thorpej Exp $ */ +/* $NetBSD: machdep.c,v 1.9 2001/06/14 16:14:37 thorpej Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -85,6 +85,9 @@ #include "opt_ddb.h" #include "opt_kgdb.h" +#include "opt_memsize.h" +#include "opt_ethaddr.h" + #include #include #include @@ -322,7 +325,12 @@ mach_init(int argc, char *argv[], char *envp[]) /* * Get the Ethernet address of the on-board Ethernet. */ - if ((cp = pmon_getenv("ethaddr")) != NULL) { +#if defined(ETHADDR) + cp = ETHADDR; +#else + cp = pmon_getenv("ethaddr"); +#endif + if (cp != NULL) { for (i = 0; i < ETHER_ADDR_LEN; i++) { algor_ethaddr[i] = strtoul(cp, &cp0, 16); cp = cp0 + 1; @@ -385,17 +393,23 @@ mach_init(int argc, char *argv[], char *envp[]) * Note: Reserve the first page! That's where the trap * vectors are located. */ - mem_clusters[mem_cluster_cnt].start = NBPG; - if ((cp = pmon_getenv("memsize")) != NULL) { +#if defined(MEMSIZE) + size = MEMSIZE * 1024 * 1024; +#else + if ((cp = pmon_getenv("memsize")) != NULL) size = strtoul(cp, NULL, 10) * 1024 * 1024; - mem_clusters[mem_cluster_cnt].size = - size - mem_clusters[mem_cluster_cnt].start; - mem_cluster_cnt++; - } else { + else { printf("FATAL: `memsize' PMON variable not set. Set it to\n"); printf(" the amount of memory (in MB) and try again.\n"); + printf(" Or, build a kernel with the `MEMSIZE' " + "option.\n"); panic("algor_init"); } +#endif /* MEMSIZE */ + mem_clusters[mem_cluster_cnt].start = NBPG; + mem_clusters[mem_cluster_cnt].size = + size - mem_clusters[mem_cluster_cnt].start; + mem_cluster_cnt++; /* * Copy the exception-dispatch code down to the exception vector. diff --git a/sys/arch/algor/conf/files.algor b/sys/arch/algor/conf/files.algor index c4cd4e7eb6b6..6d8827012a37 100644 --- a/sys/arch/algor/conf/files.algor +++ b/sys/arch/algor/conf/files.algor @@ -1,4 +1,4 @@ -# $NetBSD: files.algor,v 1.3 2001/06/10 08:45:09 thorpej Exp $ +# $NetBSD: files.algor,v 1.4 2001/06/14 16:14:37 thorpej Exp $ # Algorithmics evaluation board specific configuration info. @@ -12,6 +12,10 @@ defopt ALGOR_P4032 # Algorithmics P-4032 defopt ALGOR_P5064 # Algorithmics P-5064 defopt ALGOR_P6032 # Algorithmics P-6032 +# Various items that a buggy PMON might not provide us. +defopt MEMSIZE +defopt ETHADDR + # Platform support files file arch/algor/algor/algor_p4032_bus_io.c algor_p4032 file arch/algor/algor/algor_p4032_bus_locio.c algor_p4032