linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Pfaff <blp@cs.stanford.edu>
To: linux-kernel@vger.kernel.org
Subject: Re: Emulating i486 on i386 (was: TSCs are a no-no on i386)
Date: 31 Jul 2003 10:35:00 -0700	[thread overview]
Message-ID: <877k5y8urf.fsf@pfaff.Stanford.EDU> (raw)
In-Reply-To: <fnQP.5bE.5@gated-at.bofh.it>

Jan-Benedict Glaw <jbglaw@lug-owl.de> writes:

> On Thu, 2003-07-31 16:12:26 +0100, Jamie Lokier <jamie@shareable.org>
> wrote in message <20030731151226.GG6410@mail.jlokier.co.uk>:
> > Alan Cox wrote:
> > > On Iau, 2003-07-31 at 12:38, Jan-Benedict Glaw wrote:
> > > > See? It's loaded at the "ls" call, but it seems to be not loaded for
> > > > apt-get.
> > > 
> > > Remember you need to overload signal setting functions like sigaction.
> > > My guess is apt decided to disable your signal and you didnt stop it
> > 
> > An application might install its own SIGILL handler to emulate or trap
> > _other_ instructions.  To do it properly, you have to chain the handlers.
> > 
> > Not sure how to do this, when you get to the stage of two LD_PRELOAD
> > libraries each wanting to overload sigaction.
> 
> That's not (yet) my problem and I think it's not impossible to hook
> them. _But_ before, I need to get called at all _before_ libstdc++5's
> _init(). For now, I haven't managed to do that...

One way to get loaded before anything else is to do ELF binary
loading by hand in userspace.  The kernel exec loads your
program, which sets up trap handlers etc., then loads the actual
target binary by hand.  I did this for an application sandbox.
Writing the loader took less than half a day since I was able to
use a lot of kernel code from binfmt_elf.c directly, just
translating internal kernel calls into open, mmap, etc. system
calls.
-- 
"Note that nobody reads every post in linux-kernel.   In fact, nobody who
 expects to have time left over to  actually do any real kernel work will
 read even half.  Except Alan Cox, but he's actually not human, but about
 a thousand gnomes working in under-ground caves in Swansea." --Linus


       reply	other threads:[~2003-07-31 17:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <f41P.374.9@gated-at.bofh.it>
     [not found] ` <f4bw.3eu.13@gated-at.bofh.it>
     [not found]   ` <f5Az.4tG.3@gated-at.bofh.it>
     [not found]     ` <f5TZ.4Hq.11@gated-at.bofh.it>
     [not found]       ` <f9uz.Ll.5@gated-at.bofh.it>
     [not found]         ` <ff6X.6qi.3@gated-at.bofh.it>
     [not found]           ` <ffTk.734.15@gated-at.bofh.it>
     [not found]             ` <fk6A.241.7@gated-at.bofh.it>
     [not found]               ` <fkgp.2aL.29@gated-at.bofh.it>
     [not found]                 ` <fnnW.4QQ.43@gated-at.bofh.it>
     [not found]                   ` <fnQP.5bE.5@gated-at.bofh.it>
2003-07-31 17:35                     ` Ben Pfaff [this message]
2003-07-30 13:56 TSCs are a no-no on i386 Jan-Benedict Glaw
2003-07-30 18:10 ` Adrian Bunk
2003-07-30 18:30   ` Mike Fedyk
2003-07-30 18:45     ` Adrian Bunk
2003-07-30 20:01       ` Alan Cox
2003-07-30 20:33         ` Jan-Benedict Glaw
2003-07-31  0:22           ` Adrian Bunk
2003-07-31  6:22             ` Jan-Benedict Glaw
2003-07-31  7:17               ` Willy Tarreau
2003-07-31 11:38                 ` Emulating i486 on i386 (was: TSCs are a no-no on i386) Jan-Benedict Glaw
2003-07-31 11:51                   ` Alan Cox
2003-07-31 12:14                     ` Jan-Benedict Glaw
2003-07-31 13:01                       ` Jan-Benedict Glaw
2003-07-31 15:09                         ` Martin Schlemmer
2003-07-31 15:33                           ` Jan-Benedict Glaw
2003-08-01  5:37                             ` Martin Schlemmer
2003-07-31 15:12                     ` Jamie Lokier
2003-07-31 15:32                       ` Jan-Benedict Glaw

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=877k5y8urf.fsf@pfaff.Stanford.EDU \
    --to=blp@cs.stanford.edu \
    --cc=linux-kernel@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;
as well as URLs for NNTP newsgroup(s).