5 ms·
Hey Ken, Always enjoy your posts! > The much-reviled solution was to create a 4-megabyte (20-bit) address space consisting of 64K segments, Did you mean 1-me
by moosedev 4y ago
Hey Ken,
Always enjoy your posts!
> The much-reviled solution was to create a 4-megabyte (20-bit) address space consisting of 64K segments,
Did you mean 1-megabyte here? (and again later in the same “paragraph”, pun intended)
- kens 4y agoThanks, I've fixed that.
- zozbot234 4y agoThat solution actually made quite a bit of sense. What was really messy is protected mode in the 80286 where the segment address actually indexes into an indirection table, in order to address 24 bits (16M) of physical address space. But the 8086 had none of that. And the 80386 finally got 32-bit flat addressing in protected mode, enabling modern OS's to be ported.
- userbinator 4y agoThere are 4 segments and which one is being used is presented on the bus interface (S4/S3) so 4MB of total memory is actually possible in an 8086 system, and the 8086 documentation does explicitly mention that as an implementation choice, but I don't think many systems made use of that feature; bank-switching seems to have been more common. The reason being that separating the segments into their own address spaces would create something more like a Harvard architecture, which isn't really wanted in a general-purpose computer.
- moosedev 4y agoThat's interesting - I didn't know that the memory subsystem could "know" which of the 4 segment registers was in use for a given request. With that detail, one could certainly call it a 4MB "address space", albeit even more of a pain to use than the usual 1MB one :-)
- ataylor284_ 4y agoI can see mapping CS to 1MB and DS, ES, and SS all to another 1MB for 2MB as moderately viable. This would make the system a Harvard Architecture instead of a von Neumann, with the escape hatch of segment prefixes. It would be even more of a nightmare to program than the already janky segmented memory model we ended up with, so I'm happy IBM wisely decided to avoid it.
- mrlonglong 4y agoFascinating, never knew that was possible. How would that work in practice? I can easily play with the segment registers to address the full 1 megabyte range but how would I do that to address the other 3 megabytes?
- userbinator 4y agoEach segment register implicitly selects its own address space. Thus you have 1MB of CS, 1MB of DS, 1MB of ES, and 1MB of SS.