Skip to contentSkip to conversation

Init hangs

DISCUSSION Marco Schramel 5 participants 14 messages Aug 5, 2004 – Aug 6, 2004

lore
Share & tools
lore
#0 lore raw

Hi,

my kernel hangs by initializing the system. My target is mpc8270-based. I use ELDK 3.0 and mount my root-fs over nfs. Denx-kernel 2.4.25.

I added some printk's in the function "static int init(void * unused)" of linux/init/main.c to see what happens.

#############################################################

	.
	.
	.
	(void) dup(0);
	(void) dup(0);

	/*
	 * We try each of these until one succeeds.
	 *
	 * The Bourne shell can be used instead of init if we are
	 * trying to recover a really broken machine.
	 */
	if (execute_command)
		run_init_process(execute_command);
	printk("before /sbin/init\n");
	run_init_process("/sbin/init");
	printk("before /etc/init\n");
	run_init_process("/etc/init");
	printk("before  /bin/init\n");
	run_init_process("/bin/init");
	printk("before  /bin/sh\n");
	run_init_process("/bin/sh");

##################################

the last lines of my boot messages
#######################################
IP-Config: Complete:

      device=eth0, addr=192.168.55.3, mask=255.255.255.0, gw=255.255.255.255,
     host=192.168.55.3, domain=, nis-domain=(none),
     bootserver=192.168.55.1, rootserver=192.168.55.1, rootpath=

NET4: Unix domain sockets 1.0/SMP for Linux NET4.0. Looking up port of RPC 100003/2 on 192.168.55.1 Looking up port of RPC 100005/1 on 192.168.55.1
VFS: Mounted root (nfs filesystem).
Freeing unused kernel memory: 72k init before /sbin/init

##############################################

It seems like it hangs in "run_init_process("/sbin/init");" or the /sbin/init - file does not work. Sometimes the message "INIT: version 2.84 booting" is showed. And after printing this message it hangs, too. But the most times it looks like above.

Any ideas?
Thanks in advance

Marco

---------
Marco Schramel
R&D
Bartec GmbH
Schulstr. 30
94239 Gotteszell, Germany
www.bartec.de
[email protected]

Phone:  +49 (0)9929/301332
Fax:      +49 (0)9929/301112

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

#1 lore raw
Quoted 3 lines · In message <[email protected]> you wrote:

my kernel hangs by initializing the system. My target is mpc8270-based. I use ELDK 3.0 and mount my root-fs over nfs. Denx-kernel 2.4.25.

...

Quoted 5 lines

It seems like it hangs in "run_init_process("/sbin/init");" or the /sbin/init - file does not work. Sometimes the message "INIT: version 2.84 booting" is showed. And after printing this message it hangs, too. But the most times it looks like above.

Any ideas?

Run ethereal and have a look at the network traffic. Check which files get loaded and/or accessed. This might give you an idea.

But first check your memory map. Kernels crashing when entering user
space are often an indication of illegal memory maps. See
http://www.denx.de/twiki/bin/view/PPCEmbedded/Kernel#Section_10.2.

Best regards,

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] How much net work could a network work, if a network could net work?

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

#2 lore raw

Hi Wolfgang,

thanks for your reply.

Quoted 11 lines
Quoted 2 lines

my kernel hangs by initializing the system. My target is mpc8270-based. I use ELDK 3.0 and mount my root-fs over nfs. Denx-kernel 2.4.25.

...

Quoted 5 lines

It seems like it hangs in "run_init_process("/sbin/init");" or the /sbin/init - file does not work. Sometimes the message "INIT: version 2.84 booting" is showed. And after printing this message it hangs, too. But the most times it looks like above.

Any ideas?

Run ethereal and have a look at the network traffic. Check which files get loaded and/or accessed. This might give you an idea.

i started ethereal and saw that the NFS read calls from target to host, are answered with two IP "fragmented IP protocols" by the host, followed by a NFS read reply [Unreassembled Packet] by the host, too. And that goes on and on until the connection is dead.
I am not sure whether the fragmentation of ip in two packets is correct? There is no additional traffic it is "only" mounting and using rootfs over NFS.

Can you help me ?

Thanks
Marco

---------
Marco Schramel
R&D
Bartec GmbH
Schulstr. 30
94239 Gotteszell, Germany
www.bartec.de
[email protected]

Phone:  +49 (0)9929/301332
Fax:    +49 (0)9929/301112

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

#3 lore raw

Dear Marco,

Quoted 4 lines · in message <[email protected]> you wrote:

i started ethereal and saw that the NFS read calls from target to host, are answered with two IP "fragmented IP protocols" by the host, followed by a NFS read reply [Unreassembled Packet] by the host, too. And that goes on and on until the connection is dead.
I am not sure whether the fragmentation of ip in two packets is correct? There is no additional traffic it is "only" mounting and using rootfs over NFS.

The fragmentation is OK, but this is not what you're looking for.

You should see a couple of LOOKUP calls, probably in the sequence of /dev, console, sbin, init, lib, ld.so.1, and so on. Find out what the last succesful lookup call was, and what happens after this.

Best regards,

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] A metaphor is like a simile.

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

#4 lore raw

Dear Wolfgang,

Quoted 1 line

The fragmentation is OK, but this is not what you're looking for.

Ok.

Quoted 3 lines

You should see a couple of LOOKUP calls, probably in the sequence of /dev, console, sbin, init, lib, ld.so.1, and so on. Find out what the last succesful lookup call was, and what happens after this.

Searching the outputfile of ethereal tells me that the last working nfs LOOKUP call is the libc-2.3.1 call. After this and a lot of Read Call, Read Reply transfers the Target doesn't answer the host. (ARP "who has targetip-address?"). Before this, the ld.so.preload LOOKUP call fails.
(History: dev, console, sbin, init, lib, ld.so.1, ld-2.3.1.so, etc, ld.so.preload (fails), ld.so.cache, libc.so.6, libc-2.3.1, than it crashes). Is the ld.so.preload necessary?

Best regards
Marco

--
---------
Marco Schramel
R&D
Bartec GmbH
Schulstr. 30
94239 Gotteszell, Germany
www.bartec.de
[email protected]

Phone:  +49 (0)9929/301332
Fax:    +49 (0)9929/301112

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

#5 lore raw
Quoted 4 lines · In message <[email protected]> you wrote:

Searching the outputfile of ethereal tells me that the last working nfs LOOKUP call is the libc-2.3.1 call. After this and a lot of Read Call, Read Reply transfers the Target doesn't answer the host. (ARP "who has targetip-address?"). Before this, the ld.so.preload LOOKUP call fails.
(History: dev, console, sbin, init, lib, ld.so.1, ld-2.3.1.so, etc, ld.so.preload (fails), ld.so.cache, libc.so.6, libc-2.3.1, than it crashes). Is the ld.so.preload necessary?

No, it's not necesary. It's normal that this lookup fails.

Looks as if your init is crashing.

Try running a (statically linked) shell instead (by passing some init=/bin/sh" option on the boot command line).

Best regards,

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] It is easier to write an incorrect program than understand a correct one.

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

#6 lore raw
Quoted 4 lines · Wolfgang Denk

Looks as if your init is crashing.

Try running a (statically linked) shell instead (by passing some init=/bin/sh" option on the boot command line).

This could also be a floating point issue. Most code compiled against libc will try to "reset" the floating point state upon startup. This will cause a fault if you do not have a kernel floating point emulator of some sort loaded to handle it. (Even though init doesn't use any floating point itself). So as a quick test try building your kernel with CONFIG_MATH_EMULATION=y

-R

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

#7 lore raw
Quoted 1 line · Ralph Siemsen

This could also be a floating point issue.

I doubt it. The processor in question is an 8270, which has an FPU.

Quoted 4 lines

Most code compiled against
libc will try to "reset" the floating point state upon startup. This will cause a fault if you do not have a kernel floating point emulator of some sort loaded to handle it.

On the MPC8xx, which does not have a floating point unit, there is still sufficient support in the kernel to trap and emulate FPU reset and context save/restore for this purpose. You only need the CONFIG_MATH_EMULATION is you intend to
really do floating point arithmetic.

Quoted 3 lines

(Even though init doesn't use any
floating point itself). So as a quick test try building your kernel with CONFIG_MATH_EMULATION=y

This should not be used with any processor that has hardware floating point. In the rare cases where you may actually be utilizing IEEE trap conditions, these functions could get in the way and produce erroneous results.

	-- Dan

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

#8 lore raw
Quoted 5 lines · Dan Malek

On the MPC8xx, which does not have a floating point unit, there is still sufficient support in the kernel to trap and emulate FPU reset and context save/restore for this purpose. You only need the CONFIG_MATH_EMULATION is you intend to really do floating point arithmetic.

thanks for that tidbit. i've always wondered, for our 850DE, hmmm ... math emulation or no math emulation? i guess i can just make sure it's turned off, and see if it ever causes a problem.

rday

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

#9 lore raw
Quoted 1 line · Robert P. J. Day

thanks for that tidbit.

Trivia time. The reason I did that many years ago when first ported the 8xx
was I had only 6xx tools and libraries available. Even though you don't have any floating point in your program, things like initialization, set/longjmp,
signals and so on would assume an FPU was available. So, I just trapped those few FP load/store instructions. Later on, I did the whole math emulation thing. Of course, today the best solution is a development
kit specific to the 8xx that has applications and libraries already properly
compiled. Without math emulation enabled, you still get those few trivial traps emulated.

	-- Dan

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

#10 lore raw
In reply to Ralph Siemsen
Quoted 4 lines · In message <[email protected]> you wrote:

This could also be a floating point issue. Most code compiled against libc will try to "reset" the floating point state upon startup. This will cause a fault if you do not have a kernel floating point emulator

No, this has nothing to do with it.

First, Marco wrote that he is working on a 8270 processor which has a FPU, so FP issues should not play a role here.

Second, he mentioned that he was using the ELDK which takes care of using soft-float on processors without a MMU.

Thanks.

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] The following statement is not true. The previous statement is true.

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

#11 lore raw
Quoted 1 line · Wolfgang Denk

No, this has nothing to do with it.

I stand corrected ;) Thanks Dan and Wolfgang. I'm still a ppc newbie, not yet familiar with all of the different sub-architecture features and options, sorry :(

I had "init troubles" on the 44x and it had turned out to be FP issue (my init for testing is actually busybox, so it kind of makes sense).

-Ralph

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

#12 lore raw
In reply to Wolfgang Denk
Quoted 2 lines · Wolfgang Denk

Second, he mentioned that he was using the ELDK which takes care of using soft-float on processors without a MMU.

Without an MMU? Really? :-) Just kidding. I'm just glad I'm not the only one that types stuff like that once in a while.

	-- Dan

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

#13 lore raw
Quoted 2 lines · In message <[email protected]> you wrote:

On Aug 6, 2004, at 8:46 AM, Wolfgang Denk wrote:

...

Quoted 4 lines
Quoted 1 line

using soft-float on processors without a MMU.

Without an MMU? Really? :-) Just kidding. I'm just glad I'm not the only one that types stuff like that once in a while.

Brain offline, please wait ;-)

Best regards,

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] The only way to learn a new programming language is by writing pro-
grams in it. - Brian Kernighan

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