JoeKayzA
As for the initial capabilities, I wanted to implement the concept of constructors here. A constructor resideds either in the kernel, or another process, and is used to generate a new process - create the address space, create the initial thread(s), map code files into the address space, and hand the initial capabilities to the process. Which capabilities these are depends on the role of the process, and on the privileges. I think this concept is quite flexible, yet straight forward.
This way different binary formats can be handled and even different OS subsystems (implementing Win32, Linux, etc. - not necessarily interface-oriented - custom syscall handling can be plugged in - think Wine, how about running Win32 apps on your brand new OS from the start?).
So you can easily restrict a process' activity by placing only a specific set of objects in the namespace(s) which it has access to.
Exactly.
A process having an "environment" (initial or available capabilities) - what it is given to work with. For example, a GUI, an isolated Filesystem or Storage to keep settings, maybe a selected file to work with... If that can be restricted (no way to get outside of the box), security can be pretty much assured.
(not my original idea - this concept has been discussed before and generally agreed upon)
Does a screensaver need access to the root filesystem and network? All it needs is a preexisting screen canvas to draw upon..
btw,
I've not yet made up my mind about how to do those interface identifiers, however. (Somehow I'm not comfortable with the GUID-thing either)
What's uncomfortable about GUIDs?
There have been long flames where it has been concluded that:
GUIDs:
-are not 100% guaranteed to be unique ( but unique enough, IMO)
-are not human-readable and ugly to work with
-don't contain any hint as to the nature of the thing being named
Namespaces:
-are more flexible (for example, they can wrap GUIDs)
-provide a hint about the nature of the object they refer to
But, on the other hand,
GUIDs:
-are simple - "generate and forget",
-fixed-size - no need to handle potentially unbounded strings
-database is flat, unlike hierarchical namespaces.
Namespaces and names:
-have to be invented, managed, eventually will become crowded and will need to be redesigned
-have greater risk of collisions for independently created objects.
(anything I missed?)
anyway,
new capabilities are obtained through naming directories, which can be arranged in a hierarchical manner - much like J2EE's JNDI, but system-wide.
or it may be possible to use either or both (names and GUIDs) at the same time..
--
(about IString) I don't know if the component system should really go _that_ deep. I mean, referencing a string by an interface sounds to me like overkill, at least. Or did I misunderstand the example?
You understood correctly
I just mentioned that as an arbitrary example. It may be an overkill, I dunno.
I've been using COM strings (the horror) from the beginning, though, and it hasn't caused much trouble so far, only the benefits:
- you can't overflow a well-tested IString, try as you might;
- different implementations can be used for different usage patterns..
Also, in Java, strings are proper objects, just like everything else..
But I don't want to make much of a point here. Just an example.
--
p.s. post collision
Crazed123:
(about strings) yes, indeed.