Hi,
AnalogChipDesigner wrote:
So I you said it doesn't because it could be compiled to the 8086. And you said minix 2 uses segmentation.
How does segmentation work in terms of processes? Each process has a list of segments that it has access to?
For 8086 and 80186, unfortunately not. There was no protection, everything has full access to all segments, and the only thing segments do is effect physical address generation. Specifically, "physical address = segment << 4 + offset" was used so that a pair of 16-bit values can access 1 MiB of physical address space.
For later CPUs (starting with 80286) segmentation got extended to support protection and different segment sizes - the old "segment numbers" got recycled as indexes into tables, where the table provides the base address, limit and attributes for the segment. For that case there's multiple models - a process could have a few segments (e.g. one for code, one for data, one for stack), or a process could use many segments (e.g. one for each separate piece of memory allocated), etc.
AnalogChipDesigner wrote:
And the OS keeps track of what process has access to what segments, and keeps a list of this in memory ? So if I support segmentation in my system, then Minix could use the segments to manage the processes instead of paging ?
There was no paging until 80386; and almost all OSs that use paging and don't use segmentation. I would assume that this is the same for Minix 2 (that if it's compiled for 80386 it uses paging and doesn't use segments, and if it's compiled for 80186 or 8086 it uses segments and doesn't use paging).
AnalogChipDesigner wrote:
When a process is running, the OS loads the required segments into the segment registers, and when required it changes the segments? Sometimes a process needs to change its segment registers, and it's the OS's task to change them?
Does it really matter? If your CPU (and everything else - PIC, PIT, PS/2 controller, firmware/BIOS, ...) is "100% PC compatible" then your hardware is going to be compatible with OSs that were designed for PC and it won't matter how the OS uses things like segments; and if your CPU is not compatible then you're going to have to modify/port (or write) a compiler and an operating systems to make them work and it won't matter how the OS used things like segments on 80x86 (or 680000 or SPARC, which were also supported by different versions of MINIX and had very different memory management).
Cheers,
Brendan