*BSD News Article 83098


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.Hawaii.Edu!news.uoregon.edu!hunter.premier.net!www.nntp.primenet.com!nntp.primenet.com!feed1.news.erols.com!news.ecn.uoknor.edu!news.cis.okstate.edu!nntp.ksu.edu!hptemp1.cc.umr.edu!nneul
From: nneul@umr.edu (Nathan Neulinger)
Newsgroups: comp.unix.programmer,comp.unix.internals,comp.unix.bsd.freebsd.misc,comp.unix.pc-clone.32bit
Subject: Re: Allocating large blocks for memory
Date: Sun, 17 Nov 1996 15:39:14 -0600
Organization: University of Missouri - Rolla
Lines: 30
Distribution: world
Message-ID: <nneul-ya023180001711961539140001@usenet.umr.edu>
References: <56lq87$in7@rosebud.sdsc.edu>
NNTP-Posting-Host: dialup-pkr-7-6.network.umr.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: Yet Another NewsWatcher 2.3.1
Xref: euryale.cc.adfa.oz.au comp.unix.programmer:46455 comp.unix.internals:11292 comp.unix.bsd.freebsd.misc:31173 comp.unix.pc-clone.32bit:9582

|         Hello everybody.
|         I am using FreeBSD 2.1.5 on a Pentium(PCI). I need to access
|         a hardware card which writes 1MB buffers in to the address I
|         provide it. The rub is that this 1MB must be contigous. I have
|         not been able to determine a memory allocation routine which
|         can give a this size block of memory.
| 
|         The idea of the program is to give the hardware a pointer
|         and when it interrupts read that pointer. I also need to
|         have another 1MB of contigous memeory ready for the hardware
|         so this means I have to develop some sort of mem block 
|         management routine.   
| 
|         Can anyone offer any suggestion? Thanks in advance.

I may be wrong here, but I think you're totally out of luck unless you are
writing kernel code. 

Even a large block of allocated memory in a process might not actually be
contiguous due to paging/swapping/etc.

The only place you'll be able to guarantee a contiguously allocated block
of memory is to do it in the kernel source.

-- Nathan

------------------------------------------------------------
Nathan Neulinger                  Univ. of Missouri - Rolla
EMail: nneul@umr.edu                  Computing Services
WWW: http://www.umr.edu/~nneul      SysAdmin: rollanet.org