rdos wrote:
Brendan wrote:
Wrong. You're ignoring all of the things that make segmentation bad (memory mapped files, swap space, physical address space de-fragmentation, etc) and focusing on a few negligible things in a deluded attempt at pretending segmentation doesn't suck badly.
Using paging to support those is ancient (70s?)
1. Memory mapped files - no reason why this cannot be implemented without paging
So when I memory map a 4TB file... you are proposing to try and allocate 4TB of physical memory?
I think neither of us have a machine capable of that
rdos wrote:
2. Swap space - you simply do not support such ancient constructs
OK, no swap space. What about paging out of unmodified file mappings (such as executable code)? Note that many programs contain considerable quantities of initialization code which can safely be discarded after startup
rdos wrote:
3. Physical address defragmentation - not much of a problem when computers have many GB of memory.
Still very much a problem. When my system has 7 of 8GB of RAM used, how much contiguous RAM do you think the operating system will be able to find? Hint: Probably chunks of no more than 1MB.
This is clearly useless if I want to allocate more than 1MB. For example, my application wants to create a full screen window and therefore would like a 1920x1080 framebuffer (~10MB)
rdos wrote:
Brendan wrote:
Wrong. In fact it's the exact opposite - OSs use segmentation for backward compatibility, and inevitably break compatibility to remove segmentation in later versions (once they realise the pain of keeping it is worse than the pain of breaking compatibility).
Not so, popular OS designs (UNIX-compability) requires paging as the whole concept is constructed on top of paging.
You may find hints of the exact opposite in the fact that the signal UNIX sends a process for most memory faults is SIGSEGV -
segmentation violation. Its' just that the early machines had different notions of segments (and no notions of paging). Indeed, the
vfork(2) system call was introduced in order to make the fork/exec paradigm efficient on such machines (because otherwise you had to copy the entire process' memory in order to discard it immediately after)