From: "Dan Maas" <dmaas@dcine.com>
To: "Dima Brodsky" <dima@cs.ubc.ca>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: mapping physical memory
Date: Fri, 26 Jan 2001 05:39:38 -0500 [thread overview]
Message-ID: <027801c08784$48a04630$0701a8c0@morph> (raw)
In-Reply-To: <fa.h16635v.l0uu8m@ifi.uio.no>
> I need to be able to obtain and pin approximately 8 MB of
> contiguous physical memory in user space. How would I go
> about doing that under Linux if it is at all possible?
The only way to allocate that much *physically* contiguous memory is by
writing a driver that grabs it at boot-time (I think the "bootmem" API is
used for this). This is an extreme measure and should rarely be necessary,
except in special cases such as primitive PCI cards that lack support for
scatter/gather DMA.
You can easily implement a mmap() interface to give user-space programs
access to the memory; there are plenty of examples of how to do this in
various character device drivers.
(well OK, if all you need is a one-off hack, you can use the method
developed by the Utah GLX people -- tell the kernel that you have 8MB *less*
RAM than is actually present using a "mem=" directive at boot, then grab
that last piece of memory by mmap'ing /dev/mem -- see
http://utah-glx.sourceforge.net/memory-usage.html)
Dan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next parent reply other threads:[~2001-01-26 10:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <fa.h16635v.l0uu8m@ifi.uio.no>
2001-01-26 10:39 ` Dan Maas [this message]
2001-01-26 16:28 ` mapping physical memory Pauline Middelink
2001-01-26 3:53 Dima Brodsky
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='027801c08784$48a04630$0701a8c0@morph' \
--to=dmaas@dcine.com \
--cc=dima@cs.ubc.ca \
--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