Disk controller should honor img_readonly (write-protect gate) #24
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The MiSTer
hps_iomodule provides animg_readonlysignal that indicates when a mounted disk image should be treated as read-only. Currentlydisk.svdoes not check this flag -- write commands are accepted unconditionally, and theWRPROTbit inDSK_STAT(bit 5) is never set.What should happen:
SBC7.svandsbc7_top.svshould wireimg_readonlythrough to the disk controller.disk.svshould latch the read-only flag per drive (alongsidedisk_present) onimg_mountedevents.ERRORandWRPROTstatus bits, and complete immediately without issuingsd_wr.DSK_STATregister already reserves bit 5 forWRPROT-- it just needs to be driven.Risk: Without the gate, writing to a read-only-mounted image silently writes through to the SD card, which could corrupt images the user intended to protect.
Disk controller should honour img_readonly (write-protect gate)to Disk controller should honor img_readonly (write-protect gate)