Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!mcvax!cogpsi!tom From: tom@cogpsi.UUCP (Tom Vijlbrief) Newsgroups: comp.sys.atari.st Subject: Re: loading and running executables on the atari Message-ID: <318@cogpsi.UUCP> Date: Thu, 15-Oct-87 06:24:33 EDT Article-I.D.: cogpsi.318 Posted: Thu Oct 15 06:24:33 1987 Date-Received: Sat, 17-Oct-87 02:06:34 EDT References: <439@ecrcvax.UUCP> Reply-To: tom@cogpsi.UUCP (Tom Vijlbrief) Organization: TNO Institute for Perception, Soesterberg, The Netherlands Lines: 39 Keywords: load link exec atari In article <439@ecrcvax.UUCP> alan@ecrcvax.UUCP (Alan P. Sexton) writes: >I know that there is a header block that has specific info about the >sizes of the text, data and bss areas etc., but I also know that the atari >does not do any address translation and yet, that according to some refs >I have, programs do not know where they will be loaded in memory. >This implies one of the following >a. All programs must be position independant (This could be done > but I don't believe it is so for the atari). >b. All programs must have their addresses fixed up when they are loaded > into memory. > >Case b would certainly be the way I would do it if it were up to me (given (Rest of text deleted) Case b is indeed the way it is implemented. The binary file consists of three parts. 1. The header 2. The Code and data. 3. The relocation information. The code and data is position dependent and can be loaded at address 0 for execution. The program is however always loaded at another position in memory and should be patched (because of the lack of a MMU). TOS patches the code and data by adding the actual position of the program in memory to all absolute memory references which the binary image contains. Because the symbol table has been deleted by the linker, TOS has to use a special relocation table. This table specifies the offset between succesive patch locations in the binary image. This format is compact and allows for fast patching. After the binary image has been patched by TOS, it starts execution by jumping to the start of the binary image. Tom Vijlbrief TNO Institute for Perception P.O. Box 23 Phone: +31 34 63 14 44 3769 DE Soesterberg E-mail: tnosoes!cogpsi!tom@mcvax.cwi.nl The Netherlands {uunet|...}!mcvax!tnosoes!cogpsi!tom