Reputation: 37
I know I can mount a block device like SD card by the following command; mount /dev/mmcblk /mnt/SD
Then I can use ls and cp command in the filesystem in SD. I can also execute a file in it.
However, I don't know how to mount a character device like eeprom or nor flash which is controled by I2C or SPI.
I want to make a embedded system that doesn't depend on SD. My goal is to use ls or cp command, and execute some files in such devices like you can do it in SD.
Actually, I made an original I2C driver in which I can open, read and write data through /dev/myi2cdriver. But when I mount that device file, error message appears saying "device is not a block device" and mount fails.
Could you give me advices?
Upvotes: 0
Views: 1370
Reputation: 1908
As you have seen, this isn't intended to work.
You could probably copy /dev/myi2cdriver to a file and mount -o loop
that. You might be able to just mount -o loop
your character device directly.
Alternatively, develop a block device driver?
Upvotes: 1