kerravon wrote:linguofreak wrote:
I wonder if one could port OpenWatcom or something: having roots in the segmented x86 era, it knows how to deal with non-flat addressing...
I'm not familiar with access registers, but I am familiar with normal S/370 code and also 8086 code.
SubC is getting some work done on it, and supports 8086. Although only small memory model so maybe that doesn't count?
For what reason do you want non-flat addressing?
So ESA/390 and zArchitecture have "access registers" that allow a program to access multiple address spaces at the same time. It's kind of like x86 protected-mode segmentation, except that:
1) Unlike x86 segmentation, the address spaces are paged address spaces, not base+offset segments
2) The way the equivalents to the segment descriptor tables are defined, it's equivalent to the situation on x86 if programs couldn't load segments directly from the GDT, and if there was an extra LDT (let's call it LDT2), and if loading a new segment into CS caused an automatic LDT1 switch, while loading a new segment into SS caused an automatic LDT2 switch.
So why is this significant?
1) is just more performant than x86 segmentation if you want non-flat addressing.
But why do you want non-flat addressing? This is where 2) comes in:
Non-flat addressing by itself doesn't get you anything, but implementing it as in 2) turns your "segments" into
capabilities at a granularity that I think is a lot more workable than other capability architectures I've seen (a lot of capability architectures try to do it at per-pointer granularity, which I think adds too much overhead.
But why do you want capabilities?
My opinion is that, if implemented in hardware at appropriate granularity, they're the secret to a really performant microkernel.
This post in
this thread outlines why I think the typical "every OS service in its own process" microkernel model is suboptimal, and a z/Architecture-style address-spaces-as-capabilities model is what I allude to when I say "There are ways hardware could be designed to allow services to still be called as libraries while isolating them not only from userspace but from each other, but such designs are not currently common."
Without having a good understanding of how the z/Architecture access register feature worked, I spent a number of years pondering why flat address spaces aren't good for microkernels, why x86 segmentation doesn't solve that problem, and what changes to x86 segmentation would be necessary to solve it (or, in general, what sort of MMU architecture would solve it). I eventually arrived at something that seemed to solve all the issues, and some time later I actually read through the sections of the z/Architecture principles of operation relevant to the access register mechanism, and found that it was quite close to what I had thought up.
So now, knowing that there's an architecture out there that has the sort of MMU I want, it would be really nice to find a non-proprietary HLL compiler that could make use of it.