DragonFly kernel List (threaded) for 2007-07
DragonFly BSD
DragonFly kernel List (threaded) for 2007-07
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

add error message for vkernel started with vm.vkernel_enable=0


From: Joe Talbott <josepht@xxxxxxxxxx>
Date: Tue, 17 Jul 2007 22:17:25 -0400
Mail-followup-to: "kernel@crater.dragonflybsd.org" <kernel@crater.dragonflybsd.org>

I'd like to add something like the attached patch to the vkernel to
let the user know that vm.vkernel_enable = 0.  I spent quite a while
today chasing down why mmap() was failing before remembering that I
needed to turn vm.vkernel_enable on.

Joe
Index: sys/platform/vkernel/platform/init.c
===================================================================
RCS file: /home/dcvs/src/sys/platform/vkernel/platform/init.c,v
retrieving revision 1.44
diff -u -r1.44 init.c
--- sys/platform/vkernel/platform/init.c	10 Jul 2007 18:35:38 -0000	1.44
+++ sys/platform/vkernel/platform/init.c	18 Jul 2007 01:03:42 -0000
@@ -141,6 +141,8 @@
 	int c;
 	int i;
 	int n;
+	int real_vkernel_enable;
+	size_t real_vkernel_enable_size;
 	
 	save_ac = ac;
 	save_av = av;
@@ -154,6 +156,12 @@
 #endif
 	lwp_cpu_lock = LCL_NONE;
 
+	real_vkernel_enable_size = sizeof(real_vkernel_enable);
+	sysctlbyname("vm.vkernel_enable", &real_vkernel_enable, &real_vkernel_enable_size, NULL, 0);
+	
+	if (real_vkernel_enable == 0)
+		errx(1,"vm.vkernel_enable is %d, must be set to 1 to execute a vkernel!", real_vkernel_enable);
+
 	real_ncpus_size = sizeof(real_ncpus);
 	sysctlbyname("hw.ncpu", &real_ncpus, &real_ncpus_size, NULL, 0);
 


[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]