9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Ugly Q, I admit
@ 2002-11-25  9:39 Petr Cejchan
  0 siblings, 0 replies; 11+ messages in thread
From: Petr Cejchan @ 2002-11-25  9:39 UTC (permalink / raw)
  To: 9fans

Hi,
would it be easy/hard/impossible to write a linux emulator for
Plan9? (however I don't like to spoil plan9 with such things, I
still have a plethora of linux prgs whose authors don't like to
release sources... sigh. (windoze deleted 4+ yrs ago, my linux disk
sleeps silently in my bookshelf... don't like to bring it into life
more frequently than absolutely necessary))


Sorry,
thanks,
++pac.





=================================================
Icons were abandoned 4000+ years ago with advent of alphabet...
until their zombies plagued a few OSes ;-)
=================================================_

-- 
---
Zajímavé reklamní produkty, výhodná cena, cílení na uživatele
...http://reklama.volny.cz


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Ugly Q, I admit
  2002-11-27  6:14 ` Bruce Ellis
@ 2002-11-27 13:31   ` Lucio De Re
  0 siblings, 0 replies; 11+ messages in thread
From: Lucio De Re @ 2002-11-27 13:31 UTC (permalink / raw)
  To: 9fans

On Wed, Nov 27, 2002 at 01:14:15AM -0500, Bruce Ellis wrote:
>
> it turns out not to be very difficult at all.  i don't think much
> of it saw light.  you'll find that 5l supports it but the runtime
> code is not in the distribution.  i did 8l and el too but once
> again it never got out.  i'd be willing to do some work on this if
> come out of retirement (the pasadena doo-dah festival was more fun
> than bit-bashing).
>
What's "el"?

I set up a NetBSD diskless workstation farm once and because /bin
and /sbin were statically linked, I felt I could save disk space
by removing their contents (mostly) and putting dynamically linked
versions in /usr/(bin sbin).

It turned out to be cheaper and simpler to use hard links instead,
only a few files in /etc needed to be kept distinct per workstation,
everything else in the root partition landed up with numerous hard
links.  The saving was considerable, although I think NetBSD seems
to have a problem with exactly 128 hard links on a single i-node
(go figure!).

The new release of NetBSD (I haven't had the nerve to lift the
bonnet lid yet) has dynamically linked everything, except the
runtime loader and, seemingly, init.

There was a long discussion about making init dynamic too, so it
could have "locale" stuff in it.  In my uneducated state, I decided
that the kernel should not support internationalisation at all,
seeing the type of confusion and cost it gives rise to.  Leave it
to applications to battle with the details.  But of course I'm just
being reactionary.

Just a few tidbits triggered by brucee's comments, I don't believe
my opinions in this matter should be given much weight, whereas
NetBSD's experiences might be worth learning from.

++L


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Ugly Q, I admit
  2002-11-26 21:00 Russ Cox
@ 2002-11-27  6:14 ` Bruce Ellis
  2002-11-27 13:31   ` Lucio De Re
  0 siblings, 1 reply; 11+ messages in thread
From: Bruce Ellis @ 2002-11-27  6:14 UTC (permalink / raw)
  To: 9fans

it turns out not to be very difficult at all.  i don't think much of it saw light.
you'll find that 5l supports it but the runtime code is not in the distribution.
i did 8l and el too but once again it never got out.  i'd be willing to do some
work on this if come out of retirement (the pasadena doo-dah festival
was more fun than bit-bashing).

----- Original Message -----
From: "Russ Cox" <rsc@plan9.bell-labs.com>
To: <9fans@cse.psu.edu>
Sent: Tuesday, November 26, 2002 4:00 PM
Subject: Re: [9fans] Ugly Q, I admit


> > Does this imply that it would not be difficult to implement dynamic linking natively in Plan 9?
>
> the difficult part of dynamic linking is more in the compiler
> and linker than in the kernel proper.  since i'm just running
> already-created linux binaries, there's hardly any trouble.
>
> the linuxemu i posted has an "mmap" function that allocates
> memory and reads the whole file into it.  not quite the most
> efficient way to do it.  i wrote a real mmap for the kernel at the
> time, but it didn't seem worth keeping.  the user-side interface
> for the kernel mmap is commented out.
>
>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Ugly Q, I admit
@ 2002-11-26 21:00 Russ Cox
  2002-11-27  6:14 ` Bruce Ellis
  0 siblings, 1 reply; 11+ messages in thread
From: Russ Cox @ 2002-11-26 21:00 UTC (permalink / raw)
  To: 9fans

> Does this imply that it would not be difficult to implement dynamic linking natively in Plan 9?

the difficult part of dynamic linking is more in the compiler
and linker than in the kernel proper.  since i'm just running
already-created linux binaries, there's hardly any trouble.

the linuxemu i posted has an "mmap" function that allocates
memory and reads the whole file into it.  not quite the most
efficient way to do it.  i wrote a real mmap for the kernel at the
time, but it didn't seem worth keeping.  the user-side interface
for the kernel mmap is commented out.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Ugly Q, I admit
@ 2002-11-26 20:41 Keith Nash
  0 siblings, 0 replies; 11+ messages in thread
From: Keith Nash @ 2002-11-26 20:41 UTC (permalink / raw)
  To: 9fans

> I made linuxemu compile again, and it seems that
> it doesn't support dynamically linked binaries.  I don't
> think it's hard, but apparently never did it.

Does this imply that it would not be difficult to implement dynamic linking natively in Plan 9?



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Ugly Q, I admit
@ 2002-11-26 15:14 Russ Cox
  0 siblings, 0 replies; 11+ messages in thread
From: Russ Cox @ 2002-11-26 15:14 UTC (permalink / raw)
  To: 9fans

> Tru "black" commandline ones (perhaps with interaction like 1, 2, Y, N...),
> no X11 or .so

If they're statically linked, then you might be in luck.

I made linuxemu compile again, and it seems that
it doesn't support dynamically linked binaries.  I don't
think it's hard, but apparently never did it.

http://pdos.lcs.mit.edu/~rsc/linuxemu.tar.gz

g% 8.out bin/a.hello
segattach(8000080,10b94)...
hello world
g%

Russ



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Ugly Q, I admit
  2002-11-25 14:27 Russ Cox
@ 2002-11-26  9:50 ` peter a. cejchan
  0 siblings, 0 replies; 11+ messages in thread
From: peter a. cejchan @ 2002-11-26  9:50 UTC (permalink / raw)
  To: 9fans

rsc@plan9.bell-labs.com (Russ Cox) wrote in message news:<5b604999e828279a652aed42cd7ca87d@plan9.bell-labs.com>...
> > would it be easy/hard/impossible to write a linux emulator for
> > Plan9? (however I don't like to spoil plan9 with such things, I
> > still have a plethora of linux prgs whose authors don't like to
> > release sources... sigh. (windoze deleted 4+ yrs ago, my linux disk
> > sleeps silently in my bookshelf... don't like to bring it into life
> > more frequently than absolutely necessary))
>
> Writing a program that runs the binaries but
> intercepts the system calls and handles them itself
> is easy.  I did this a few years ago.  The only wart
> in my emulator is that Plan 9's lack of mmap makes
> loading programs a little clumsier than it might be.
> But I can run hello world, both statically and dynamically
> linked.
>
> The real problem is what to do at that point.
> Any substantial program depends on other context,
> like having an X11 server, or a cursor-addressed
> terminal.  Running things like Wine require kernel
> support that we just don't have.
>
> In the end, it's not clear to me that it would be much
> easier or more convenient than just running a Linux
> system.
>
> What kind of programs did you have in mind?
>
> Russ

Tru "black" commandline ones (perhaps with interaction like 1, 2, Y, N...),
no X11 or .so

thanks,
++pac.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [9fans] Ugly Q, I admit
@ 2002-11-25 21:34 Joel Salomon
  0 siblings, 0 replies; 11+ messages in thread
From: Joel Salomon @ 2002-11-25 21:34 UTC (permalink / raw)
  To: 9fans

I actually meant to run Bochs (or something similar) *under* plan9, and
run Linux as a guest. Petr Cejchan wanted a linux emulator so ...

Some ancient papers from http://cm.bell-labs.com/cm/cs/who/dmr/cray.html
talk about running Unix as a guest OS. There is also a user-mode-linux
project on http://user-mode-linux.sourceforge.net/ as well as a plethora
of Bochs-like project (usually in uder-finished form). Might be a fun
project..

--Joel
______________________________________________________
Due to economic circumstances, the light at the end of
the tunnel has been turned off.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Ugly Q, I admit
  2002-11-25 19:34 Joel Salomon
@ 2002-11-25 20:45 ` Phil White
  0 siblings, 0 replies; 11+ messages in thread
From: Phil White @ 2002-11-25 20:45 UTC (permalink / raw)
  To: 9fans

On a sidenote, VMware, while not free, supposedly will do the trick.

-Phil/CERisE

On Mon, Nov 25, 2002 at 02:34:45PM -0500, Joel Salomon wrote:
> Would the Bochs pc emulator be hard to port to plan9? The web page says it
> can run linux, etc as guest OSs.
>
> --Joel
> ______________________________________________________
> Due to economic circumstances, the light at the end of
> the tunnel has been turned off.
>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [9fans] Ugly Q, I admit
@ 2002-11-25 19:34 Joel Salomon
  2002-11-25 20:45 ` Phil White
  0 siblings, 1 reply; 11+ messages in thread
From: Joel Salomon @ 2002-11-25 19:34 UTC (permalink / raw)
  To: 9fans

Would the Bochs pc emulator be hard to port to plan9? The web page says it
can run linux, etc as guest OSs.

--Joel
______________________________________________________
Due to economic circumstances, the light at the end of
the tunnel has been turned off.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] Ugly Q, I admit
@ 2002-11-25 14:27 Russ Cox
  2002-11-26  9:50 ` peter a. cejchan
  0 siblings, 1 reply; 11+ messages in thread
From: Russ Cox @ 2002-11-25 14:27 UTC (permalink / raw)
  To: 9fans

> would it be easy/hard/impossible to write a linux emulator for
> Plan9? (however I don't like to spoil plan9 with such things, I
> still have a plethora of linux prgs whose authors don't like to
> release sources... sigh. (windoze deleted 4+ yrs ago, my linux disk
> sleeps silently in my bookshelf... don't like to bring it into life
> more frequently than absolutely necessary))

Writing a program that runs the binaries but
intercepts the system calls and handles them itself
is easy.  I did this a few years ago.  The only wart
in my emulator is that Plan 9's lack of mmap makes
loading programs a little clumsier than it might be.
But I can run hello world, both statically and dynamically
linked.

The real problem is what to do at that point.
Any substantial program depends on other context,
like having an X11 server, or a cursor-addressed
terminal.  Running things like Wine require kernel
support that we just don't have.

In the end, it's not clear to me that it would be much
easier or more convenient than just running a Linux
system.

What kind of programs did you have in mind?

Russ



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2002-11-27 13:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-25  9:39 [9fans] Ugly Q, I admit Petr Cejchan
2002-11-25 14:27 Russ Cox
2002-11-26  9:50 ` peter a. cejchan
2002-11-25 19:34 Joel Salomon
2002-11-25 20:45 ` Phil White
2002-11-25 21:34 Joel Salomon
2002-11-26 15:14 Russ Cox
2002-11-26 20:41 Keith Nash
2002-11-26 21:00 Russ Cox
2002-11-27  6:14 ` Bruce Ellis
2002-11-27 13:31   ` Lucio De Re

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).