Hi all,
I've been looking at how to enable kmdb support for Solaris OpenBIOS SPARC64 and it seems that OpenBIOS needs some additional routines in order for the kernel to load the debugger.
AIUI the kernel makes use of 2 traps for kmdb, for which some searching on the internet gives the following:
0x17d : kadb enter 0x17e : kadb breakpoint
Indeed if I start Milax with "boot cdrom:a -kdv" then current SVN trunk will halt because the 0x17d trap currently jumps straight to the bug() routine. Sadly what OpenBIOS should do is a little more hazy, especially as I don't think the relevant sun4u parts are in Sun's open-sourced OpenBOOT.
Currently booting Milax will emit the following error on the console during boot:
interpret : kmdb_callback %pc f000.0000 ffff.ffff between if exit then %pc h# 18e9058 x! %npc h# 18e9060 x! %g1 h# 18e8f58 x! %g2 h# 18e8f60 x! %g3 h# 18e8f68 x! %g4 h# 18e8f70 x! %g5 h# 18e8f78 x! %g6 h# 18e8f80 x! %g7 h# 18e8f88 x! 1 %tstate h# 18e9220 x! 1 %tt h# 18e90e8 x! %tba h# 18e90a8 x! h# 12f6098 set-pc go ; failed with error ffffffffffffffed kmdb_callback:interpret: exception -13 caught interpret ['] kmdb_callback init-debugger-hook failed with error ffffffffffffffed
Based upon this, my best guess would be that both traps above execute the init-debugger-hook word which simply copies the current register sets above on PROM entry somewhere accessible to kmdb, then points the PC to the debugger entry point and resumes execution causing a jump straight into kmdb. Does this sound about right?
ATB,
Mark.