Skip to contentSkip to conversation

Hangup booting Linux on PPC440GP

DISCUSSION Steve Boorman 4 participants 4 messages Jul 15, 2003

lore
Share & tools
lore
#0 lore raw

Many thanks to Chris Zimman for the following suggestion which fixed my problem.

Quoted 1 line
Quoted 1 line

Do you have math emulation compiled into the kernel?

Once this was configured the system boots up fine. I overlooked this as being the cause for several reasons:-

1) Using ebony_defconfig as the kernel config file should, I would have thought, set CONFIG_MATH_EMULATION=y but it does not.

2) I would not have thought my simple printf of some text would use floating point code.

3) I expected the kernel to panic with some form of illegal instruction trap if floating point instructions were being attempted with no emulator code present.

Steve Boorman

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

#1 lore raw

Please fix your mailer to set a lower linewrap value, it is difficult to compose a reply.

Quoted 2 lines · Steve Boorman

1) Using ebony_defconfig as the kernel config file should, I would have thought, set CONFIG_MATH_EMULATION=y but it does not.

It assumes that one is using an optimized userland for 4xx. This means that the expectation is that you have soft-float binaries. Most people are using ELDK or MVL.

Quoted 3 lines

3) I expected the kernel to panic with some form of illegal instruction trap if floating point instructions were being attempted with no emulator code present.

Good point. Maybe we should add in an illegal instruction warning on the no mathemu path in the 4xx program check exception.

Regards,
--
Matt Porter
[email protected]

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

#2 lore raw
In reply to Steve Boorman
Quoted 3 lines · Steve Boorman

3) I expected the kernel to panic with some form of illegal instruction trap if floating point instructions were being attempted with no emulator code present.

That's exactly what it's doing if you look into it with a debugger. It'll be hung up with in an exception handler IIRC.

--Chris

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

#3 lore raw
In reply to Steve Boorman
Quoted 2 lines · Steve Boorman

2) I would not have thought my simple printf of some text would use floating point code.

Since printf can print floating point values, it (or one of its subroutines) would be likely to have some floating point instructions in it. Now, even if those instructions don't get executed with the particular arguments you use, just the fact that they are present will very likely cause gcc to put instructions to save some FP regs onto the stack at the beginning of the function. It's those FP store instructions which you would be hitting.

Quoted 3 lines

3) I expected the kernel to panic with some form of illegal instruction trap if floating point instructions were being attempted with no emulator code present.

There is a check in the kernel which only allows any given signal to be delivered to the init process if it has established a handler for that signal. That even applies to SIGILL (illegal instruction) and SIGSEGV (segmentation violation). So, if init hits an illegal instruction, it takes an exception, the kernel generates a SIGILL which then gets dropped, and then we return to the init process at the same instruction and the cycle repeats.

Yes we should do something more sensible.

Paul.

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