Subject: Re: Linux emulation in -current
To: Rob Healey <rhealey@kas.helios.mn.org>
From: Bernd Ernesti <netbsd@arresum.inka.de>
List: amiga-dev
Date: 03/03/1995 15:03:22
Hi,

> 	The x86 guys just checked in linux binary emulator for x86, are there
> 	any m68k Linux gods out there who could check and see if this will work
> 	for m68k as well? Might be cool if NetBSD/m68k could run Linux/m68k
> 	binaries...

Mmmh, when someone change this lines (trap.c) from the i386 source to m68k:

#ifdef COMPAT_LINUX
        /* XXX extra if() for every emul type.. */
        if (p->p_emul == EMUL_LINUX && !fromtramp) { 
                /* 
                 * Linux passes the args in ebx, ecx, edx, esi, edi,
                 * in increasing order.
                 */ 
                switch(i / sizeof (register_t)) {
                default:
                        /* No Linux syscalls with > 5 arguments */ 
                        break;
                case 5:
                        args[4] = frame.tf_edi;
                        /*FALLTHROUGH*/
                case 4:
                        args[3] = frame.tf_esi; 
                        /*FALLTHROUGH*/
                case 3:
                        args[2] = frame.tf_edx;
                        /*FALLTHROUGH*/
                case 2:
                        args[1] = frame.tf_ecx;
                        /*FALLTHROUGH*/
                case 1:
                        args[0] = frame.tf_ebx;
                        break;
                }
        }
        else
#endif  

then I can test some programms.
There are some trapsignals which are ony used in the i386 port:

../../../../arch/amiga/amiga/trap.c: In function `syscall':
../../../../arch/amiga/amiga/trap.c:801: structure has no member named `tf_edi'
../../../../arch/amiga/amiga/trap.c:804: structure has no member named `tf_esi'
../../../../arch/amiga/amiga/trap.c:807: structure has no member named `tf_edx'
../../../../arch/amiga/amiga/trap.c:810: structure has no member named `tf_ecx'
../../../../arch/amiga/amiga/trap.c:813: structure has no member named `tf_ebx'

Bernd