Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!mcnc!rti-sel!sas!burnette From: burnette@sas.UUCP Newsgroups: comp.sys.amiga Subject: Re: The resident command Message-ID: <229@sas.UUCP> Date: Sun, 23-Nov-86 12:23:09 EST Article-I.D.: sas.229 Posted: Sun Nov 23 12:23:09 1986 Date-Received: Mon, 24-Nov-86 19:31:31 EST References: <2062@well.UUCP> Organization: SAS Institute Inc. Cary, NC Lines: 31 Summary: The RUN command doesn't know about it. Thoughts on how to make resident C programs. The resident cli seems to have one fatal flaw: RUN doesn't know about resident commands. For example, if you enter resident md c/makedir and then try run md the md command will not be found. This occurs even in execute files started by the run command. For example: run execute foo where foo contains an 'md' command. Other than that, resident commands work very nicely. There is a noticable speed improvement over executing the commands from ram: (instant versus a fraction of a second). Then of course there is the memory savings of not having two copies of a program in memory. Both the Lattice and Manx compilers support base register relative data addressing now so it would seem possible for us to come up with a scheme for resident commands that takes advantage of that feature. When you make a command resident the code and data sections could be loaded into memory. Then, when someone executes the command, a copy of the data section could be made; the bss part could be allocated and initialized; a base register could be pointed to the top; and then the code that is already in memory could be executed. The bss section will need to be allocated at the end of the data section, I think. The only problem I see is that Lattice and Manx assume different base registers for the data. We either have to detect somehow which register to use or get the two companies to agree on a standard register (perhaps some register in between the two they use now :-).