From 98020fdd6c33f0bf7431900ef875f7c5dcc947db Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Mon, 7 Nov 1994 03:51:32 +0000 Subject: [PATCH] Added a kernel variable, "dodump" defaulting to zero, which disables dumps. Somebody should make a mib variable for it. Just now it is pointless to dump the kernel, since we have nothing which can read the dump. Furthermore is should never be the default to dump. options DODUMP will enable dumps. --- sys/amd64/amd64/machdep.c | 10 +++++++++- sys/conf/NOTES | 3 ++- sys/i386/conf/LINT | 3 ++- sys/i386/conf/NOTES | 3 ++- sys/i386/i386/machdep.c | 10 +++++++++- 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 3dfaaecdf591..c6a2c47b9d53 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.86 1994/11/06 01:33:03 bde Exp $ + * $Id: machdep.c,v 1.87 1994/11/06 04:46:53 davidg Exp $ */ #include "npx.h" @@ -801,6 +801,12 @@ die: unsigned long dumpmag = 0x8fca0101UL; /* magic number for savecore */ int dumpsize = 0; /* also for savecore */ + +#ifdef DODUMP +int dodump = 1; +#else +int dodump = 0; +#endif /* * Doadump comes here after turning off memory management and * getting on the dump stack, either when called above, or by @@ -810,6 +816,8 @@ void dumpsys() { + if (!dodump) + return; if (dumpdev == NODEV) return; if ((minor(dumpdev)&07) != 1) diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 13e3574f2856..19fc58c6b7f6 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -4,7 +4,7 @@ # # This kernel is NOT MEANT to be runnable! # -# $Id: LINT,v 1.104 1994/11/02 01:11:03 wollman Exp $ +# $Id: LINT,v 1.105 1994/11/03 15:51:37 jkh Exp $ # # @@ -86,6 +86,7 @@ options SYSVMSG # is stored in the initialized data area of the kernel. If you change # the latter option, remove db_aout.o before compiling. # +options DODUMP #We dump core-image on panic options DDB #Kernel debugger options "SYMTAB_SPACE=113498" #This kernel needs LOTS of symtable diff --git a/sys/i386/conf/LINT b/sys/i386/conf/LINT index 13e3574f2856..19fc58c6b7f6 100644 --- a/sys/i386/conf/LINT +++ b/sys/i386/conf/LINT @@ -4,7 +4,7 @@ # # This kernel is NOT MEANT to be runnable! # -# $Id: LINT,v 1.104 1994/11/02 01:11:03 wollman Exp $ +# $Id: LINT,v 1.105 1994/11/03 15:51:37 jkh Exp $ # # @@ -86,6 +86,7 @@ options SYSVMSG # is stored in the initialized data area of the kernel. If you change # the latter option, remove db_aout.o before compiling. # +options DODUMP #We dump core-image on panic options DDB #Kernel debugger options "SYMTAB_SPACE=113498" #This kernel needs LOTS of symtable diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES index 13e3574f2856..19fc58c6b7f6 100644 --- a/sys/i386/conf/NOTES +++ b/sys/i386/conf/NOTES @@ -4,7 +4,7 @@ # # This kernel is NOT MEANT to be runnable! # -# $Id: LINT,v 1.104 1994/11/02 01:11:03 wollman Exp $ +# $Id: LINT,v 1.105 1994/11/03 15:51:37 jkh Exp $ # # @@ -86,6 +86,7 @@ options SYSVMSG # is stored in the initialized data area of the kernel. If you change # the latter option, remove db_aout.o before compiling. # +options DODUMP #We dump core-image on panic options DDB #Kernel debugger options "SYMTAB_SPACE=113498" #This kernel needs LOTS of symtable diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 3dfaaecdf591..c6a2c47b9d53 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.86 1994/11/06 01:33:03 bde Exp $ + * $Id: machdep.c,v 1.87 1994/11/06 04:46:53 davidg Exp $ */ #include "npx.h" @@ -801,6 +801,12 @@ die: unsigned long dumpmag = 0x8fca0101UL; /* magic number for savecore */ int dumpsize = 0; /* also for savecore */ + +#ifdef DODUMP +int dodump = 1; +#else +int dodump = 0; +#endif /* * Doadump comes here after turning off memory management and * getting on the dump stack, either when called above, or by @@ -810,6 +816,8 @@ void dumpsys() { + if (!dodump) + return; if (dumpdev == NODEV) return; if ((minor(dumpdev)&07) != 1)