Hi! I have a question.... In x86 processor memory protection is made using the PMode but if I want to realize a form of memory protection with a processor which doesn't have a specific hardware function how I have to do? The problem starts when I want to port an OS to another processor different from the x86 familiy, I don't know how to do it.
Thank you for the answer.
Bye
PMode and porting...
RE:PMode and porting...
which processor is that?
anyway: i think it is *not* possible. i have no idea how you would prevent a program from doing what it wants to do. a little idea is to analyze the code of a program before it is loaded, but this is not really possible...
anyway: i think it is *not* possible. i have no idea how you would prevent a program from doing what it wants to do. a little idea is to analyze the code of a program before it is loaded, but this is not really possible...
RE:PMode and porting...
You would have to implement a vm for each of the programs, and your own software-based protection model. Of course, this would be really slow.
RE:PMode and porting...
Any modern processor has a mechanism for protection.
You'd have to rewrite the initialization routines to enter/enable this protection scheme, but it will almost always be there.
Most architectures employ a system similar to Intel's pager. You can aggregate memory into pages, and asign access permissions to them, as well as swap them to/from a mass storage system.
So... for ease of porting, I would recommend utilizing the pager on Intel architectures and staying away from segmentation (a system which is NOT employed on many other architectures). That'll help ease in porting, but... like I said, I'm sure you'll have to rewrite a substantial portion now-matter-what.
Hope this helps,
Jeff
You'd have to rewrite the initialization routines to enter/enable this protection scheme, but it will almost always be there.
Most architectures employ a system similar to Intel's pager. You can aggregate memory into pages, and asign access permissions to them, as well as swap them to/from a mass storage system.
So... for ease of porting, I would recommend utilizing the pager on Intel architectures and staying away from segmentation (a system which is NOT employed on many other architectures). That'll help ease in porting, but... like I said, I'm sure you'll have to rewrite a substantial portion now-matter-what.
Hope this helps,
Jeff
RE:PMode and porting...
On the contrary, any modern _desktop_ processor has protection mechanisms built in (an MMU), but many embedded or special-purpose processors might not. These things still need OSes. Also, if the only software you want to be able to run will be inside a Java-style software-based VM, it would be redundant (and slower) to utilize the MMU features. However, if you are using such a processor, you probably are doing so because they are simpler, and adding the complexity back in software would be counter-productive.
However, for what I suspect this person is pondering, I agree with what carbonBased said. For most desktop operating system, you will just have to rewrite the code to deal with the MMU.
However, for what I suspect this person is pondering, I agree with what carbonBased said. For most desktop operating system, you will just have to rewrite the code to deal with the MMU.
RE:PMode and porting...
Its all already been done. Linux. Supported on every major architecture around. Hell, it will even work on xbox and Macs.
All thats required is correct layering of the memory mechanisms so that you can easily use the same kernel on all architectures but with a different memory protection layer for each architecture.
Your entire kernel doesnt need to know how memory is organised, just as long as it can be accessed when its needed.
Moose.
All thats required is correct layering of the memory mechanisms so that you can easily use the same kernel on all architectures but with a different memory protection layer for each architecture.
Your entire kernel doesnt need to know how memory is organised, just as long as it can be accessed when its needed.
Moose.