Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!sun-barr!apple!motcsd!xdos!doug From: doug@xdos.UUCP (Doug Merritt) Newsgroups: comp.sys.amiga.tech Subject: Re: MEMF_PHYSICAL? Message-ID: <367@xdos.UUCP> Date: 1 Jun 89 16:34:06 GMT References: <8906010252.AA11810@jade.berkeley.edu> Reply-To: doug@xdos.UUCP (Doug Merritt) Organization: Hunter Systems, Mountain View CA (Silicon Valley) Lines: 164 On the subject of single address space OS's, Valentin and I have a few disagreements, and I notice that my previous article was rather scathing in tone. Sorry about that, no offense intended. In article <8906010252.AA11810@jade.berkeley.edu> 451061@UOTTAWA.BITNET (Valentin Pepelea) writes: >> > allowed to access each other's memory. The only reason current Minis and >> > Mainframes, give tasks their own address space is because two decades ago, >> > processors could access only a limited amount of ram. (say 64K) Thus for I disagreed, and Valentin said in the early 60's ram was limited even on mainframes. True, but the point is that limited ram is *not* why separate address space support was designed into MMU's and OS's. It was because this was considered to be a feature. Each program thought it owned the whole machine. Again, this is desirable for *most* programs, even on the Amiga, due to the way most programmers write code. Some programs behave very well and take the whole environment into account, but far more do not. >Of course protection was a major reason for implementing memory management. >But what I was discussing was the memory model, not the protection features. >The shortage of ram favorises separate address spaces because it was simpler >to just swap out an entire program and swap another one in, than to muck around There is no particular advantage to having a single address space if protection keeps you from writing outside of it, e.g. to system structures, so the distinction between the protection model and the memory model that you keep making is pointless. It's true that PDP 11 Unix swapping into a tiny address space was desirable because the address space *was* tiny. But note that swapping is still done when necessary on demand paged systems because *physical* ram is always a limited resource. Another strong disadvantage of a single address space model is that it has problems regarding addressing. Let's say I run two programs, say for the purpose of having two copies of the same chess program play against itself. The Amiga simply relocates each copy to a different piece of allocated memory (patches each process to address correctly relative to its load point). But once that's done, each must always reside in that particular piece of physical memory. This puts a severe restriction on virtual memory, since each time one of those tasks is run, the same physical ram must be freed again, which will often mean that whole processes will *have* to be swapped out, while if private address spaces were implemented, then we'd be free to put it anywhere in physical ram we want. Thus by asking for both virtual memory and for a single address space, you end up requiring the swapping that you said was such a bogus feature! Conversely, physical ram is always limited, and so virtual memory *is* desirable to be able to do some things at *all*. Where I work we have an application that requires up to 60 megabytes of RAM. The poor feeble Sun 3/280 server can only support 24Meg of physical RAM. Without virtual memory, we'd be out of business. So if given the opportunity (e.g. a 68020 and an MMU), virtual memory is an absolute requirement. That leaves us with either choosing swapping or private address spaces. For real time programming, the performance advantage of shared address spaces makes them desirable, and hence the single address space model we have on the Amiga is a blessing. It is a mixed blessing nonetheless, since any malfunctioning program can bring down the whole machine. Sometimes this is because it has misused a hardware resource, something that a protected private address space model (adapted to the Amiga's demands) would not prevent. But most of the time it's simple things, like not deallocating memory, or overwriting OS structures with a runaway pointer. These problems simply do not arise on systems with private address spaces, or even on systems with a single address space but each task limited to writing in the memory that belongs to it. We can't (cleanly/simply/fully) introduce such a model to a new rev of the Amiga hw/sw because the system is committed to use of shared memory for message passing and for modification of system structures. Thus, despite the advantages of the Amiga approach, it also has some severe inherent design problems that lead to the machine crashing when some task goes bad. No matter how someone justifies it, this is not desirable, and it is an excellent reason for other systems using private address spaces by default. There are very effective real time systems that do this, and that allow tasks to share address spaces *by special request*, and under controlled circumstances that will not crash the machine. Even the tasks that need inherently dangerous access to hardware resources can be managed by limiting such access to "trusted" tasks, rather than allowing all programs such access, whether they need it or not. Because of this it just doesn't make sense to claim that a single address space model is inherently superior to multiaddress space models. It depends on what kind of application program you're thinking of. Each is good for some reasons and bad for others (basically performance versus safety). >> It's true that AT&T fought tooth and nail to keep VM out of their >> versions of Unix, but even they gave up years ago, [...] > >Another confirmation. Not only is Unix brain damaged due to history, but its >designers were heavely sedated too! Huh? You're not making your thinking clear. Yes, AT&T is brain damaged. Yes, System III Unix was brain damaged. But since System V.4 and Sun OS 4.0 and BSD 4.3 all support both demand paged virtual memory *and* shared memory, what's your beef? >I was not bad-mouthing page swapping. I was bad-mounting the suggestion that we >implement separate address spaces, like brain-damaged Unix does. Oh brother! Calling Unix "brain damaged", or bad mouthing any technical feature, does not sufficiently explain your point(s). Most of what you *seem* to be arguing doesn't make sense so far to those of us who have had to deal with the technical tradeoffs in question. It sounds like you're theorizing without complete facts, thus the strong disagreement. Perhaps I'm just misunderstanding your position. >Again, you are mixing up time-zones. Today, there is only one advantage to >having separate address spaces: the ability to layer operating systems on top >of each other. That's an example of what I mean. There demonstrably *are* other advantages, thus this statement is confusing. >That's what virtual machines are all about. Not exactly what an >Amiga user whishes to do with his computer. I disagree, at least in part, but that's another issue. (Ok, briefly: what about those who have said they'd like to have both AmigaDOS and Minix running at the same time!?) >> Shared address space is great in real time systems, but ideally as an >> *option*, not the only way to go. > >Whoa! You are really mixed up! Shared memory is a *requirement* in real-time >systems. It is an option is those 'other' brain-damaged systems. Throw that No, it is a requirement *for some tasks*, not for *all* tasks to share a single address space. As I said before, you get the maximum advantage of virtual memory management if most tasks are in private memory, and if it is an option to allow any two given tasks to share (some part of their) address spaces. The phrasing is confusing, I suppose, since I meant that it is a requirement to have the option! >Anybody can take my words and twist them around as they please. I am not >surprised to see that from a Unix junkie like you. :-) Thanks for the smiley face, but I really don't think I'm twisting your words. I think that I strongly disagree with your argument regardless of the phrasing of it. As for being a Unix junkie, I've been using Unix and C for a long time, but all I can say is that they are the best portable environments currently available. I've been dying for *more* powerful environments for a decade. I see some things that are improvements in some ways (e.g. AmigaDOS has some features that are nicer than those in Unix), but as far as across the board features are concerned, I'm still waiting. >> I like your proverb. >> Doug > >It will be outdated by the end of the summer. Perhaps sooner. I'll look forward to that. Sad that it won't prevent guru's, though. Doug -- Doug Merritt {pyramid,apple}!xdos!doug Member, Crusaders for a Better Tomorrow Professional Wildeyed Visionary "Welcome to Mars; now go home!" (Seen on a bumper sticker off Phobos)