Re: Signal 7 and "Couldn't get a free page..."

Ingo Molnar (mingo@pc5829.hil.siemens.at)
Mon, 28 Apr 1997 18:39:32 +0200 (MET DST)


ok, here are the remaining two exceptions, to see a "hardware problem"
message explicitly :)

dont use it in a production system, unless you want to make users able to
flood your syslog. And it only compiles i havent tested it, 2.0.30 kernel.

-- mingo

--- linux/arch/i386/kernel/traps.c.original Mon Apr 28 19:28:15 1997
+++ linux/arch/i386/kernel/traps.c Mon Apr 28 20:35:09 1997
@@ -186,10 +186,32 @@
DO_ERROR( 8, SIGSEGV, "double fault", double_fault, current)
DO_ERROR( 9, SIGFPE, "coprocessor segment overrun", coprocessor_segment_overrun, last_task_used_math)
DO_ERROR(10, SIGSEGV, "invalid TSS", invalid_TSS, current)
+
+#if 0
DO_ERROR(11, SIGBUS, "segment not present", segment_not_present, current)
DO_ERROR(12, SIGBUS, "stack segment", stack_segment, current)
+#endif
+
DO_ERROR(17, SIGSEGV, "alignment check", alignment_check, current)
DO_ERROR(18, SIGSEGV, "reserved", reserved, current)
+
+asmlinkage void do_stack_segment(struct pt_regs * regs, long error_code)
+{
+ current->tss.error_code = error_code;
+ current->tss.trap_no = 11;
+ force_sig(SIGBUS, current);
+ printk(KERN_CRIT "stack segment exception, either you do weird stuff or hardware problem.\n");
+ die_if_kernel("stack segment",regs,error_code);
+}
+
+asmlinkage void do_segment_not_present(struct pt_regs * regs, long error_code)
+{
+ current->tss.error_code = error_code;
+ current->tss.trap_no = 12;
+ force_sig(SIGBUS, current);
+ printk(KERN_CRIT "segment not present exception, either you do weird stuff or hardware problem.\n");
+ die_if_kernel("segment not present",regs,error_code);
+}

asmlinkage void do_general_protection(struct pt_regs * regs, long error_code)
{