Code/Data separation with paging

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
Barratator
Posts: 2
Joined: Fri Nov 15, 2013 2:21 pm

Code/Data separation with paging

Post 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
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Re: Code/Data separation with paging

Post 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.
Barratator
Posts: 2
Joined: Fri Nov 15, 2013 2:21 pm

Re: Code/Data separation with paging

Post by Barratator »

Good to know.

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


Regards,
Bastian
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Re: Code/Data separation with paging

Post 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.
Post Reply