Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site caip.RUTGERS.EDU Path: utzoo!linus!gatech!seismo!caip!dan From: dan@BBN-PROPHET.ARPA Newsgroups: net.micro.amiga Subject: Memory Management w/o MMU" Message-ID: <370@caip.RUTGERS.EDU> Date: Thu, 7-Nov-85 12:11:56 EST Article-I.D.: caip.370 Posted: Thu Nov 7 12:11:56 1985 Date-Received: Sat, 9-Nov-85 05:57:06 EST Sender: daemon@caip.RUTGERS.EDU Organization: Rutgers Univ., New Brunswick, N.J. Lines: 32 From: Dan FranklinOne minor question regarding memory management still hasn't been answered, and I'm curious. Without an MMU, how does the Amiga do multitasking? Specifically, how does it arrange to permit the same program to run in different places in memory? I can see two possibilities: 1. The executable program file contains relocation information. When the program is started up, it is assigned a place in memory and relocated to run at that address. This means it could not be "swapped out" and brought in to a different address if they ever decided to do that, or moved around to open up a big space for another program, but it is pretty fast. 2. When the program is started up, a designated address register ("base register") is set to point to the beginning of the program's text and data. All pointers the program manipulates with are relative to the base register; given a pointer variable, the compiler always uses the base register as an index when referring to memory. Stack accesses could be special-cased; another register could refer to the "real" current stack frame, and whenever the address of a stack variable was taken, the base register would be subtracted from the address before being stored in a pointer variable. The program can now be moved around freely, but it's somewhat slower. There is the problem of dynamic memory allocation; the pointer the allocator gives back of course can be made relative to the base register before it's stored in a pointer variable, but the distance between the base register and the dynamic memory has to be kept constant as the program is moved around. And of course they might have done something else I haven't thought of. Offhand, though, I would guess (1). Does anyone know? Dan