FRAMs are nonvolatile devices with true random access: they have no concept of pages. Consequently the block size in the ioctl is arbitrary. Currently I use 512 bytes which has worked with FAT. Is there any size which is optimum in terms of performance or RAM usage? The device driver doesn't "know" what filesystem is to be used so the block size must not cause FAT to croak.
I also have drivers for EEPROM chips. As an alternative to filesystem usage the drivers allow single or multiple devices to be addressed as arrays of bytes using slice syntax. This means that if someone writes, with an arbitrary value of addr,
Code: Select all
data = b'the quick brown fox'
device[addr:addr + len(data)] = data
To gain the benefit of wear levelling it would seem prudent that the block size in the ioctl should be related to the physical block size: in the chips I use this is 128 or 256 bytes so I guess that an integer multiple of these would be wise.
Any recommendations?