Sun Microsystems, Inc.  Sun System Handbook - ISO 3.4 June 2011 Internal/Partner Edition
   Home | Current Systems | Former STK Products | EOL Systems | Components | General Info | Search | Feedback

Asset ID: 1-71-1006936.1
Update Date:2009-12-22
Keywords:

Solution Type  Technical Instruction Sure

Solution  1006936.1 :   Basics of booting a SPARC(R) system with kmdb & kadb  


Related Items
  • Sun Fire E6900 Server
  •  
Related Categories
  • GCS>Sun Microsystems>Servers>Midrange Servers
  •  

PreviouslyPublishedAs
209606


Oracle Confidential (INTERNAL). Do not distribute to customers
Reason: Migrated distribution from Sun

Description
This doc describes the basic commands for booting a SPARC? system
in kadb(Solaris 9 & below) and kmdb (Solaris 10 & above)
It also shows a few ways to set breakpoints.

Steps to Follow
=====================================================
SOLARIS 9
setenv auto-boot false
{0} ok boot kadb -d
Probing system devices
Probing memory
Probing I/O buses
Sun Fire V240, No Keyboard
Copyright 1998-2004 Sun Microsystems, Inc.  All rights reserved.
OpenBoot 4.16.2, 8192 MB memory installed, Serial #60660897.
Ethernet address 0:3:ba:9d:9c:a1, Host ID: 839d9ca1.
Rebooting with command: boot kadb -d
Boot device: /pci@1c,600000/scsi@2/disk@0,0:a  File and args: kadb -d
Buffer for boot loader logging support: 0x13bea0, size 0x40000
kadb:  <********  Just hit return to load in the kernel
kadb: kernel/sparcv9/unix
Size: 383851+84981+153151 Bytes
/platform/sun4u/kernel/sparcv9/unix loaded - 0x102000 bytes used
stopped at      _start:         sethi     %hi(done1+0x124), %g1
kadb[1]: start_cpu:b
kadb[1]: start_other_cpus:b
kadb[1]: $b   <*********  Display breakpoints
breakpoints
count   bkpt            type      len   command
1       start_other_cpus                        :b instr            4
1       start_cpu       :b instr  4
1       _start          :b instr  4
kadb[1]:
kadb[1]:
kadb[1]:
kadb[1]:c  <********* To continue
SunOS Release 5.9 Version Generic_117171-17 64-bit
Copyright 1983-2003 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
WARNING: todm5819p_rmc: kernel debugger detected: hardware watchdog disabled
breakpoint at:
start_other_cpus:               save      %sp, -0xb0, %sp
kadb[1]:
So here we hit one of the breakpoints we set.
A ':s' will single step (one instruction at a time)
A ':c' will just continue on until we hit another breakpoint we have set.
A 'breakpoint:d' will remove a specific breakpoint
A ':z' will remove ALL the breakpoints
A '$b'  display all breakpoints that you have set
kadb[1]: :s
stopped at:
start_other_cpus+4:             sethi     %hi(panic_stack+0x3ce0), %i1
kadb[1]: :s
stopped at:
start_other_cpus+8:             ldx       [%i1 + 0x320], %g2
kadb[1]: :s
stopped at:
start_other_cpus+0xc:           cmp       %g2, 0x0
To return to OBP  type '$q'
NOTE: Once you return to OBP you cannot go back to your kadb session
so make sure you have captured all the information you need.
For more info see man kadb
=====================================================
SOLARIS 10
setenv auto-boot? false
{0} ok  boot kmdb -d
Probing system devices
Probing memory
Probing I/O buses
Sun Fire V240, No Keyboard
Copyright 1998-2004 Sun Microsystems, Inc.  All rights reserved.
OpenBoot 4.16.2, 8192 MB memory installed, Serial #60660897.
Ethernet address 0:3:ba:9d:9c:a1, Host ID: 839d9ca1.
Rebooting with command: boot kmdb -d
Boot device: /pci@1c,600000/scsi@2/disk@0,0:a  File and args: kmdb -d
Loading kmdb...
|
Welcome to kmdb
kmdb: unable to determine terminal type: assuming `vt100'
[1]> start_cpu:b
[1]> start_other_cpus:b
[1]>
[1]> $b
ID S TA HT LM Description               Action
------------- -------------------------------------
[ 1 ] +     0  0 stop at start_cpu                        -
[ 2 ] +     0  0 stop at start_other_cpus                 -
[1]> :c
SunOS Release 5.10 Version Generic 64-bit
Copyright 1983-2005 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
WARNING: todm5819p_rmc: kernel debugger detected: hardware watchdog disabled
Loaded modules: [ sd ufs unix krtld genunix ip specfs sctp ]
kmdb: stop at start_other_cpus
kmdb: target stopped at:
start_other_cpus:       save      %sp, -0xb0, %sp
So here we hit one of the breakpoints we set.
A ':s' will single step (one instruction at a time)
A ':c' will just continue on until we hit another breakpoint we have set.
A 'breakpoint:d' will remove a specific breakpoint
A ':z' will remove ALL the breakpoints
A '$b'  display all breakpoints that you have set
[1]> :s
kmdb: target stopped at:
start_other_cpus+4:     sethi     %hi(0x1836c00), %i4
[1]> :s
kmdb: target stopped at:
start_other_cpus+8:     add       %i4, 0x3b8, %i5
[1]> :s
To return to OBP  type '$q'
NOTE: Once you return to OBP you cannot go back to your kmdb session
so make sure you have captured all the information you need
For more info see man kmdb
Additional Solaris 10 features
=============================
Dynamically invoking kmdb
You can dynamically invoke booting kmdb without going to the trouble
of rebooting.
On the console  type 'mdb -K'  NOTE 'K' is in Capitals
v4u-v240h console login: root
Password:
Last login: Wed Oct 11 16:24:06 on console
Oct 12 09:55:43 v4u-v240h login: ROOT LOGIN /dev/console
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
#
# mdb -K
Oct 12 09:58:14 v4u-v240h kmdbmod: WARNING: hardware watchdog disabled while debugger is activated
Welcome to kmdb
Loaded modules: [ cpc sd ufs unix krtld sppp ipc nca genunix ip usba specfs nfs
random sctp ]
[0]>
[0]> :c
#
#
Here I sent a break (Stop-A equivalent)
kmdb: target stopped at:
kmdbmod`kaif_enter:     ta        %icc, %g0 + 0x7d
[1]>
[1]>
[1]>
[1]>
[1]> $c
kmdbmod`kaif_enter(0, 0, 106b000, 1, 180fc00, 0)
rmclomv`rmclomv_break_intr+0x28(0, 80d, 1, 0, 18e2400, 1)
intr_thread+0x144(0, b, 0, 0, 2a10001fcc0, ffffffffffffffff)
disp_getwork+0x128(180c000, 1841030, 1b, 1, ffffffffffffffff, 0)
idle+0xdc(2, 1, 1, 180c000, ffffffffffffffff, 1812000)
thread_start+4(0, 0, 0, 0, 0, 0)
[1]>
[1]> :c
Oct 12 09:59:16 v4u-v240h rmclomv: Failed to send email alert for recent event.
#
#
#
===================================
Setting/deleting a deffered breakpoint via:
::bp <modulename>`<function name>
::delete # (Where # is the number of the deffered breakpoint to delete)
Sometimes we need to set a breakpoint in a module even before the module loads.
This is might true if you need to debug a problem very early
in the boot process.
For example:
We want to set a breakpoint in the ufs module, but the ufs module is not
loaded until a little later in the boot process.
If we try to set a breakpoint via ufs_scan_inodes:b
we will get an error:
[1]>  ufs_scan_inodes:b
kmdb: failed to dereference symbol: unknown symbol name
We get this error because the ufs module is not yet loaded.
What we need to do is set a defered breakpoint like this:
[1]> ::bp ufs`ufs_scan_inodes
For example:
{1} ok boot kmdb -d
Probing system
Probing memory
Probing I/O buses
Sun Fire V240, No Keyboard
Copyright 1998-2004 Sun Microsystems, Inc.  All rights reserved.
OpenBoot 4.16.2, 8192 MB memory installed, Serial #60660897.
Ethernet address 0:3:ba:9d:9c:a1, Host ID: 839d9ca1.
Rebooting with command: boot kmdb -d
Boot device: /pci@1c,600000/scsi@2/disk@0,0:a  File and args: kmdb -d
Loading kmdb...
|
Welcome to kmdb
kmdb: unable to determine terminal type: assuming `vt100'
[1]> ::bp ufs`ufs_scan_inodes
[1]> :c
SunOS Release 5.10 Version Generic 64-bit
Copyright 1983-2005 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
Loaded modules: [ ufs unix krtld genunix specfs ]
WARNING: todm5819p_rmc: kernel debugger detected: hardware watchdog disabled
NIS+ domain name is us.cte.sun.com
Hostname: v4u-v240h
v4u-v240h console login:
v4u-v240h console login:
v4u-v240h console login:
v4u-v240h console login:
v4u-v240h console login:
v4u-v240h console login:
v4u-v240h console login: Oct 12 15:08:37 inetd[203]: authdes_refresh: unable to
synchronize clock
Oct 12 15:08:37 inetd[203]: authdes_refresh: keyserv(1m) is unable to encrypt session key
Oct 12 15:08:37 inetd[203]: authdes_refresh: keyserv(1m) is unable to encrypt session key
Loaded modules: [ crypto cpc sd ptm s1394 sppp ipc nca ip logindmux usba md nfs
random sctp ]
kmdb: stop at ufs`ufs_scan_inodes
kmdb: target stopped at:
ufs`ufs_scan_inodes:    save      %sp, -0xe0, %sp
[0]> :c
NOTE:  After 30 seconds or so we hit the breakpoint and then issue
a ':c'   to continue
v4u-v240h console login:
v4u-v240h console login:
To delete a defered breakpoint:
[1]> $b
ID S TA HT LM Description                              Action
----- - -- -- -- ---------------------------------------- ----------------------
[ 2 ] +     1  0 stop at start_cpu                        -
[ 3 ] +     1  0 stop at start_other_cpus                 -
[ 4 ] +     0  0 stop at ufs`ufs_scan_inodes              -
[1]>
[1]> ::delete 4
[1]>
[1]> $b
ID S TA HT LM Description                              Action
----- - -- -- -- ---------------------------------------- ----------------------
[ 2 ] +     1  0 stop at start_cpu                        -
[ 3 ] +     1  0 stop at start_other_cpus                 -
[1]>
Quick ref / Summary
=========================
boot kadb -d
boot kmdb -d
boot kadb -d -D kernel/sparcv9/unix (specify a different kernel to boot)
boot kmdb -d -D kernel/sparcv9/unix (specify a different kernel to boot)
:c to continue
:s to single step 1 instruction at a time
$q to exit
start_cpu:b  (Setting a regular breakpoint)
::bp ufs`ufs_scan_inodes  (Setting a defered breakpoint)
$b  display all breakpoints that you have set
breakpoint:d will remove a specific breakpoint
:z will remove ALL the breakpoints
::delete #  (Where # is the number of the deffered breakpoint to delete)


Product
Sun Fire E6900 Server

Internal Comments
This document is a Normalized Resolution Path and is managed by the MidRange Server Group's Domain Engineer.

* Please send any feedback on this resolution path to [email protected]. Include the document ID in the subject line.

* Do not update this document without first contacting the feedback email alias.

boot, booting, kadb, kmdb, breakpoint, adb, mdb, normalized
Previously Published As
87189
Product_uuid
4fe39727-0599-11d8-84cb-080020a9ed93|Sun Fire E6900 Server

Change History
Date: 2007-03-12
User Name: 7058
Action: Approved
Comment: Keywords and disclaimer only.
OK to republish.
Version: 7
Date: 2007-03-12
User Name: 67850
Action: Approved
Comment: Updated as part of 1280 Normalization effort. Added Normalized to keywords and Internal Only disclaimer.
Version: 0

Attachments
This solution has no attachment
  Copyright © 2011 Sun Microsystems, Inc.  All rights reserved.
 Feedback