Application-accessible nvram/cache for Linux?

VirginSnow at vfemail.net VirginSnow at vfemail.net
Fri Jun 22 10:29:28 EDT 2007


> From: Bill McGonigle <bill at bfccomputing.com>
> Date: Fri, 22 Jun 2007 10:01:46 -0400
> Cc: gnhlug-discuss at gnhlug.org

> On Jun 21, 2007, at 16:38, Paul Lussier wrote:
> 
> > I don't think they want a drive, they want something like a
> > battery-backed cache but accessible from user space.
> 
> Somebody who's done systems programming more recently than me, please  
> speak up, but if you do find a suitable device that looks like a  
> drive, you might be able to create a big file on it and mmap(2) it  
> into system memory.

Actually, that probably won't work because the kernel caches file I/O
before writing to disk.  It *might* work if the device uses the SCSI
subsystem and is mounted -o sync.  If what I've heard is true, the
kernel only ever flushes IDE buffers on shutdown.  (Can anyone verify
this?)

Perhaps a PCMCIA memory card (remember those?) would work.  They
should be mmap()able.  If you're working on an embedded system, you
probably have some flash right on your PCI bus.  This, too should be
mmapable.

There are also PCI MTD (Memory Technology Device) development boards
you can buy.  These generally host a certain amount of flash, and
there are kernel options for mapping this flash into memory.  It's
*possible* that some MTD boards might use battery-backed RAM instead
of flash.  Battery-backed RAM would be faster.  I haven't seen any
boards like this, but I haven't really looked for them, either. :)


More information about the gnhlug-discuss mailing list