Module Name:    src
Committed By:   rin
Date:           Fri Feb 26 10:54:13 UTC 2021

Modified Files:
        src/sys/arch/mac68k/conf: GENERIC files.mac68k
        src/sys/arch/mac68k/mac68k: machdep.c

Log Message:
Add MAC68K_MEMSIZE option to hard-code memory size in MB, instead of
that given by Booter. Work around Booter bug by which max memory is
restricted to 255MB.


To generate a diff of this commit:
cvs rdiff -u -r1.233 -r1.234 src/sys/arch/mac68k/conf/GENERIC
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/mac68k/conf/files.mac68k
cvs rdiff -u -r1.359 -r1.360 src/sys/arch/mac68k/mac68k/machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mac68k/conf/GENERIC
diff -u src/sys/arch/mac68k/conf/GENERIC:1.233 src/sys/arch/mac68k/conf/GENERIC:1.234
--- src/sys/arch/mac68k/conf/GENERIC:1.233	Thu Jan 21 06:51:55 2021
+++ src/sys/arch/mac68k/conf/GENERIC	Fri Feb 26 10:54:12 2021
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.233 2021/01/21 06:51:55 nia Exp $
+# $NetBSD: GENERIC,v 1.234 2021/02/26 10:54:12 rin Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include 	"arch/mac68k/conf/std.mac68k"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.233 $"
+#ident 		"GENERIC-$Revision: 1.234 $"
 
 makeoptions	COPTS="-O2 -fno-reorder-blocks -fno-omit-frame-pointer"
 	# See share/mk/sys.mk. -fno-omit-frame-pointer is necessary for
@@ -43,6 +43,10 @@ options 	FPU_EMULATE
 # You need to set the total memory in the MacOS Booter.
 #options 	DJMEMCMAX
 
+# Use hard-coded memory size in MB, instead of parameter given by Booter.
+# Workaround for Booter bug by which max memory is restricted to 255MB.
+#options 	MAC68K_MEMSIZE=256
+
 # Standard system options
 
 options 	INSECURE	# disable kernel security levels

Index: src/sys/arch/mac68k/conf/files.mac68k
diff -u src/sys/arch/mac68k/conf/files.mac68k:1.130 src/sys/arch/mac68k/conf/files.mac68k:1.131
--- src/sys/arch/mac68k/conf/files.mac68k:1.130	Thu Aug 22 14:52:58 2019
+++ src/sys/arch/mac68k/conf/files.mac68k	Fri Feb 26 10:54:12 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: files.mac68k,v 1.130 2019/08/22 14:52:58 rin Exp $
+#	$NetBSD: files.mac68k,v 1.131 2021/02/26 10:54:12 rin Exp $
 
 # mac68k-specific configuration info
 
@@ -10,6 +10,8 @@ defflag	opt_grf_compat.h	GRF_COMPAT
 
 defflag	opt_wsdisplay_compat.h	WSDISPLAY_COMPAT_ITEFONT
 
+defparam opt_mac68k.h		MAC68K_MEMSIZE
+
 # maxpartitions must be first item in files.${ARCH}.newconf
 maxpartitions 8
 

Index: src/sys/arch/mac68k/mac68k/machdep.c
diff -u src/sys/arch/mac68k/mac68k/machdep.c:1.359 src/sys/arch/mac68k/mac68k/machdep.c:1.360
--- src/sys/arch/mac68k/mac68k/machdep.c:1.359	Fri Feb 26 10:47:24 2021
+++ src/sys/arch/mac68k/mac68k/machdep.c	Fri Feb 26 10:54:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.359 2021/02/26 10:47:24 rin Exp $	*/
+/*	$NetBSD: machdep.c,v 1.360 2021/02/26 10:54:12 rin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -74,7 +74,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.359 2021/02/26 10:47:24 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.360 2021/02/26 10:54:12 rin Exp $");
 
 #include "opt_adb.h"
 #include "opt_compat_netbsd.h"
@@ -82,6 +82,7 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 #include "opt_ddb.h"
 #include "opt_ddbparam.h"
 #include "opt_kgdb.h"
+#include "opt_mac68k.h"
 #include "opt_modular.h"
 
 #include "akbd.h"
@@ -903,7 +904,11 @@ getenvvars(u_long flag, char *buf)
 	 */
 	mac68k_machine.machineid = machineid = getenv("MACHINEID");
 	mac68k_machine.mach_processor = getenv("PROCESSOR");
+#ifndef MAC68K_MEMSIZE
 	mac68k_machine.mach_memsize = getenv("MEMSIZE");
+#else
+	mac68k_machine.mach_memsize = MAC68K_MEMSIZE;
+#endif
 	mac68k_machine.do_graybars = getenv("GRAYBARS");
 	mac68k_machine.serial_boot_echo = getenv("SERIALECHO");
 	mac68k_machine.serial_console = getenv("SERIALCONSOLE");

Reply via email to