*BSD News Article 83027


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!spool.mu.edu!uwm.edu!cs.utexas.edu!howland.erols.net!news.sgi.com!news1.best.com!nntp1.best.com!usenet
From: dillon@flea.best.net (Matt Dillon)
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: 17 Nov 1996 03:25:03 GMT
Organization: BEST Internet Communications, Inc.
Lines: 31
Message-ID: <56m0if$qk7@nntp1.best.com>
References: <56lq87$in7@rosebud.sdsc.edu>
NNTP-Posting-Host: flea.best.net
Xref: euryale.cc.adfa.oz.au comp.unix.programmer:46407 comp.unix.internals:11287 comp.unix.bsd.freebsd.misc:31119 comp.unix.pc-clone.32bit:9580

:In article <56lq87$in7@rosebud.sdsc.edu>,
:Tony Sterrett <tony@duck.sdsc.edu> wrote:
:>	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.
:>
:>	Tony

    Probably the best way to do this is to recompile the kernel with
    the maximum memory parameter set to LESS then the amount of physical
    memory you have.  You should then be able to mmap("/dev/mem", ...)
    the portion of memory that is not under the kernel's control and use
    that. 

    You still need to deal with synchronizing the caches to the
    memory, however.  I'm not sure if there are any mmap() parameters
    to make a memory segment non-cacheabled.

				-Matt