mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeremy Jackson <jerj@coplanar.net>
To: David Frascone <dave@frascone.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Faking a memory map?
Date: 13 Feb 2003 13:14:52 -0500	[thread overview]
Message-ID: <1045160092.1295.94.camel@contact.skynet.coplanar.net> (raw)
In-Reply-To: <20030212002115.GD26196@wolverine>

On Tue, 2003-02-11 at 19:21, David Frascone wrote:
> I'm trying to get an existing SDK (userland) for a PCI hardware device
> to work across a different propriatary bit-banged interface.
> 
> The original device driver just mmaped the PCI registers / address
> space into userland.  (talk about lazy ;)
> 
> Anyway, the hardware I'm working with is *not* on the PCI bus, and
> therefore not memory-mappable.  So, I'm stuck with a complex driver
> design (compared to the original), and rewriting the entire bottom of
> the SDK.
> 
> So, I thought:  Is there a way to cheat?  Would it be possible for me
> to *fake* the SDK out by memory mapping some RAM, and then reading /
> writing to the ram after bit-banging the device.
> 
> I looked into it some, but I couldn't figure out how to get notified
> when the region was read/written to (only when the page changed).  So,
> is it possible to do the (admitedly ugly) hack I'm attempting?

I think you would have to use mprotect(,,PROT_NONE), set the region to
disallow read/write, and then each SEGV would have to be decoded, and
the trap told to continue as though the access did take place.

Take a look at the mprotect man page for an example, and then sigaction
arount the siginfo_t area.  in siginfo_t.si_addr it gives the address
that faulted.
> 
> Thanks in advance,
> 
> -Dave
-- 
Jeremy Jackson <jerj@coplanar.net>


      reply	other threads:[~2003-02-13 18:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-12  0:21 David Frascone
2003-02-13 18:14 ` Jeremy Jackson [this message]

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=1045160092.1295.94.camel@contact.skynet.coplanar.net \
    --to=jerj@coplanar.net \
    --cc=dave@frascone.com \
    --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

all inboxes | Powered by JetHome®