19 Jan
2003
19 Jan
'03
09:53
"Carlos E. R."
If I'm not mistaken, intel 386 processors and up do have that kind of protection available, by marking the code segment as read only. I think that faults of this kind caused many programs in windows to be stopped by the system, with an error like segment violation, or something similar.
While the i286 and later do have this protection but you also have to make the stack non-executable, but it is almost never used (the only OS I have seen which uses it was Digital Research Concurrent DOS/CPM for 80286.) Most current operating systems, including Windows and Linux, run the processor in 'flat' memory mode rather than segmented mode. Which means that areas of memory only have page-level protection not segment level.