Page 1 of 1

Code/Data separation with paging

Posted: Fri Nov 15, 2013 2:29 pm
by Barratator
Hi there,

is there any possibility to separate code and data with paging in Protected Mode (32 Bit)?
I cannot find any way to set the "content type" of a page.

And in nearly every documentation I read segmentation is deprecated. But how does Linux or Windows separate code and data (or don't they do that?) to get a protection fault e.g. when you try to execute from data section?


Thanks!

Bastian

Re: Code/Data separation with paging

Posted: Fri Nov 15, 2013 2:44 pm
by jnc100
Barratator wrote:protection fault e.g. when you try to execute from data section?
http://en.wikipedia.org/wiki/NX_bit

Regards,
John.

Re: Code/Data separation with paging

Posted: Fri Nov 15, 2013 3:01 pm
by Barratator
Good to know.

But this is not available for Protected Mode in 32bit.


Regards,
Bastian

Re: Code/Data separation with paging

Posted: Fri Nov 15, 2013 3:09 pm
by jnc100
Its available with PAE. Microsoft has used this method since Windows XP SP2. There is no available protection against executing code from a 'data segment' with plain 32-bit paging (without segmentation).

Regards,
John.