Subject: illegal instruction trap booting -current kernel
To: None <port-mac68k@netbsd.org>
From: Christian Groessler <cpg@aladdin.de>
List: port-mac68k
Date: 03/04/2003 23:54:28
Hi,

when I try to boot a -current kernel, I get early in the boot process
a kernel panic: (this is typed from the screen)

Kernel Illegal instruction Trap
trap type 2, code = 0x0, v = 0x0
kernel program counter = 0x37ac

Using the program counter as a hint I disassembled the kernel
executable and the problem seems to be in the m68k_make_fpu_idle_frame
function.

0x37ac seems to be the "fnop" after the "fmovecrx #15,%fp0" in
sys/arch/m68k/m68k/switch_subr.s. (maybe the fmovecrx is the problem?)

With the following change the kernel boots.

Index: switch_subr.s
===================================================================
RCS file: /net/swamp/zeug/netbsd-rsync/main/src/sys/arch/m68k/m68k/switch_subr.s,v
retrieving revision 1.2
diff -u -r1.2 switch_subr.s
--- switch_subr.s       17 Jan 2003 23:18:28 -0000      1.2
+++ switch_subr.s       4 Mar 2003 22:10:59 -0000
@@ -513,6 +513,7 @@
  * Before calling, make sure the machine actually has an FPU ...
  */
 ENTRY(m68k_make_fpu_idle_frame)
+       rts
        clrl    %sp@-
        fnop
 

regards,
chris