When enabling the write lock on the side of an SD card, is the write protection a physical limit on the SD card, or a flag sent to the reader or OS telling it to please not write?
Citing from Wikipedia (emphasis mine):
The user can designate most full-size SD cards as read-only by use of a sliding tab that covers a notch in the card. (The miniSD and microSD formats do not support a write protection notch.)
The presence of a notch, and the presence and position of a tab, have no effect on the SD card's operation. A host device that supports write protection should refuse to write to an SD card that is designated read-only in this way. Some host devices do not support write protection, which is an optional feature of the SD specification. Drivers and devices that do obey a read-only indication may give the user a way to override it.
Cards sold with content which must not be altered are permanently marked read-only by having a notch and no sliding tab.
Moreover, the SD card simplified specifications (physical layer) read:
4.3.6 Write Protect Management
Three write protect methods are supported in the SD Memory Card as follows:
- Mechanical write protect switch (Host responsibility only)
- Card internal write protect (Card's responsibility)
- Password protection card lock operation.
• Mechanical Write Protect Switch
A mechanical sliding tablet on the side of the card (refer to the Part 1 Standard Size SD Card Mechanical Addendum) will be used by the user to indicate that a given card is write protected or not. If the sliding tablet is positioned in such a way that the window is open it means that the card is write protected. If the window is close the card is not write-protected. A proper, matched, switch on the socket side will indicate to the host that the card is write-protected or not. It is the responsibility of the host to protect the card. The position of the write protect switch is unknown to the internal circuitry of the card.
The sliding plastic part activates a switch in the SD card socket when the card is inserted. The OS will read the switch's state.
It would be possible to create a card without the dent so it is always writeable, or without the sliding part so the card is always read only; similarly cut or bridge the switch's output to force all cards inserted into the socket to be either writeable or read-only.
It's a switch in the slot that is no longer depressed, whose status can be detected from the WP pin that not all breakout boards provide access to. It is up to the card controller to detect it and signal up the chain appropriately.