OpenQNX :: The QNX Community Portal

Oct 07, 2008 - 12:10 PM
Google
  Web openqnx.com   
     Create an account Home · Submit News · QNX Forums · QNX Download · Search   
_
Main Menu
Who's Online
There are 45 unlogged users and 0 registered users online.

You can log-in or register for a user account here.

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
jacus
Post subject: Where is one block ?  PostPosted: Apr 19, 2006 - 01:31 PM
Senior Member


Joined: Apr 22, 2003
Posts: 238

Hi,

On my workstation I started devf-ram driver with the following parameters:
# devf-ram -s0,8M,,,64k,2,1 &

After format (with 1024k limit)

# flashctl -p /dev/fs0p0 -l1M -e -f -n /flash -m -v
...

the 'df' utility reports that my partition has 960k (1024k -64k).

Where this "one block" difference come from ?
Is this block required for flash file system internal usage ?

Regards,
Jacek
 
 View user's profile Send private message  
Reply with quote Back to top
Mario Charest
Post subject: Re: Where is one block ?  PostPosted: Apr 19, 2006 - 05:18 PM
Guest





"Jacek Rudnicki" <jacek.rudnicki@quantum.com.pl> wrote in message
news:e25dvm$9e3$1@inn.qnx.com...
Quote:
Hi,

On my workstation I started devf-ram driver with the following parameters:
# devf-ram -s0,8M,,,64k,2,1 &

After format (with 1024k limit)

# flashctl -p /dev/fs0p0 -l1M -e -f -n /flash -m -v
...

the 'df' utility reports that my partition has 960k (1024k -64k).

Where this "one block" difference come from ?
Is this block required for flash file system internal usage ?


Yes that's the space block, for moving stuff around. That the price to pay
for having a ram disk build on top of a flash file system architecture. I
don't think you can set it to 0


Quote:
Regards,
Jacek


 
   
Reply with quote Back to top
jacus
Post subject: Re: Where is one block ?  PostPosted: Apr 20, 2006 - 08:40 AM
Senior Member


Joined: Apr 22, 2003
Posts: 238

Quote:
Yes that's the space block, for moving stuff around. That the price to pay
for having a ram disk build on top of a flash file system architecture. I
don't think you can set it to 0

This block is missing even on the real target running custom devf-* flash
driver.
Where can I find some more information about that ?

Jacek
 
 View user's profile Send private message  
Reply with quote Back to top
Dave Green
Post subject: Re: Where is one block ?  PostPosted: Apr 20, 2006 - 01:05 PM
Guest





Jacek Rudnicki <jacek.rudnicki@quantum.com.pl> wrote:
Quote:
Yes that's the space block, for moving stuff around. That the price to pay
for having a ram disk build on top of a flash file system architecture. I
don't think you can set it to 0

This block is missing even on the real target running custom devf-* flash
driver.
Where can I find some more information about that ?

Jacek

NOR flash, when erased, has all bits set to 1. A bit can transition from 1 to 0,
but the only way that a bit can transition from 0 back to 1 is to erase an entire
block of flash. The block size is defined by the flash specification for a particular
part, typically 64k or 128k. Interleaving flash will also increase the block size. For
example, two 8 bit flash parts, each with a 64k block size, and interleaved together,
will have a 16 bit bus width, and a 128k erase block size.

Because flash bits can only transition from 1 to 0 under normal circumstances, once
a file is written to a particular area of flash, it cannot be changed or overwritten.
For that to happen, it must be moved to a different area of the flash, which has not
yet had any of its 1's changed to 0's. As a result, the filesystem must keep at least
one block 'spare', so that when the filesystem fills up, and 'stale' areas of the flash
need to be reclaimed, the valid files can be copied out of the partially used blocks,
and into the erase block. Then, the invalid blocks can be erased, space is reclaimed,
and some other block now becomes the erase block. This is all taken care of by the
flash filesystem, without the user needing to worry about it. Reclaim operations can
also be forced with the -r option to flashctl.

It is possible to specify that a flash filesystem will have no erase block (making it
read-only). You can use the -s 0 option to flashctl, or if you're using mkefs to
generate your flash filesystem, you can specify spare_blocks=0 in the efs build file.


--

David Green (dgreen@qnx.com)
QNX Software Systems Ltd.
http://www.qnx.com
 
   
Reply with quote Back to top
jacus
Post subject: Re: Where is one block ?  PostPosted: Apr 21, 2006 - 07:48 AM
Senior Member


Joined: Apr 22, 2003
Posts: 238

Thank's Dave,

Jacek

Użytkownik "Dave Green" <dgreen@qnx.com> napisał w wiadomości
news:e280vh$2lp$1@inn.qnx.com...
Quote:
Jacek Rudnicki <jacek.rudnicki@quantum.com.pl> wrote:
Yes that's the space block, for moving stuff around. That the price to
pay
for having a ram disk build on top of a flash file system architecture.
I
don't think you can set it to 0

This block is missing even on the real target running custom devf-* flash
driver.
Where can I find some more information about that ?

Jacek

NOR flash, when erased, has all bits set to 1. A bit can transition from 1
to 0,
but the only way that a bit can transition from 0 back to 1 is to erase an
entire
block of flash. The block size is defined by the flash specification for a
particular
part, typically 64k or 128k. Interleaving flash will also increase the
block size. For
example, two 8 bit flash parts, each with a 64k block size, and
interleaved together,
will have a 16 bit bus width, and a 128k erase block size.

Because flash bits can only transition from 1 to 0 under normal
circumstances, once
a file is written to a particular area of flash, it cannot be changed or
overwritten.
For that to happen, it must be moved to a different area of the flash,
which has not
yet had any of its 1's changed to 0's. As a result, the filesystem must
keep at least
one block 'spare', so that when the filesystem fills up, and 'stale' areas
of the flash
need to be reclaimed, the valid files can be copied out of the partially
used blocks,
and into the erase block. Then, the invalid blocks can be erased, space is
reclaimed,
and some other block now becomes the erase block. This is all taken care
of by the
flash filesystem, without the user needing to worry about it. Reclaim
operations can
also be forced with the -r option to flashctl.

It is possible to specify that a flash filesystem will have no erase block
(making it
read-only). You can use the -s 0 option to flashctl, or if you're using
mkefs to
generate your flash filesystem, you can specify spare_blocks=0 in the efs
build file.


--

David Green (dgreen@qnx.com)
QNX Software Systems Ltd.
http://www.qnx.com
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group
Credits
All logos and trademarks in this site are property of their respective owners. The comments are property of their posters.
Powered by OpenQNX: The QNX Community Portal Site
QNX and the QNX logo are registered trademarks of QNX Software Systems.