If I have something like:
const y2k = 2000;
Or:
.rodata
y2k:
.long 2000
How does an actual computer handle this being read-only (and not, for example const volatile)? Is this done at the memory level, such that it's placed into a read-only section of memory? Or is this done at the OS-level, in that those memory segments are 'protected'? The CPU? Or how exactly is read-only handled (at a high level) today?