Subject: Re: PPC linux compat
To: Emmanuel Dreyfus <p99dreyf@criens.u-psud.fr>
From: Bill Studenmund <wrstuden@zembu.com>
List: port-macppc
Date: 10/19/2000 13:53:18
On Wed, 18 Oct 2000, Emmanuel Dreyfus wrote:

> > There's a pkgsrc for the suse Linux distribution on x86.  
> 
> Yes, that package has a problem: it uses binaries, and depending on the
> CPU (i386, m68k, and maybe ppc in the future), we should download
> different files. Currently, it works only for i386. It would make sense
> to download the i386 Linux libs, the m68k Linux libs or the ppc Linux
> libs, depending on the CPU. Anyway, this is not the biggest problem yet.
> What should be done now (and that's what I'd like to get info about) is
> kernel support for Linux compat for ppc. 

I think the idea with the suggestion was that we could use those packages
as a start for powerpc packages. I'd vote we use the Yellow Dog
distribution - they seem the most savvy (for ppc) from what I can tell.

> > You could also grep for COMPAT_LINUX (or whatever the config option is) in
> > the kernel source tree.
> 
> All CPU dependent stuff seems to be here: /sys/compat/linux/arch/powerpc
> In that directory, we have the following files
> Makefile        linux_mmap.h    syscalls.conf
> 
> In /sys/compat/linux/arch/m68k, we have:
> linux_machdep.h           linux_syscallargs.h
> Makefile                  linux_mmap.h              linux_syscalls.c
> files.linux_m68k          linux_sig_machdep.S       linux_sysent.c
> linux_errno.h             linux_sigarray.c          linux_termios.h
> linux_exec.h              linux_siginfo.h           linux_types.h
> linux_fcntl.h             linux_signal.h            syscalls.conf
> linux_ioctl.h             linux_socket.h            syscalls.master
> linux_machdep.c           linux_syscall.h
> 
> And /sys/compat/linux/arch/i386 has nearly the same stuff (But without
> an assemble language file)
> 
> I assume that in order to create the macppc linux compat, we'll need to
> create files similar for the powerpc directory. Therefore, I'm looking
> for some information about theses files: what are they for exactly? How
> do I know what file I need to reproduce? All? And for example, what is
> CPU dependant in linux_sigarray.c? This file is exactly the same (except
> for the CVS tag) for i386 and m68k...

Note: the fact that a file is the same in m68k & i386 is not a definite
guide - the m68k version might be an umodified copy. :-)

As for linux_sigarray.c (and other files) compare things with files in the
alpha subdirectory. :-)

What you'll have to do is figure out what things on Linux differ between
architectures (like signal layouts, etc.)

Taking linux_sigarray.c for example again, a comment in
compat/linux/common/linux_signal.c says:
/* Note: linux_to_native_sig[] is in <arch>/linux_sigarray.c */
So that's what it does. If it's the same on m68k and i386, then those two
architectures (under linux) use the same signal layout. Or someone just
copied files. :-)

Take care,

Bill