* Re: mapping physical memory
[not found] <fa.h16635v.l0uu8m@ifi.uio.no>
@ 2001-01-26 10:39 ` Dan Maas
2001-01-26 16:28 ` Pauline Middelink
0 siblings, 1 reply; 3+ messages in thread
From: Dan Maas @ 2001-01-26 10:39 UTC (permalink / raw)
To: Dima Brodsky; +Cc: linux-kernel
> 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/
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: mapping physical memory
2001-01-26 10:39 ` mapping physical memory Dan Maas
@ 2001-01-26 16:28 ` Pauline Middelink
0 siblings, 0 replies; 3+ messages in thread
From: Pauline Middelink @ 2001-01-26 16:28 UTC (permalink / raw)
To: linux-kernel
On Fri, 26 Jan 2001 around 05:39:38 -0500, Dan Maas wrote:
> > 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.
Or is you want to reuse that memory between apps, use the bigphysarea
patch. Yes, its available for 2.4.0 now :)
Met vriendelijke groet,
Pauline Middelink
--
GPG Key fingerprint = 2D5B 87A7 DDA6 0378 5DEA BD3B 9A50 B416 E2D0 C3C2
For more details look at my website http://www.polyware.nl/~middelink
-
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/
^ permalink raw reply [flat|nested] 3+ messages in thread
* mapping physical memory
@ 2001-01-26 3:53 Dima Brodsky
0 siblings, 0 replies; 3+ messages in thread
From: Dima Brodsky @ 2001-01-26 3:53 UTC (permalink / raw)
To: Linux Kernel List
Hi,
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?
Thanks
ttyl
Dima
--
Dima Brodsky dima@cs.ubc.ca
http://www.cs.ubc.ca/~dima
201-2366 Main Mall (604) 822-6179 (Office)
Department of Computer Science (604) 822-2895 (DSG Lab)
University of British Columbia, Canada (604) 822-5485 (FAX)
Computers are like Old Testament gods; lots of rules and no mercy.
(Joseph Campbell)
-
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/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-01-26 16:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <fa.h16635v.l0uu8m@ifi.uio.no>
2001-01-26 10:39 ` mapping physical memory Dan Maas
2001-01-26 16:28 ` Pauline Middelink
2001-01-26 3:53 Dima Brodsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox