linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* kgdb/Sandpoint -- patch & help needed
@ 2000-09-18 14:16 ` Alex Shnitman
  2000-09-19  3:39   ` Murray Jensen
  0 siblings, 1 reply; 6+ messages in thread
From: Alex Shnitman @ 2000-09-18 14:16 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 1665 bytes --]

Hi,

Could somebody help me get kgdb working on this platform? I'm totally
stuck with this problem of stuff crashing on my Sandpoint, and there's
no way I could do anything about it without a debugger.

Here are my humble attempts. Basically there's already support for
kgdb on the ppc, but not for Sandpoint specifically. getDebugChar and
putDebugChar are defined for the 8xx UART, but the Sandpoint uses the
standard 16650 UART. So I took the i386 kgdb patch and took out the
parts that I need from it -- gdbserial.c, some Makefile diffs, and
some changes in serial.c and main.c (left as is from the i386 patch, I
just changed #ifdef CONFIG_X86_REMOTE_DEBUG to CONFIG_KGDB). For the
rest of the stuff (traps, stub) I rely on the existing kgdb support
that's in the ppc tree already. However, with this patch the kernel
hangs right after saying "Now booting the kernel". I don't even see
how these changes could affect the boot process so early.

I'm attaching the patch. It's against Mark's latest 2.4.0-test2
snapshot (that's in Area51 on ftp.mvista.com). Could someone please
look at it and see what I did wrong and why it doesn't work?

Thanks a lot in advance!

(I'm also attaching the .config that I'm using, for what it's worth.)


--
Alex Shnitman                            | http://www.debian.org
alexsh@hectic.net, alexsh@linux.org.il   +-----------------------
http://alexsh.hectic.net    UIN 188956    PGP key on web page
       E1 F2 7B 6C A0 31 80 28  63 B8 02 BA 65 C7 8B BA

A bit of irony for you: Bill Gates claims to be trying to make a stable
operating system, while Linus Torvalds claims to be trying to take over
the world.
	-- Ernie Miller

[-- Attachment #2: kgdb-patch.gz --]
[-- Type: application/octet-stream, Size: 11070 bytes --]

[-- Attachment #3: config-kgdb --]
[-- Type: text/plain, Size: 7862 bytes --]

#
# Automatically generated by make menuconfig: don't edit
#
# CONFIG_UID16 is not set

#
# Code maturity level options
#
CONFIG_EXPERIMENTAL=y

#
# Platform support
#
CONFIG_PPC=y
CONFIG_6xx=y
# CONFIG_4xx is not set
# CONFIG_PPC64BRIDGE is not set
# CONFIG_8260 is not set
# CONFIG_8xx is not set
# CONFIG_ALL_PPC is not set
# CONFIG_GEMINI is not set
# CONFIG_EST8260 is not set
CONFIG_SANDPOINT=y
# CONFIG_APUS is not set
# CONFIG_SMP is not set
# CONFIG_RTSCHED is not set
CONFIG_ALTIVEC=y
CONFIG_MACH_SPECIFIC=y

#
# Loadable module support
#
# CONFIG_MODULES is not set

#
# General setup
#
# CONFIG_ISA is not set
# CONFIG_SBUS is not set
CONFIG_PCI=y
CONFIG_CHRP_MAPB=y
CONFIG_NET=y
CONFIG_SYSCTL=y
CONFIG_SYSVIPC=y
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_KCORE_ELF=y
CONFIG_BINFMT_ELF=y
CONFIG_KERNEL_ELF=y
# CONFIG_BINFMT_MISC is not set
CONFIG_PCI_NAMES=y
# CONFIG_HOTPLUG is not set
# CONFIG_PCMCIA is not set

#
# Parallel port support
#
# CONFIG_PARPORT is not set
# CONFIG_VGA_CONSOLE is not set
# CONFIG_FB is not set
# CONFIG_PMAC_PBOOK is not set
# CONFIG_MAC_FLOPPY is not set
# CONFIG_MAC_SERIAL is not set
# CONFIG_ADB is not set
# CONFIG_PROC_DEVICETREE is not set
# CONFIG_BOOTX_TEXT is not set
# CONFIG_MOTOROLA_HOTSWAP is not set

#
# Plug and Play configuration
#
# CONFIG_PNP is not set
# CONFIG_ISAPNP is not set

#
# Block devices
#
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_DEV_XD is not set
# CONFIG_PARIDE is not set
# CONFIG_BLK_CPQ_DA is not set
# CONFIG_BLK_DEV_DAC960 is not set
CONFIG_BLK_DEV_LOOP=y
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_LVM is not set
# CONFIG_BLK_DEV_MD is not set
# CONFIG_MD_LINEAR is not set
# CONFIG_MD_RAID0 is not set
# CONFIG_MD_RAID1 is not set
# CONFIG_MD_RAID5 is not set
# CONFIG_BLK_DEV_RAM is not set
# CONFIG_BLK_DEV_INITRD is not set
# CONFIG_BLK_DEV_FLASH is not set

#
# Networking options
#
CONFIG_PACKET=y
# CONFIG_PACKET_MMAP is not set
CONFIG_NETLINK=y
# CONFIG_RTNETLINK is not set
# CONFIG_NETLINK_DEV is not set
# CONFIG_NETFILTER is not set
# CONFIG_FILTER is not set
CONFIG_UNIX=y
CONFIG_INET=y
# CONFIG_IP_MULTICAST is not set
# CONFIG_IP_ADVANCED_ROUTER is not set
CONFIG_IP_PNP=y
CONFIG_IP_PNP_BOOTP=y
# CONFIG_IP_PNP_RARP is not set
# CONFIG_IP_ROUTER is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE is not set
# CONFIG_IP_ALIAS is not set
# CONFIG_SYN_COOKIES is not set
CONFIG_SKB_LARGE=y
# CONFIG_IPV6 is not set
# CONFIG_KHTTPD is not set
# CONFIG_ATM is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_DECNET is not set
# CONFIG_BRIDGE is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_LLC is not set
# CONFIG_ECONET is not set
# CONFIG_WAN_ROUTER is not set
# CONFIG_NET_FASTROUTE is not set
# CONFIG_NET_HW_FLOWCONTROL is not set

#
# QoS and/or fair queueing
#
# CONFIG_NET_SCHED is not set

#
# ATA/IDE/MFM/RLL support
#
# CONFIG_IDE is not set
# CONFIG_BLK_DEV_IDE_MODES is not set
# CONFIG_BLK_DEV_HD is not set

#
# SCSI support
#
# CONFIG_SCSI is not set

#
# IEEE 1394 (FireWire) support
#
# CONFIG_IEEE1394 is not set

#
# Network device support
#
CONFIG_NETDEVICES=y

#
# ARCnet devices
#
# CONFIG_ARCNET is not set
# CONFIG_DUMMY is not set
# CONFIG_BONDING is not set
# CONFIG_EQUALIZER is not set
# CONFIG_ETHERTAP is not set
# CONFIG_NET_SB1000 is not set

#
# Ethernet (10 or 100Mbit)
#
CONFIG_NET_ETHERNET=y
# CONFIG_MACE is not set
# CONFIG_BMAC is not set
# CONFIG_GMAC is not set
# CONFIG_NCR885E is not set
# CONFIG_OAKNET is not set
# CONFIG_NET_VENDOR_3COM is not set
# CONFIG_LANCE is not set
# CONFIG_NET_VENDOR_SMC is not set
# CONFIG_NET_VENDOR_RACAL is not set
# CONFIG_AT1700 is not set
# CONFIG_DEPCA is not set
# CONFIG_NET_ISA is not set
CONFIG_NET_PCI=y
# CONFIG_PCNET32 is not set
# CONFIG_ADAPTEC_STARFIRE is not set
# CONFIG_AC3200 is not set
# CONFIG_APRICOT is not set
# CONFIG_CS89x0 is not set
# CONFIG_DE4X5 is not set
# CONFIG_TULIP is not set
# CONFIG_DGRS is not set
# CONFIG_DM9102 is not set
CONFIG_EEPRO100=y
# CONFIG_EEPRO100_PM is not set
# CONFIG_LNE390 is not set
# CONFIG_NE3210 is not set
# CONFIG_NE2K_PCI is not set
# CONFIG_RTL8129 is not set
# CONFIG_8139TOO is not set
# CONFIG_SIS900 is not set
# CONFIG_TLAN is not set
# CONFIG_VIA_RHINE is not set
# CONFIG_ES3210 is not set
# CONFIG_EPIC100 is not set
# CONFIG_NET_POCKET is not set

#
# Ethernet (1000 Mbit)
#
# CONFIG_YELLOWFIN is not set
# CONFIG_ACENIC is not set
# CONFIG_SK98LIN is not set
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
# CONFIG_PPP is not set
# CONFIG_SLIP is not set

#
# Wireless LAN (non-hamradio)
#
# CONFIG_NET_RADIO is not set

#
# Token Ring devices
#
# CONFIG_TR is not set
# CONFIG_NET_FC is not set
# CONFIG_RCPCI is not set
# CONFIG_SHAPER is not set

#
# Wan interfaces
#
# CONFIG_WAN is not set

#
# Amateur Radio support
#
# CONFIG_HAMRADIO is not set

#
# IrDA (infrared) support
#
# CONFIG_IRDA is not set

#
# ISDN subsystem
#
# CONFIG_ISDN is not set

#
# Old CD-ROM drivers (not SCSI, not IDE)
#
# CONFIG_CD_NO_IDESCSI is not set

#
# Console drivers
#

#
# Frame-buffer support
#
# CONFIG_FB is not set

#
# Character devices
#
# CONFIG_VT is not set
CONFIG_SERIAL=y
CONFIG_SERIAL_CONSOLE=y
# CONFIG_SERIAL_EXTENDED is not set
# CONFIG_SERIAL_NONSTANDARD is not set
CONFIG_UNIX98_PTYS=y
CONFIG_UNIX98_PTY_COUNT=256

#
# I2C support
#
# CONFIG_I2C is not set

#
# Mice
#
# CONFIG_BUSMOUSE is not set
# CONFIG_MOUSE is not set

#
# Joysticks
#
# CONFIG_JOYSTICK is not set
# CONFIG_QIC02_TAPE is not set

#
# Watchdog Cards
#
# CONFIG_WATCHDOG is not set
# CONFIG_INTEL_RNG is not set
# CONFIG_NVRAM is not set
# CONFIG_RTC is not set

#
# Video For Linux
#
# CONFIG_VIDEO_DEV is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set

#
# Ftape, the floppy tape device driver
#
# CONFIG_FTAPE is not set
# CONFIG_DRM is not set
# CONFIG_DRM_TDFX is not set
# CONFIG_AGP is not set

#
# File systems
#
# CONFIG_QUOTA is not set
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
# CONFIG_ADFS_FS is not set
# CONFIG_ADFS_FS_RW is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_FAT_FS is not set
# CONFIG_MSDOS_FS is not set
# CONFIG_UMSDOS_FS is not set
# CONFIG_VFAT_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_CRAMFS is not set
# CONFIG_RAMFS is not set
# CONFIG_ISO9660_FS is not set
# CONFIG_JOLIET is not set
# CONFIG_MINIX_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
# CONFIG_DEVFS_MOUNT is not set
# CONFIG_DEVFS_DEBUG is not set
CONFIG_DEVPTS_FS=y
# CONFIG_QNX4FS_FS is not set
# CONFIG_QNX4FS_RW is not set
# CONFIG_ROMFS_FS is not set
# CONFIG_EXT2_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_SYSV_FS_WRITE is not set
# CONFIG_UDF_FS is not set
# CONFIG_UDF_RW is not set
# CONFIG_UFS_FS is not set
# CONFIG_UFS_FS_WRITE is not set

#
# Network File Systems
#
# CONFIG_CODA_FS is not set
CONFIG_NFS_FS=y
# CONFIG_NFS_V3 is not set
CONFIG_ROOT_NFS=y
# CONFIG_NFSD is not set
# CONFIG_NFSD_V3 is not set
CONFIG_SUNRPC=y
CONFIG_LOCKD=y
# CONFIG_SMB_FS is not set
# CONFIG_NCP_FS is not set
# CONFIG_NCPFS_PACKET_SIGNING is not set
# CONFIG_NCPFS_IOCTL_LOCKING is not set
# CONFIG_NCPFS_STRONG is not set
# CONFIG_NCPFS_NFS_NS is not set
# CONFIG_NCPFS_OS2_NS is not set
# CONFIG_NCPFS_SMALLDOS is not set
# CONFIG_NCPFS_MOUNT_SUBDIR is not set
# CONFIG_NCPFS_NDS_DOMAINS is not set
# CONFIG_NCPFS_NLS is not set
# CONFIG_NCPFS_EXTRAS is not set

#
# Partition Types
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y
# CONFIG_NLS is not set

#
# Sound
#
# CONFIG_SOUND is not set

#
# USB support
#
# CONFIG_USB is not set

#
# Kernel hacking
#
# CONFIG_MAGIC_SYSRQ is not set
CONFIG_KGDB=y
# CONFIG_XMON is not set

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: kgdb/Sandpoint -- patch & help needed
  2000-09-18 14:16 ` kgdb/Sandpoint -- patch & help needed Alex Shnitman
@ 2000-09-19  3:39   ` Murray Jensen
  2000-09-19 16:39     ` Alex Shnitman
  0 siblings, 1 reply; 6+ messages in thread
From: Murray Jensen @ 2000-09-19  3:39 UTC (permalink / raw)
  To: linuxppc-embedded


On Mon, 18 Sep 2000 17:16:27 +0300, Alex Shnitman <alexsh@hectic.net> writes:
>... However, with this patch the kernel
>hangs right after saying "Now booting the kernel". I don't even see
>how these changes could affect the boot process so early.

Aha! I was caught by this. When you enable CONFIG_KGDB, a breakpoint is
executed in setup_arch() which is just about the first thing the kernel
does.

The sequence is (very!) roughly (and for the 8xx embedded platform):

_start()
	identify_machine()
	MMU_init()
	start_kernel()
		lock_kernel()
		setup_arch()
			set_debug_traps()	| ifdef CONFIG_KGDB
			breakpoint()		|
			...
		parse_options()
		trap_init()
		init_IRQ()
		...

Solution? Simply start gdb on your host machine and do the following:

	set remotebaud BBBBBB	(if required)

	target remote /dev/...	(serial port on host connected to
				 target kgdb serial port)
	continue

and your kernel will fire up again (I kicked myself when I realised what
was going on). Cheers!
								Murray...


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: kgdb/Sandpoint -- patch & help needed
  2000-09-19  3:39   ` Murray Jensen
@ 2000-09-19 16:39     ` Alex Shnitman
  2000-09-19 17:00       ` Dan Malek
  2000-09-19 17:40       ` Mark A. Greer
  0 siblings, 2 replies; 6+ messages in thread
From: Alex Shnitman @ 2000-09-19 16:39 UTC (permalink / raw)
  To: linuxppc-embedded


Hi, Murray!

On Tue, Sep 19, 2000 at 02:39:17PM +1100, you wrote the following:

> >... However, with this patch the kernel
> >hangs right after saying "Now booting the kernel". I don't even see
> >how these changes could affect the boot process so early.
>
> Aha! I was caught by this. When you enable CONFIG_KGDB, a breakpoint is
> executed in setup_arch() which is just about the first thing the kernel
> does.

Right, but before calling setup_arch, it prints the linux kernel
banner! Here's the code:

        printk(linux_banner);
	setup_arch(&command_line, &memory_start, &memory_end);

And I don't see the banner. Did you see it when you encountered this?


--
Alex Shnitman                            | http://www.debian.org
alexsh@hectic.net, alexsh@linux.org.il   +-----------------------
http://alexsh.hectic.net    UIN 188956    PGP key on web page
       E1 F2 7B 6C A0 31 80 28  63 B8 02 BA 65 C7 8B BA

NTL have a new network routing protocol as invented for amusing
small children. Its called 'now you see it now you dont' with much
of the US vanishing at cardiff for 10 seconds every minute or so.
	-- Alan Cox on a diary update

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: kgdb/Sandpoint -- patch & help needed
  2000-09-19 16:39     ` Alex Shnitman
@ 2000-09-19 17:00       ` Dan Malek
  2000-09-20 12:34         ` Alex Shnitman
  2000-09-19 17:40       ` Mark A. Greer
  1 sibling, 1 reply; 6+ messages in thread
From: Dan Malek @ 2000-09-19 17:00 UTC (permalink / raw)
  To: Alex Shnitman; +Cc: linuxppc-embedded


Alex Shnitman wrote:

> Right, but before calling setup_arch, it prints the linux kernel
> banner! Here's the code:

The kernel "prints" lots of stuff, and it all goes into a buffer,
to emerge quite late in the boot process when the (serial)
console port is initialized for real use by applications.


> And I don't see the banner. Did you see it when you encountered this?

You should see a 20 character (or so) ASCII string of coded information
appear on the serial port used for GDB.  The system stops at this
point, waiting to hear from GDB (as you have already discovered).


	-- Dan

--

	I like MMUs because I don't have a real life.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: kgdb/Sandpoint -- patch & help needed
  2000-09-19 16:39     ` Alex Shnitman
  2000-09-19 17:00       ` Dan Malek
@ 2000-09-19 17:40       ` Mark A. Greer
  1 sibling, 0 replies; 6+ messages in thread
From: Mark A. Greer @ 2000-09-19 17:40 UTC (permalink / raw)
  To: Alex Shnitman; +Cc: linuxppc-embedded


Alex Shnitman wrote:

> Hi, Murray!
>
> On Tue, Sep 19, 2000 at 02:39:17PM +1100, you wrote the following:
>
> > >... However, with this patch the kernel
> > >hangs right after saying "Now booting the kernel". I don't even see
> > >how these changes could affect the boot process so early.
> >
> > Aha! I was caught by this. When you enable CONFIG_KGDB, a breakpoint is
> > executed in setup_arch() which is just about the first thing the kernel
> > does.
>
> Right, but before calling setup_arch, it prints the linux kernel
> banner! Here's the code:
>
>         printk(linux_banner);
>         setup_arch(&command_line, &memory_start, &memory_end);
>
> And I don't see the banner. Did you see it when you encountered this?

printk's are logged to a buffer until the kernel has initialized the console
and then dumps it all out.  At this point, the console isn't initialized.  The
initialization is done with the call to console_init() (in
init/main.c:start_kernel) which eventually calls register_console() which will
dump out the logged msgs.

Mark


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: kgdb/Sandpoint -- patch & help needed
  2000-09-19 17:00       ` Dan Malek
@ 2000-09-20 12:34         ` Alex Shnitman
  0 siblings, 0 replies; 6+ messages in thread
From: Alex Shnitman @ 2000-09-20 12:34 UTC (permalink / raw)
  To: linuxppc-embedded


Hi, Dan!

On Tue, Sep 19, 2000 at 01:00:47PM -0400, you wrote the following:

> > Right, but before calling setup_arch, it prints the linux kernel
> > banner! Here's the code:
>
> The kernel "prints" lots of stuff, and it all goes into a buffer,
> to emerge quite late in the boot process when the (serial)
> console port is initialized for real use by applications.

Ooh,, I didn't know that. Thanks.

> > And I don't see the banner. Did you see it when you encountered this?
>
> You should see a 20 character (or so) ASCII string of coded information
> appear on the serial port used for GDB.  The system stops at this
> point, waiting to hear from GDB (as you have already discovered).

Still no dice.. I started minicom on the second serial port, and it
doesn't show anything when I boot the kernel. I can't find any obvious
reason for that. Perhaps someone with a Sandpoint should try it out?


--
Alex Shnitman                            | http://www.debian.org
alexsh@hectic.net, alexsh@linux.org.il   +-----------------------
http://alexsh.hectic.net    UIN 188956    PGP key on web page
       E1 F2 7B 6C A0 31 80 28  63 B8 02 BA 65 C7 8B BA

For Sale: Parachute. Only used once, never opened, small stain.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2000-09-20 12:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <alexsh@hectic.net>
2000-09-18 14:16 ` kgdb/Sandpoint -- patch & help needed Alex Shnitman
2000-09-19  3:39   ` Murray Jensen
2000-09-19 16:39     ` Alex Shnitman
2000-09-19 17:00       ` Dan Malek
2000-09-20 12:34         ` Alex Shnitman
2000-09-19 17:40       ` Mark A. Greer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).