MPC8xx: `init' problems / Bad emulation -- was: wrong zimage_start
First of all: thanks to all (Magnus Damm, Kári Davíðsson, Leif Lindholm) who helped me sorting out my `zimage_start' problem. I have got Linux running on my custom MPC860 board, both with initrd in FLASH and with NFS mounted root.
However, I'm running into two new problems (maybe related, but I don't think so):
* Programs that try do do any FP calculations don't work, for instance:
# date 06042124
Bad emulation date/6
NIP: 30122204 instruction: fd8c6828 opcode: 3f A: c B: d C: 0 code: 14 rc: 0
pte @ 0x30122204: (0xc1efd300)->(0xc1efb488)->0x01f1c881
RPN: 01f1c PP: 2 SPS: 0 SH: 0 CI: 0 v: 1
Kernel VA for NIP c1f1c204 pte @ 0xc1f1c204: (0xc1efdc1c)->(0xc00eec70)->0x01f1c1c5
RPN: 01f1c PP: 0 SPS: 0 SH: 1 CI: 0 v: 1
Software Emulation date/6 NIP: 30122204 *NIP: 0xfd8c6828 code: 1Illegal Instruction
# perl
Bad emulation perl/7
NIP: 3020e0e0 instruction: fc200090 opcode: 3f A: 0 B: 0 C: 2 code: 8 rc: 0
pte @ 0x3020e0e0: (0xc1efd300)->(0xc1efb838)->0x01eae881
RPN: 01eae PP: 2 SPS: 0 SH: 0 CI: 0 v: 1
Kernel VA for NIP c1eae0e0 pte @ 0xc1eae0e0: (0xc1efdc1c)->(0xc00eeab8)->0x01eae1c5
RPN: 01eae PP: 0 SPS: 0 SH: 1 CI: 0 v: 1
Software Emulation perl/7 NIP: 3020e0e0 *NIP: 0xfc200090 code: 1Illegal Instruction
# awk -f ' '
Software Emulation awk/8 NIP: 180f840 *NIP: 0xc83efff8 code: eawk: fatal error: internal error
AbortedIs this a known problem? Is there a fix for it?
* /sbin/init does not work. This seems to be a known problem, since the tar image for the MBX board on the `embedded' FTP Server (mbxroot.full.tgz) has /sbin/init renamed; I tried this version (init.old), and the "standard" versions in release 4.1 and DR-1.0 -- all show the same result (system hangs somewhere).
Does anybody know why? Is there a fix for it?
Thanks in advance,
Wolfgang
Signature · 7 lines
Phone: (+49)-8142-4596-87 Fax: -88 Home: -86 Email: [email protected] God made the integers; all else is the work of Man. - Kronecker [[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]] [[ and http://www.linuxppc.org/ for useful information before posting. ]]
Quoted 32 lines · Wolfgang Denk
First of all: thanks to all (Magnus Damm, Kári Davíðsson, Leif Lindholm) who helped me sorting out my `zimage_start' problem. I have got Linux running on my custom MPC860 board, both with initrd in FLASH and with NFS mounted root.
However, I'm running into two new problems (maybe related, but I don't think so):
* Programs that try do do any FP calculations don't work, for instance:
# date 06042124 Bad emulation date/6 NIP: 30122204 instruction: fd8c6828 opcode: 3f A: c B: d C: 0 code: 14 rc: 0 pte @ 0x30122204: (0xc1efd300)->(0xc1efb488)->0x01f1c881 RPN: 01f1c PP: 2 SPS: 0 SH: 0 CI: 0 v: 1 Kernel VA for NIP c1f1c204 pte @ 0xc1f1c204: (0xc1efdc1c)->(0xc00eec70)->0x01f1c1c5 RPN: 01f1c PP: 0 SPS: 0 SH: 1 CI: 0 v: 1 Software Emulation date/6 NIP: 30122204 *NIP: 0xfd8c6828 code: 1Illegal Instruction # perl Bad emulation perl/7 NIP: 3020e0e0 instruction: fc200090 opcode: 3f A: 0 B: 0 C: 2 code: 8 rc: 0 pte @ 0x3020e0e0: (0xc1efd300)->(0xc1efb838)->0x01eae881 RPN: 01eae PP: 2 SPS: 0 SH: 0 CI: 0 v: 1 Kernel VA for NIP c1eae0e0 pte @ 0xc1eae0e0: (0xc1efdc1c)->(0xc00eeab8)->0x01eae1c5 RPN: 01eae PP: 0 SPS: 0 SH: 1 CI: 0 v: 1 Software Emulation perl/7 NIP: 3020e0e0 *NIP: 0xfc200090 code: 1Illegal Instruction # awk -f ' ' Software Emulation awk/8 NIP: 180f840 *NIP: 0xc83efff8 code: eawk: fatal error: internal error Aborted
Quoted 1 line
Is this a known problem? Is there a fix for it?
Don't use floating point instructions in the programs, embedded PPC doesn't have FPUs. Use -mcpu=860 -msoft-float when compiling to use soft floats (note that all FP using programs and libraries must be recompiled with these options to work properly).
You will also need to patch glibc to remove the FP inline assembly and the inline memcpy which assumes 32 byte cache lines.
//Marcus
Signature · 9 lines
-------------------------------+------------------------------------
Marcus Sundberg | http://www.stacken.kth.se/~mackan/
Royal Institute of Technology | Phone: +46 707 295404
Stockholm, Sweden | E-Mail: [email protected]
[[ This message was sent via the linuxppc-dev mailing list. Replies are ]]
[[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]Re: MPC8xx: Bad emulation
In message <[email protected]>
Quoted 3 lines · Marcus Sundberg
Don't use floating point instructions in the programs, embedded PPC doesn't have FPUs. Use -mcpu=860 -msoft-float when compiling to use
Yes, I know this.
Quoted 4 lines
soft floats (note that all FP using programs and libraries must be recompiled with these options to work properly).
You will also need to patch glibc to remove the FP inline assembly and the inline memcpy which assumes 32 byte cache lines.
And this is exactly the point that makes this option unacceptable from the practical point of view. We would have to build special MPC8xx releases of LinuxPPC then.
How does this work for you? You may have a small embedded system with
just a small set of applications in mind, where `-mcpu=860
-msoft-float' works fine; but once you have Linux running on such a board, it *always* happens that you run into situations where you want to do some things in native mode - well, no problem: mount the Linux environment over NFS. Then you can dynamically load and unload (and debug) device drivers, etc.
And suddenly you will need this tool and that one, too.
Your customer asks: And could I run a web server on this box, too? You say: well, no problem, just start appache - and "Bad emulation".
There are *many* situations where it is really necessary to be able to run _any_ binary from a standrad LinuxPPC distribution on the 860, too. I agree that it makes sense to recompile dedicated applications for an embedded solution.
Wolfgang Denk
Signature · 9 lines
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] "He only drinks when he gets depressed." "Why does he get depressed?" "Sometimes it's because he hasn't had a drink." - Terry Pratchett, _Men at Arms_ [[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]] [[ and http://www.linuxppc.org/ for useful information before posting. ]]
Re: MPC8xx: Bad emulation
Quoted 4 lines · Wolfgang Denk
There are *many* situations where it is really necessary to be able to run _any_ binary from a standrad LinuxPPC distribution on the 860, too. I agree that it makes sense to recompile dedicated applications for an embedded solution.
Then what you may wish to do is develop a software FPU for the PPC860. That is, have the OS patch the illegal instruction trap so that it jumps to emulation code when the instruction is an FP instruction.
I'm surprised. I thought we were already doing this. This sort of thing has been done forever on the 68k to emulate the 68881/2 FPU. It's slow but if you don't plan on doing much floating point, it's perfectly acceptable.
_______________________________________________________________________
Michael Zucca - [email protected] - http://www.mdc.net/~mrz5149/
"I will choose a path that's clear. I will choose Freewill. "
--Rush, Freewill
_______________________________________________________________________
[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]
Re: MPC8xx: Bad emulation
Quoted 3 lines · Michael R. Zucca
I'm surprised. I thought we were already doing this. This sort of thing has been done forever on the 68k to emulate the 68881/2 FPU. It's slow but if you don't plan on doing much floating point, it's perfectly acceptable.
Since when has this been done forever on m68k?
It was working sometimes on some old 1.2.x kernels and perhaps older, it hasnt been working since afaik, and hasnt been much of an issue until recently on old macs, as most of atari and amiga owners has gotten ourselves 68881/2 chips in the meantime.
It's been forever on intel though.
Kolbjørn Barmen | a3k/o6o/6o4e/AmigaOS/MacOS/LinuxPPC | // T e a m
<[email protected]> | a12ooCT/o3o/Linux-m68k a6oo/o3o/AmigaOS | \XX/ A M I G A Nettverksgruppa | "I met the Amiga and fell in love..." | <amiga.nvg.org>
»» Norwegian University of Technology and Science ««
[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]
Re: MPC8xx: Bad emulation
Quoted 2 lines · Michael R. Zucca
I'm surprised. I thought we were already doing this. This sort of thing
So thought I; but the existing solution is far from being complete.
Quoted 2 lines
has been done forever on the 68k to emulate the 68881/2 FPU. It's slow but if you don't plan on doing much floating point, it's perfectly acceptable.
Agreed.
Quoted 5 lines · Kolbjørn Barmen
It was working sometimes on some old 1.2.x kernels and perhaps older, it hasnt been working since afaik, and hasnt been much of an issue until recently on old macs, as most of atari and amiga owners has gotten ourselves 68881/2 chips in the meantime.
It is perfectly understandable that there is no much interest for this on the workstation class of Linux boxen. But especially with the PPC port and Embedded Controllers like the Motorola MPC8xx or the IBM 401x2 I se a good chance for Linux entering the world of embedded (and realtime) systems. This opens a whole new set of requirements.
Wolfgang Denk
Signature · 9 lines
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] It is impractical for the standard to attempt to constrain the behavior of code that does not obey the constraints of the standard. - Doug Gwyn [[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]] [[ and http://www.linuxppc.org/ for useful information before posting. ]]