Skip to contentSkip to conversation

kgdb/Sandpoint -- patch & help needed

DISCUSSION Murray Jensen 4 participants 5 messages Sep 19, 2000 – Sep 20, 2000 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 3 lines · Alex Shnitman

... 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/

#2 lore raw

Hi, Murray!

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

Quoted 7 lines
Quoted 3 lines

... 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
[email protected], [email protected] +-----------------------
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/

#3 lore raw
Quoted 2 lines · Alex Shnitman

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.

Quoted 1 line

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/

#4 lore raw

Hi, Dan!

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

Quoted 6 lines
Quoted 2 lines

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.

Quoted 5 lines
Quoted 1 line

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
[email protected], [email protected] +-----------------------
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/

#5 lore raw
In reply to Alex Shnitman
Quoted 12 lines · Alex Shnitman

Hi, Murray!

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

Quoted 7 lines
Quoted 3 lines

... 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.

Quoted 7 lines

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/