public inbox for linux-8086@vger.kernel.org
 help / color / mirror / Atom feed
From: Miguel Bolanos <mike@linuxlabs.com>
To: Eduardo Pereira Habkost <ehabkost@conectiva.com.br>
Cc: linux-8086@vger.kernel.org
Subject: Re: Experimental fix for my memcpy_{to,from}fs problem
Date: Tue, 01 Jun 2004 20:57:06 -0600	[thread overview]
Message-ID: <1086145026.3220.41.camel@talena.hsol.net> (raw)
In-Reply-To: <20040601223034.GW21172@duckman.distro.conectiva>

Greetings,

On Tue, 2004-06-01 at 16:30, Eduardo Pereira Habkost wrote:
> Interesting:
> 
> The diff between dev86-0.16.0 and 0.16.15 shows:
> 
> @@ -664,8 +693,34 @@
>         if( main_flag > 2 )
>            globl("environ");
>      }
> +#ifdef I8088
> +    regfuse = 0;
> +#endif
>      lbrace();
>      compound();
> +#ifdef I8088
> +    if (regfuse & callee1mask) {
> +        outstr("! Register");
> +        if (regfuse & INDREG0 & callee1mask) outstr(" BX");
> +        if (regfuse & INDREG1 & callee1mask) outstr(" SI");
> +       if (regfuse & INDREG2 & callee1mask) outstr(" DI");
> +       outstr(" used in function ");
> +       outnstr(funcname);
> +       if (optimise && !callersaves) {
> +           outstr(funcname);
> +           outnstr(".off = 0");
> +       }
> +    } else
> +       if (optimise && !callersaves) {
> +           outstr(funcname);
> +           outstr(".off = ");
> +#ifndef I80386
> +           outnhex(4);
> +#else
> +           outnhex(i386_32?12:4);
> +#endif
> +       }
> +#endif
>      clearfunclabels();
>  }
> 
> This register-saving optmization was added after 0.16.0. The fix is valid,
> but probably it will break systems using dev86 <= 0.16.0.
> 

Yes the fix is ok.. but it will break dev86 <= 0.16.0 versions... this
fact makes me hesitate a bit because Bruce does warn that 0.16.15 can
behave a bit unstable.
But we will see.

best wishes

Mike

> On Tue, Jun 01, 2004 at 07:02:35PM -0300, Eduardo Pereira Habkost wrote:
> > 
> > The following patch fixes the problem on my system. Probably
> > with some versions of bcc the patch will break something.
> > 
> > I've added code to save the contents of SI and DI, I don't know if the
> > callers of these functions assume that SI and DI are touched, but just
> > in case.
> > 
> > Now the system booted and ran flawlessly.
> > 
> > --- elks/arch/i86/mm/user.c	3 Jun 2002 22:22:58 -0000	1.15
> > +++ elks/arch/i86/mm/user.c	1 Jun 2004 20:44:51 -0000
> > @@ -34,10 +34,12 @@
> >  
> >  #ifndef S_SPLINT_S
> >  #asm
> > +	push	si
> > +	push	di
> >  	mov	dx,es
> >  	mov	bx,ds
> >  	mov	es,bx
> > -	mov	ax,[bp-6]	! source segment (local variable)
> > +	mov	ax,[bp-2]	! source segment (local variable)
> >  	mov	ds,ax
> >  	mov	di,[bp+4]	! destination address
> >  	mov	si,[bp+6]	! source address
> > @@ -47,8 +49,11 @@
> >  	movsb
> >  	mov	ds,bx
> >  	mov	es,dx
> > +	pop	di
> > +	pop	si
> >  #endasm
> >  #endif
> > +
> >  }
> >  
> >  int verified_memcpy_fromfs(void *daddr, void *saddr, size_t len)
> > @@ -69,8 +74,10 @@
> >  
> >  #ifndef S_SPLINT_S
> >  #asm
> > +	push	si
> > +	push	di
> >  	mov	dx,es
> > -	mov	ax,[bp-6]	! source segment (local variable)
> > +	mov	ax,[bp-2]	! source segment (local variable)
> >  	mov	es,ax
> >  	mov	di,[bp+4]	! destination address
> >  	mov	si,[bp+6]	! source address
> > @@ -79,6 +86,8 @@
> >  	rep
> >  	movsb
> >  	mov	es,dx
> > +	pop	di
> > +	pop	si
> >  #endasm
> >  #endif
> >  }
> > 
> > -- 
> > Eduardo
> 
> 


  reply	other threads:[~2004-06-02  2:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-01 21:32 memcpy_fromfs() failing. Wrong variable offsets Eduardo Pereira Habkost
2004-06-01 22:02 ` Experimental fix for my memcpy_{to,from}fs problem Eduardo Pereira Habkost
2004-06-01 22:30   ` Eduardo Pereira Habkost
2004-06-02  2:57     ` Miguel Bolanos [this message]
2004-06-02 16:25       ` Eduardo Pereira Habkost
2004-06-03 14:02         ` Miguel Bolanos
2004-06-03 14:14           ` Eduardo Pereira Habkost
2004-06-03 14:37             ` Paul Nasrat
2004-06-02  1:33   ` claudio
2004-06-02 20:53     ` Miguel Bolanos
2004-06-02  3:05   ` Miguel Bolanos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1086145026.3220.41.camel@talena.hsol.net \
    --to=mike@linuxlabs.com \
    --cc=ehabkost@conectiva.com.br \
    --cc=linux-8086@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox