[comp.os.misc] Running programs from inside XINU

rjh@cs.purdue.EDU (Bob Hathaway) (04/08/89)

In article <8904071506.AA03015@merlin.cs.purdue.edu>, sbm@CS.PURDUE.EDU writes:
>     John Mcleod asked whether it is possible for Xinu to load programs
>dynamically from a file and run them.
>
>     The Xinu operating system actually consists of a library of system
>calls and a main program that boots the system and runs the user's
>program as a process, all of which are loaded with the user's program
>before run time.  Xinu creates processes running functions that are
>already loaded, rather than reading them in from disk; thus, it is
>possible for Xinu to run on a machine without a file system (as it often
>does in practice).  Modifying Xinu to load processes dynamically from
>disk is of limited utility, since Xinu does not have a compiler, and so
>you have to leave Xinu to compile a program anyway.  Furthermore, Xinu

Yes, but executable files wouldn't need to be linked with the xinu operating
system reducing static linking time by about 30 to 40 seconds on a Sun 3/50.
Also, it would be nice to execute utility or any executable programs
as they exist in the file system from a shell without rebooting and
reloading the kernel operating system.  In a graduate-level distributed
systems class at Purdue, I proposed dynamically loaded heavyweight
user-level processes, as originally suggested to me by Jim Griffioen,
for the preceding reasons.  Xinu's purpose was primarily for real-time
systems such as file and page servers or for educational purposes
in several courses at Purdue and elsewhere.  The proposal entailed
a process model supporting threads running in (dynamic) heavyweight processes
which was modified and subsequently accepted in class.  An interesting feature
emerged from allowing heavyweight processes.  Since the Xinu OS interface
provides concurrent system calls for lightweight processes, it became
obvious that separately compiled xinu programs should be allowed to
run multiple threads of control per process which lead to a new process
table implementation based on address spaces.  This makes Xinu an excellent
vehicle for an Ada virtual machine because Ada tasks could be trivially
implemented as Xinu threads.  This is a project which may become feasible
in the near future.

>     The user would compile and link dynamically loaded executable files
>separately from the Xinu operating system itself.  Since none of the
>addresses of Xinu system calls are available when compiling and linking
>these files, the Xinu system calls would have to be implemented as
>traps, rather than as function calls, as they currently are.  Then

I also worked on system calls and library routines in the aforementioned 
class and we did provide a library and trap mechanism to support user level 
(dynamic) processes.  Dr. Comer's PhD students are still working on the
system.

Bob Hathaway
Rjh@purdue.edu