Jay Lan wrote:
> Christian Weiske wrote:
> Hi Christian,
>
> I attached a patch "test-module-kdb_enter.patch".
> Apply the patch and build it as a kernel module.
> Then do "insmod <path>/kdb_enter.ko" would drop you into kdb.
>
> To exit back to your running kernel, you need to "kill -15 <pid>"
> where <pid> is the pid of "insmod" on every cpu of your system.
> If you do a "kill ..." on one cpu, and do a "go", you will be
> dropped into kdb on a different cpu. You need to clear all
> of them to get back.
>
> Hope this help.
>
> Cheers,
> - jay
>
>
> -- Binary/unsupported file stripped by Ecartis --
> -- Type: text/x-patch
> -- File: test-module-kdb_enter.patch
Huh???
Here it is. Hopefully identation is reserved...
---
arch/x86/Makefile | 3 -
arch/x86/test-module/Makefile | 6 ++
arch/x86/test-module/kdb_enter.c | 26 +++++++++
Index: linux/arch/x86/test-module/kdb_enter.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux/arch/x86/test-module/kdb_enter.c 2008-06-06 11:50:46.257358330
-0700
@@ -0,0 +1,26 @@
+#include <linux/module.h>
+#include <linux/kdb.h>
+
+MODULE_LICENSE("GPL");
+
+static int __init
+kdb_enter_init(void)
+{
+ int cpu;
+ for_each_online_cpu(cpu) {
+ cpumask_t save_cpus_allowed = current->cpus_allowed;
+ cpumask_t new_cpus_allowed = cpumask_of_cpu(cpu);
+ set_cpus_allowed(current, new_cpus_allowed);
+ asm("\tint $129\n");
+ set_cpus_allowed(current, save_cpus_allowed);
+ }
+ return 0;
+}
+
+static void __exit
+kdb_enter_exit(void)
+{
+}
+
+module_init(kdb_enter_init)
+module_exit(kdb_enter_exit)
Index: linux/arch/x86/test-module/Makefile
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux/arch/x86/test-module/Makefile 2008-06-08 11:38:11.164687615 -0700
@@ -0,0 +1,1 @@
+obj-m += kdb_enter.o
Index: linux/arch/x86/Makefile
===================================================================
--- linux.orig/arch/x86/Makefile 2008-06-06 11:49:09.443551700 -0700
+++ linux/arch/x86/Makefile 2008-06-06 11:50:46.369355792 -0700
@@ -198,7 +198,8 @@ drivers-$(CONFIG_FB) += arch/x86/video/
endif
# KDB support
-drivers-$(CONFIG_KDB) += arch/x86/kdb/
+drivers-$(CONFIG_KDB) += arch/x86/kdb/ \
+ arch/x86/test-module/
####
# boot loader support. Several targets are kept for legacy purposes
>
>
> ---------------------------
> Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe.
---------------------------
Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe.