Running Unix programs under LispOS

Martin Cracauer cracauer@wavehh.hanse.de
Fri, 2 May 1997 12:00:17 +0200 (MET DST)


Olin Shiver's scsh - The Scheme Shell - has anything you want from a
Lisp/Unix integration. It is very well thought-off and most of it
would apply to Common Lisp, maybe somewhat better since reader macros
could help a lot.

Anyone who is going to think over the issue should read the scsh
papers in advance. http://www-swiss.ai.mit.edu/scsh/

> I may be talking through my hat here, but it seems plausible to me to support 
> a mini-unix environment *within* our lisp universe, but keep it isolated from 
> the world that we're running.  What I imagine is a subsystem which can run ELF 
> binaries in their own protected memory.  You might write lisp code that looks 
> something like this:
> 
> (let ((browser (find-elf-binary "netscape"))
>    (funcall browser "http://www.deepeddy.com")))
> 
> or maybe:
> 
> (let ((tar (find-elf-binary "tar"))
>       (*standard-io* (make-instance 'terminal))
>       (unix-env::pwd "/usr/local/src"))
>    (funcall tar "-xvf" "/usr/local/src/tarfiles/foo.tar"))
> 
> I might define this:
> 
> (defun ed (file)
>    (funcall (find-elf-binary "emacs") file))
> 
> and someone sick might define this:
> 
> (defun ed (file)
>    (let* ((*standard-io* (make-instance 'terminal))
>           (unix-env::term (termtype *standard-io*)))
>       (funcall (find-elf-binary "vi") file)))
> 
> Basically, there would be an object which contains enough Unix environment to 
> run an elf binary.  This environment could be controlled from the lisp world, 
> but the Unix program would think it's on a real Unix machine.  If a Unix 
> program forked itself, it would create a new object for the child.  The 
> scheduler would be handled in Lisp (or at a lower level until we got a working 
> lispVM).
> 
> Conceptually, this would be fairly easy to implement while there was a full 
> version of Linux sitting on the hard disk.  Initially, the LispOS might just 
> appear like a shell under Linux, but the next phase would be to replace the 
> stuff between the kernel and the shell with Lisp code, and finally the only 
> Unix left would be the code running in these isolated environments (and all 
> the /usr/include, /usr/lib, and so on that it needs.
> 
> In practice could this be as simple as the concept sounds to me?
> 
> I could also see running DOS or Windows binaries in a similar fashion.
> 
> Chris
> 
> -- 
> Chris Garrigues                    O-              cwg@DeepEddy.Com
>   Deep Eddy Internet Consulting                     +1 512 432 4046
>   609 Deep Eddy Avenue
>   Austin, TX  78703-4513              http://www.DeepEddy.Com/~cwg/
> 
> 
> 
> --==_Exmh_893399108P
> Content-Type: application/pgp-signature
> 
> -----BEGIN PGP MESSAGE-----
> Version: 2.6.2
> 
> iQB1AwUBM2mHlpaQnaaFII2dAQH+PwMAzjg2JrIilCb1FY2h+9vr3aCW87OHcRfN
> O221ExNeudObo4weVNfIUO7AJV3BAs6dNK8cd9SV9ZYk3fjooue6whrC5qMyEVpn
> KZiHANBmzTIuKV7BGwclgHVK03WrDEu3
> =AM5v
> -----END PGP MESSAGE-----
> 
> --==_Exmh_893399108P--
> 
> 


-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <cracauer@wavehh.hanse.de>
http://cracauer.cons.org
Fax +49 40 522 85 36