Skip to contentSkip to conversation

Using LinuxPPC executables on 8xx processors

DISCUSSION Alan Mimms 4 participants 5 messages Feb 3, 2000

lore
Share & tools
lore

Alan Mimms

author
#0 lore raw

Hi all,

I BELIEVE have seen various folks talk about using LinuxPPC executables directly on MPC8xx processor targets using some kernel floating point instruction emulation. As I recall (I'm too lazy to look it up, as I THINK I'm remembering right), the notes I saw espoused simply building a kernel with the math emulation turned on and you could use LinuxPPC executables with no changes.

I don't see how this can be true.

There are two significant (at least!) differences between "real" PowerPC and the embedded flavor: [1] the floating point unit is not present on 8xx and [2] the cache line size is 16 on 8xx as opposed to 32 bytes on 6xx/7xx. The kernel fix for emulating the floating point instructions appears to be touted as a soluation for #1, but what about #2?

The ONLY way I can see to get MPC8xx kernels to run applications is to use one of the prebuilt things from Dan's glibc-1.99, or to build a glibc that has the cache line size fixed in memset (the fixit scripts like Wolfgang's do this by moving the PowerPC specific one aside and using the generic one that doesn't use the cache enhanced zeroing) and in dl-machine.c for the data-to-code operation needed after mmap-ing libraries.

Am I missing something?

--
Alan Mimms Packet Engines, Inc. Spokane, Washington [99214-0497]
USA, Earth, Sol, Milky Way, The Local Group, Virgo Supercluster, U0
Despite the cost of living, have you noticed how popular it remains?
-- Steven Wright?

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

#1 lore raw
Quoted 6 lines · Alan Mimms

The ONLY way I can see to get MPC8xx kernels to run applications is to use one of the prebuilt things from Dan's glibc-1.99, or to build a glibc that has the cache line size fixed in memset (the fixit scripts like Wolfgang's do this by moving the PowerPC specific one aside and using the generic one that doesn't use the cache enhanced zeroing) and in dl-machine.c for the data-to-code operation needed after mmap-ing libraries.

I believe you just answered your own question: You can indeed use dynamically linked LinuxPPC executables directly on MPC8xx targets. However, you need to rebuild the shared library they link against at runtime as Wolfgang describes. Note that memset.S and dl-machine.c are in the shared library, and not in the dynamically linked executables.

Regards,
Graham

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

#2 lore raw

In message <[email protected]>

Quoted 6 lines · Graham Stoney

I believe you just answered your own question: You can indeed use dynamically linked LinuxPPC executables directly on MPC8xx targets. However, you need to rebuild the shared library they link against at runtime as Wolfgang describes. Note that memset.S and dl-machine.c are in the shared library, and not in the dynamically linked executables.

Well, in fact even the original (for instance LinuxPPC R4) binaries *and* libraries run pretty stable on the MPC8xx system once you have the FPU emulation working. It seems that the cache line problem does not show up most of the time. So if you are running a test environ- ment, where you occassionally need this tool or another, you may just ignore this for a while.

However, for a production system which must run stable I recommend to recompile the included libs and bins with (1) the the cache line size adjusted and (2) soft-float (or - even better -avoid FP suff at all).

Finally: credit where credit is due. All I did was putting together some scripts to build the tools and libs - but most of the patches I include where contributed by other people here on the list.

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] Living on Earth may be expensive, but it includes an annual free trip around the Sun.

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

#3 lore raw
Quoted 4 lines · Wolfgang Denk

Well, in fact even the original (for instance LinuxPPC R4) binaries *and* libraries run pretty stable on the MPC8xx system once you have the FPU emulation working. It seems that the cache line problem does not show up most of the time.

IIRC R4 was not based on glibc2, so I'd expect it to never show up.

//Marcus
--
Signature under construction, please come back later.

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

#4 lore raw

In message <[email protected]>

Quoted 7 lines · Marcus Sundberg
Quoted 5 lines

Well, in fact even the original (for instance LinuxPPC R4) binaries *and* libraries run pretty stable on the MPC8xx system once you have the FPU emulation working. It seems that the cache line problem does not show up most of the time.

IIRC R4 was not based on glibc2, so I'd expect it to never show up.

Of course you are right. I know there was another reason why I stick with R4 for the native test environment.

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] When you die, the first thing you lose is your life. The next thing
is the illusions. - Terry Pratchett, _Pyramids_

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