9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] Ugly Q, I admit
@ 2002-11-26 21:00 Russ Cox
  2002-11-27  6:14 ` Bruce Ellis
  0 siblings, 1 reply; 17+ 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] 17+ messages in thread

* Re: [9fans] Ugly Q, I admit
  2002-11-26 21:00 [9fans] Ugly Q, I admit Russ Cox
@ 2002-11-27  6:14 ` Bruce Ellis
  2002-11-27 13:31   ` Lucio De Re
  0 siblings, 1 reply; 17+ 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] 17+ messages in thread

* Re: [9fans] Ugly Q, I admit
  2002-11-27  6:14 ` Bruce Ellis
@ 2002-11-27 13:31   ` Lucio De Re
  2002-11-27 18:41     ` [9fans] dynamic loading, was "Ugly Q, I admit" Bruce Ellis
  0 siblings, 1 reply; 17+ 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] 17+ messages in thread

* Re: [9fans] dynamic loading, was "Ugly Q, I admit"
  2002-11-27 13:31   ` Lucio De Re
@ 2002-11-27 18:41     ` Bruce Ellis
  2002-11-28  5:12       ` Lucio De Re
  0 siblings, 1 reply; 17+ messages in thread
From: Bruce Ellis @ 2002-11-27 18:41 UTC (permalink / raw)
  To: 9fans

dynamic loading and shared libraries are distinct (put related) beasts.
the work i did was for dynamically loadable device drivers for inferno.
it's kinda cool.  the initial kernel is tiny, even by inferno standards,
and then other drivers are loaded to customize the experience
(typically i load cap ssl kfs and sd).  i also use it to load drivers
that are used on occasion, like kprof or a generic systest.
the interface is via devdynload.

i've never had much time for shared libraries.  given that plan9 does
not have grossly obese libraries the "shared/saved disk/memory"
justification seems marginal.  you also avoid a major "single point
of disaster".  i believe presotto reported being frightened by
shared libraries (and clowns) as a child.

btw e[acl] is the compiler port for the playstation 2 ee5900.

brucee


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

* Re: [9fans] dynamic loading, was "Ugly Q, I admit"
  2002-11-27 18:41     ` [9fans] dynamic loading, was "Ugly Q, I admit" Bruce Ellis
@ 2002-11-28  5:12       ` Lucio De Re
  2002-11-28  5:58         ` Bruce Ellis
  0 siblings, 1 reply; 17+ messages in thread
From: Lucio De Re @ 2002-11-28  5:12 UTC (permalink / raw)
  To: 9fans

On Wed, Nov 27, 2002 at 01:41:07PM -0500, Bruce Ellis wrote:
>
> dynamic loading and shared libraries are distinct (put related) beasts.
> the work i did was for dynamically loadable device drivers for inferno.
> it's kinda cool.  the initial kernel is tiny, even by inferno standards,
> and then other drivers are loaded to customize the experience
> (typically i load cap ssl kfs and sd).  i also use it to load drivers
> that are used on occasion, like kprof or a generic systest.
> the interface is via devdynload.
>
I remember loadable device drivers being mooted a while back.  I like
the idea a lot, although it seems backwards to me: repeating the
bootstrap stuff in the kernel always struck me as evil, if
unavoidable.  Ideally you'd want to "load" at least some kernel
drivers by inheriting them from the bootstrap loader.  I'm not sure
that the difference can't be minimised almost to nothingness.

> i've never had much time for shared libraries.  given that plan9 does
> not have grossly obese libraries the "shared/saved disk/memory"
> justification seems marginal.  you also avoid a major "single point
> of disaster".  i believe presotto reported being frightened by
> shared libraries (and clowns) as a child.
>
Shared library are a curse, but until everyone sees them in that
light, they'll be with us for a long time to come.  It's a fashion
thing.

> btw e[acl] is the compiler port for the playstation 2 ee5900.
>
I never even remotely dared hope there'd be Plan 9 for the PS2.  Can I
start dreaming?  Shall I spend some money and offer to help?

++L


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

* Re: [9fans] dynamic loading, was "Ugly Q, I admit"
  2002-11-28  5:12       ` Lucio De Re
@ 2002-11-28  5:58         ` Bruce Ellis
  2002-11-28  6:38           ` Lucio De Re
  0 siblings, 1 reply; 17+ messages in thread
From: Bruce Ellis @ 2002-11-28  5:58 UTC (permalink / raw)
  To: 9fans


----- Original Message -----
From: "Lucio De Re" <lucio@proxima.alt.za>
...
> I remember loadable device drivers being mooted a while back.

It was on the list for 4th edition (rob was a fan) but too much was
going on in many ways for it to have a chance.  I might bring my
Inferno model into a private plan9 kernel and see if I like it.

> Shared library are a curse, but until everyone sees them in that
> light, they'll be with us for a long time to come.  It's a fashion
> thing.

A fashion?  I wish it would die.  But then again my wardrobe says
something about doing something for the helluva it.

> I never even remotely dared hope there'd be Plan 9 for the PS2.  Can I
> start dreaming?  Shall I spend some money and offer to help?

No need to dream.  The jump from the Inferno port to a plan9 port
is largely known territory.  It's just a whacky mips and so if you are
willing to get the mmu/tlb stuff right then you are almost there.  The
most interesting part is deciding what to do about graphics.  /dev/draw
would be an easy way out (the linux guys just went for a slow X) but
the chip is more fun than that.

brucee


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

* Re: [9fans] dynamic loading, was "Ugly Q, I admit"
  2002-11-28  5:58         ` Bruce Ellis
@ 2002-11-28  6:38           ` Lucio De Re
  2002-11-28  6:54             ` Bruce Ellis
  0 siblings, 1 reply; 17+ messages in thread
From: Lucio De Re @ 2002-11-28  6:38 UTC (permalink / raw)
  To: 9fans

On Thu, Nov 28, 2002 at 12:58:09AM -0500, Bruce Ellis wrote:
>
> A fashion?  I wish it would die.  But then again my wardrobe says
> something about doing something for the helluva it.
>
Some fashions never do, look at automobiles.  They still have a wheel
at each of four corners of a rectangle, with panels that bend when
bumped.

> No need to dream.  The jump from the Inferno port to a plan9 port
> is largely known territory.  It's just a whacky mips and so if you are
> willing to get the mmu/tlb stuff right then you are almost there.  The
> most interesting part is deciding what to do about graphics.  /dev/draw
> would be an easy way out (the linux guys just went for a slow X) but
> the chip is more fun than that.
>
A fast VNC would justify me buying it already.  Games would be a
terribly exciting option.  What are we wasting our time on 386s
for? And, last important question, how well does the chip deal with
virtualisation?

Oh, clustering would be neat too, but maybe I should keep that for
Slashdot :-)

++L


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

* Re: [9fans] dynamic loading, was "Ugly Q, I admit"
  2002-11-28  6:38           ` Lucio De Re
@ 2002-11-28  6:54             ` Bruce Ellis
  2002-11-28  7:05               ` Lucio De Re
  0 siblings, 1 reply; 17+ messages in thread
From: Bruce Ellis @ 2002-11-28  6:54 UTC (permalink / raw)
  To: 9fans

> And, last important question, how well does the chip deal with
> virtualisation?

In the "I'm a CPU" sense it is not too unlike any other mips.
Not different enough from the 4700 or the 7000 to get me upset.

brucee


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

* Re: [9fans] dynamic loading, was "Ugly Q, I admit"
  2002-11-28  6:54             ` Bruce Ellis
@ 2002-11-28  7:05               ` Lucio De Re
  0 siblings, 0 replies; 17+ messages in thread
From: Lucio De Re @ 2002-11-28  7:05 UTC (permalink / raw)
  To: 9fans

On Thu, Nov 28, 2002 at 01:54:12AM -0500, Bruce Ellis wrote:
>
> In the "I'm a CPU" sense it is not too unlike any other mips.
> Not different enough from the 4700 or the 7000 to get me upset.
>
I entered the commercial computer marketplace just as sanctions
against South Africa started biting.  Only lucky (?!) developers
in the Defence and Police forces got to see all the exciting
architectures.

What I'm asking is how hard it would be for a VMware-like utility
to allow Plan 9 and the "native" operating system to co-exist.
Then one can play games _and_ have a Plan 9 system.

There are lots of PS2s out there!  Few of them, at least relatively,
are likely to be running Linux, fewer still are likely to be bought
to run Plan 9.

In passing, the NetBSD folk are getting close to providing PowerPC
and i386 emulation for OS-X on the Apple platforms.  That is equally
exciting.  Is this how the Wintel egemony (sp?) is going to be
broken?

++L


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

* Re: [9fans] Ugly Q, I admit
@ 2002-11-26 20:41 Keith Nash
  0 siblings, 0 replies; 17+ 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] 17+ messages in thread

* Re: [9fans] Ugly Q, I admit
@ 2002-11-26 15:14 Russ Cox
  0 siblings, 0 replies; 17+ 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] 17+ 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; 17+ 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] 17+ messages in thread

* [9fans] Ugly Q, I admit
@ 2002-11-25 21:34 Joel Salomon
  0 siblings, 0 replies; 17+ 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] 17+ 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; 17+ 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] 17+ 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; 17+ 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] 17+ 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; 17+ 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] 17+ messages in thread

* [9fans] Ugly Q, I admit
@ 2002-11-25  9:39 Petr Cejchan
  0 siblings, 0 replies; 17+ 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] 17+ messages in thread

end of thread, other threads:[~2002-11-28  7:05 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-26 21:00 [9fans] Ugly Q, I admit Russ Cox
2002-11-27  6:14 ` Bruce Ellis
2002-11-27 13:31   ` Lucio De Re
2002-11-27 18:41     ` [9fans] dynamic loading, was "Ugly Q, I admit" Bruce Ellis
2002-11-28  5:12       ` Lucio De Re
2002-11-28  5:58         ` Bruce Ellis
2002-11-28  6:38           ` Lucio De Re
2002-11-28  6:54             ` Bruce Ellis
2002-11-28  7:05               ` Lucio De Re
  -- strict thread matches above, loose matches on Subject: below --
2002-11-26 20:41 [9fans] Ugly Q, I admit Keith Nash
2002-11-26 15:14 Russ Cox
2002-11-25 21:34 Joel Salomon
2002-11-25 19:34 Joel Salomon
2002-11-25 20:45 ` Phil White
2002-11-25 14:27 Russ Cox
2002-11-26  9:50 ` peter a. cejchan
2002-11-25  9:39 Petr Cejchan

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).