Page 1 of 1

Abt Mem mgmt model selection

Posted: Thu Jan 27, 2005 12:00 am
by kan
hi,
i m a bit confused about which memory model should i use in my OS.
My OS is just in design stage, Two options which i have are
1)Protected Mode Flat Memory model
2)Multisegment model.

According to what i have read in Intel manuals Multiseg model is more safer and robust, as i gives hardware protection(though a bit complicated).

On other hand Flat model is a bit easier but (i think) is not as robust as the previous one?

But it seems by using 'paging' even flat model can become safer and robust?

But i reallly want to experiment with Multiseg model, but the thing is that gcc
doesn't support Multiseg model it just support flat model!!!!
Is it so?????????

What do u think which mem model is the best for security ?????
And which C compiler should i use for the same?

Re: Abt Mem mgmt model selection

Posted: Sat Jan 29, 2005 12:00 am
by [AlAdDiN]
The compiler have nothing to do with the memory model, I'm using multiseg model with gcc...

multiseg model is more robust and s?cure because lot of inter-process protections are managed by hardware

in flat mode you have to manage all protections and ensure that one process can't access to other process' memory areas

paging can be used to add another protection level but once again multiseg+paging is better than flat+paging

now, it's up to u to choose witch model will be the best for your OS, and if you use paging, u can start with flat model then switch to multiseg model at any moment without breaking ur OS (but this depend on the flexibility of your paging system)

Re: Abt Mem mgmt model selection

Posted: Sat Jan 29, 2005 12:00 am
by Legend
Since the NX-bit in paging, you can do everything secure with paging.
Without the NX-bit you had to use segmentation to create areas that are not executable.
But you have to take care of everything basically yourself, by managing the page directories correctly. Then it should be equivalent in security.