X86 memory segmentation: Difference between revisions

Content deleted Content added
Real mode: tone down, deconflict; was self-contradictory. I'm still not happy with this. I have now realised (d'oh!) that the edit summary of the Joh edit that sucked me in contains a glaring misunderstanding, at odds with the A20, etc. stuff further down below. Also, what was deduced from that misunderstanding was arguably OR. I will likely revisit. This isn't even my final form.
Line 57:
286 protected mode was seldom used as it would have excluded the large body of users with 8086/88 machines. Moreover, it still necessitated dividing memory into 64k segments like was done in real mode. This limitation can be worked around on 32-bit CPUs which permit the use of memory pointers greater than 64k in size, however as the Segment Limit field is only 24-bit long, the maximum segment size that can be created is 16MB (although paging can be used to allocate more memory, no individual segment may exceed 16MB). This method was commonly used on Windows 3.x applications to produce a flat memory space, although as the OS itself was still 16-bit, API calls could not be made with 32-bit instructions. Thus, it was still necessary to place all code that performs API calls in 64k segments.
 
Once 286 protected mode is invoked, it could not normally be exited except by performing a hardware reset. Machines following the rising [[IBM PC/AT]] standard could feign a reset to the CPU via the standardised keyboard controller, but this was significantly sluggish. Windows 3.x worked around both of these problems by intentionally triggering a [[triple fault]] in the interrupt-handling mechanisms of the CPU, which would cause the CPU to drop back into real mode, nearly instantly.<ref>{{Cite web|url=http://blogs.msdn.com/b/larryosterman/archive/2005/02/08/369243.aspx|title = DevBlogs}}</ref>
 
=== Detailed segmentation unit workflow ===