Hi Mat, thanks for your explanations
2011/4/21 mattschinkel <[email protected]> > From my lib: > address = address * 512 -- make sd card sector addressable, sd cards > are normally byte addressable. > > My comment is not completely true. SD Cards ARE normally byte > addressable, but for fat32 and PC's, there is never a need to start in > the middle of a 512 byte chunk and end in the middle of the next. > > For example, you could start a read at byte 256 of the sd card, and > end at byte 512 + 256 (which is 512 bytes read total) > OK, I now understand but... > > FAT32 and PC's assume the first sector starts at byte 0 and the next > sector is at byte 512 > ... this means sd_card is "infected" (no offense :)) with FAT32 concerns. Not a big deal in this case (start at 0, assume next is at 512), because filesystems blocks are mutiple of 512. But if there's something more FAT32-specific, it should be removed to be as generic as possible, so other can build on top of it without finding weird workaround. AFAIK there's currently no such case ! > My conclusion: > You can start reading or writing a block from anywhere, but have to > read/write an entire block, default block size is 512 (one sector). > I'm not sure if there's another way to read/write other then block > mode. We could improve the library by looking into this or to set a > block size of 1 byte and add a constant for the user. > But you can actually read byte-by-byte, using sd_data_byte pseudo-var ? You don't necessarily have to deal with a 512-bytes buffer. > > 512 should stay default, byte reads/writes may not work at all on high > capacity SD memory cards. I don't think I tried any high capacity > cards yet with this lib. > I remember some were having troubles with 4GB, which I think is classified High Capacity. Maybe there's something wrong with HC and the lib ? > > Filesystems usually assume sectors are 512 bytes. From what I > understand, hard disks always use 512 byte sectors. Hard disks have a > read/write buffer that is 512 bytes. > Hard-disk may have 512 buffer, but lot all filesystems assume 512. I'd even say 512 is quite small for a filesystem ! Minix for instance defaults to 1K. I can be set higher to 2K, 4K. The higher the easier it is to index (that's why I said 512 seems very small). > > I would have to ask the user: why not just use 23k256 instead of sd > card for byte reads/writes? > Because of yet another part ? And because it's RAM ? (I mean, it's volatile, right ?) Cheers, Seb -- You received this message because you are subscribed to the Google Groups "jallib" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jallib?hl=en.
