Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I also realized a few years ago that the physical switch on the sdcard is just a marker of intention. Hardware as well as software can just ignore it.


I'm having trouble making my software ignore it. What command would write to the card when it has the write lock set?


If you're on top of an OS, I can't say (depends on the OS)... but reading the switch is the responsibility of the reader, not the card. The card has no idea if it's write-protected (by the switch mechanism) or not. [1]

Just using the same SPI operations you always use for write should work fine. There's not even a lock-status register or anything to check/clear first for the switch mechanism.

https://superuser.com/questions/354473/is-the-lock-mechanism...


On linux you can use hdparm to switch the readonly boolean.

On other OS I don't know but there is surely a way.


Interesting, I'll try that next time, thanks!


Perhaps it's not within the capabilities provided by the OS or the driver, because they're "well behaved", but the position of the switch is in essence a boolean sent to the host device and not a barrier to electrical signals that would write data.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: