SAS vs. MAS

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
RicoSanchez

SAS vs. MAS

Post by RicoSanchez »

Hey,

I've been looking into single address space and multiple address space (from now on called SAS and MAS) concepts for operating system development.

I started osdev with the idea of SAS in mind, mainly because it's easier to implement. A couple of days ago checked more into SAS and MAS again and got a new list of pros and cons.

The pros of a SAS is that you only have a single address space where all the applications and also the kernel lives in. This makes development much easier so you don't have to care much about switching address spaces and neither care much about IPC because you can directly call other process' code.

The cons of a SAS is the missing protection you get if you used a MAS. In a MAS every process has it's own address space and can't fool around in the address space of another process. Another con of a SAS is that all processes are limited by their memory use of the cumulative use of all processes. This isn't the case with a MAS where a process always has the full 4 GB address space available (on x86) except for the kernel area and the libraries used by the process.

Neither in a SAS or a MAS userland processes can't access the kernel code and data directly because that is protected by usermode and kernelmode and the paging flags for usermode and kernelmode access.

Looking at this list of pros and cons it seems that a MAS is much better, mostly because of the level of protection it gives. Systems like Linux and Windows need this protection. A SAS for those systems is just flawed since every process can **** up every other process that way.

Though there are some hobby OS projects around which use a SAS, those are UUU and Brix. UUU assumes that all code is friendly and doesn't do any damage. Brix adds the protection that a SAS misses (compared to a MAS) by it's intermediate bytecode (or whatever brix uses for this). The intermediate bytecode prevents access to random memory and stuff like that so processes can't fool around with the system because it's limited by the bytecode.

My idea is also to use a bytecode system of some sort, but I'm still not sure if I would use SAS or MAS. I get the protection from a completely different part (actually, this protection could be called pre-loaded protection, whereas the protection you get from a MAS is runtime protection) and the idea of pre-loaded protection sounds nice, I don't know if I can give the same level of protection a MAS can give. And also the idea of The bigger address space a MAS gives you.

What are your ideas on this proposal? And also your opinions on what you use for your os even though it doesn't use some kind of bytecode system. I'd really like to hear of you.


Maybe it's possible to transparently add support for both a SAS as well as a MAS with the same bytecode system. I'll keep this topic for a later discussion.

Dax.
User avatar
df
Member
Member
Posts: 1076
Joined: Fri Oct 22, 2004 11:00 pm
Contact:

Re:SAS vs. MAS

Post by df »

you cah use 'SAS' on x86 with protection. setting base/limit etc in GDT and user x86 mmu protections.
-- Stu --
Post Reply