Flash memory like geom class.

Pawel Jakub Dawidek pjd at FreeBSD.org
Wed Jun 6 12:35:27 UTC 2007


On Wed, Jun 06, 2007 at 08:55:17PM +0900, Takanori Watanabe wrote:
> Hi, I wrote flash memory like geom class backed
> by kernel memory.
> 
> It emulates 4MB capacity, 512bytes block size and 16KB erase size flash memory.
> The device is initialized with 0xff.
> When you write a sector to the device, the content will be gets and operation 
> with current sector content and the data provided.
> 
> When BIO_DELETE operation is issued, the times is counted per region
> and fill the erase region with 0xff.
> 
> http://www.init-main.com/geom_pflash.tar.gz
> Current issues I have is as follows.
> 
> 1.How can I issue BIO_DELETE from userland?
> I convice BIO_DELETE is used to perform erase operation to flash,
> but I could not find a way to issue BIO_DELETE from userland.
> Or BIO_DELETE is not suitable request for it?

I recently exteneded libgeom to support g_delete() function, which does
what you want. You may also use DIOCGDELETE directly (also added
recently).

> 2.How can I export statistic information?
> I record the count of erase operation, but there is no way to
> export the information for now, other than poking with 
> debugger. How shall I do with it?

I'd guess sysctl or if you want them to be per-provider you should geom
geom_ctl. Check out g_nop.c and how it exports various statistics in
g_nop_dumpconf() function.

> 3.Do you think it something useful?
> I think it can be used to develop flash file system.
> How do think about this?

I haven't looked at the code yet, not thought about this, just wanted to
provide some info, so I can't comment on its usefulness yet.

-- 
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20070606/5b3c766d/attachment.pgp


More information about the freebsd-geom mailing list