FSRW: Walk Right Back (seek, and ye shall find)
rokicki
Posts: 1,000
Read seek is now supported! So now we have very fast I/O including read-ahead and write-behind,
multiple file support, FAT32/FAT16, SD and SDHC, and seek. What more could anyone want.
This is a release candidate. If no one finds any showstopper problems, we will release this code to
the object exchange next week.
multiple file support, FAT32/FAT16, SD and SDHC, and seek. What more could anyone want.
This is a release candidate. If no one finds any showstopper problems, we will release this code to
the object exchange next week.
zip
50K
Comments
Directory support? [noparse];)[/noparse]
Thanks Rokicki for all your efforts on this! This is a great release!
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
But, since you did ask... The only feature I can think of is a disk free space function (i.e., how many bytes are free on the card).
Is that hard?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
Not to say that you are the only person to give total praise too.....but dang.....i am very impressed at the FSRW object.
Other than long file names (I understand the issue)......you have just about covered anything (and actually more) than I can ever see needing at this point. I know at some point I will want more......typical human response.
You and the helpers (sorry don't know everyone) deserve a huge pat on the back.
James L
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
James L
Partner/Designer
Lil Brother SMT Assembly Services
Please note: Due to economic conditions the light at the end of the tunnel will be turned off until further notice. Thanks for your understanding.
It's simply... you're the best !!
I vote for you, to have a special place & gift, in the new prop contest.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards.
Alberto.
Would it be easier to navigate to a fixed directory name? (Like \BIN for example)
Maybe that's easier?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Composite NTSC sprite driver: Forum
NTSC & PAL driver templates: ObEx Forum
OnePinTVText driver: ObEx Forum
Perhaps it is something I have/have not done. What I am wanting to do, is after I locate the files I am interested in - I locate the first sector of each file - I use the block driver to read each sector directly using the low level sector address. However, it fails. I posted a simplified example of this.
Any help or suggestions would be appreciated.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade, RetroBlade,·TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
Maybe I'll get some time during midsemester break somewhere in october.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Have I posted a picture recently of why I'm busy? Well, this is as good an excuse as any [noparse][[/noparse]8^)
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lonesock
Piranha are people too.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·
They do take a lot of time, but it's quality time.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
I do have one suggestion - why not give users access to set the file date? This can be really handy for managing files when a whole bunch of files have been generated on the SD card.
A minimal change to allow this is trivial -
Instead of having a fixed method "pdate" that returns a default date, define a variable "pdate" initialized to the generated default date:
DAT
pdate long (((2009-1980) << 25) + (1 << 21) + (27 << 16) + (7 << 11))
and provide a public method users can call to override the default:
pub setdate(newdate)
pdate := newdate
I'm using the older FSRW in my GPS data logger where I made a mod like this, and it's really handy, especially as GPS provides the current date and time.
This does require users to know how to generate a FAT16 timestamp.
If someone wanted to write a method to accept YYYY-MM-DD HH:MM:SS or something and convert that into a FAT16 timestamp, that would be even better. But this change would allow immediate access to the date.
variables as int, so we're not parsing a string); anyone not using it can comment it out.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade, RetroBlade,·TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lonesock
Piranha are people too.
BTW In case you try the femto version, I removed the initialise line so it does not work.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade, RetroBlade,·TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
However, it may be a bug. The file I am trying to read is only 256 bytes long. Is this legal ???
The problem is that once I open the file (which works) I try to find out it's first sector address (which fails) and also I try to find out it's length (which fails). I do not try to read the file, although this also fails. On each call (tried individually) the code (driver) fails to return and hence locks.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade, RetroBlade,·TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
Now, I still do not have read/write block working - this still locks (does not return). Still investigating.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade, RetroBlade,·TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade, RetroBlade,·TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lonesock
Piranha are people too.
Thanks,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards.
Alberto.
One question for you guys:
Are the units of the test results kBytes/second or kBits/second?
As I understand it kB is supposed to be kBytes and kb is kbits...
Just want to make sure... Thanks.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards.
Alberto.
She's just adorable!
Sitting there grinning in her cute little romper
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Where am I? Where am I going? Why am I in a handbasket?"
Good for you to get it working!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
www.sdcard.org/developers/tech/sdcard/pls/ - the Simplified Physical Layer Spec. This one is as official as you can get, but leaves out lots of interesting information. However this one should be the final word, if you find discrepancies with other specs.
Next, Google "ProdManRS-MMCv1.3.pdf". This is the spec from SanDisk for the older MMC cards. There are some differences between SD and MMC, but for SPI mode they are very similar. And, most importantly, this document shows waveform timing diagrams for the SPI mode. SanDisk seems to have pulled it from their server, so I'm attaching a copy.
elm-chan.org/docs/mmc/mmc_e.html is a very good concise overview. There is also some code in the FATFS source that controls the SD card in SPI mode, but I think it's platform dependent (look for a PIC version, IIRC).
Unfortunately, there is no example code for using multiblock mode, but only sending one block at a time. All the multiblock examples (and there are fewer than single block mode examples) open the multiblock transfer...send down all the data at once, then close the multiblock mode. So the latest code from FSRW may be the only example of how to use multiblock mode to increase speed, but still have a very small buffer for doing the data transfer. A portion of the 30-odd cards we tested, however, do not re-initialize gracefully if they were suspended in a multiblock transfer. For this reason we auto release the card after a short timeout. Also, closing a file will explicitly release the card. Calling umount will also release the card. You can also manually call release. The release call is blocking, so after you call release you can power down or eject the card. The block driver is a state machine, so it will automatically re-establish the proper multiblock read or write mode as needed.
We also added the read-ahead and write-behind code to increase throughout. When you write a data block, the data is copied into a cog buffer, then written to the card in the driver cog, freeing the calling cog as soon as the 512-byte transfer to the cog buffer is done. We use rdlong for speed, so the buffers must be long aligned. Another write request will wait until any previous write is done before copying in the next data block. Since we are using multiblock mode, sequential writes automatically gain speed. Read-ahead is similar, in that if you ask for a block to be read, we will read the block into a cog buffer, then pass it back out to you. We then immediately request the next sequential block from the SD card and read it into the cog buffer. If the next block from the calling layer happens to be a read request for the next sequential block (and it typically is), the data is already in the buffer, so it gets copied out (using wrlong for speed), and the process repeats.
I think that's about it. Let me know if you have any questions or if the code is unclear.
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lonesock
Piranha are people too.
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lonesock
Piranha are people too.
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lonesock
Piranha are people too.