[comp.sys.amiga.tech] Amiga UNIX

peter@sugar.UUCP (Peter da Silva) (06/25/88)

In article <257@jackson.UUCP>, egranthm@jackson.UUCP (Ewan Grantham) writes:
> I'm just curious after all this discussion of how Commodore IS planning to
> implement Unix on the A2500?

Easy. Stick a 68020 and an MMU in and throw AmigaDOS out. I'm trying to
come up with some ideas of how to stick a 68020 and MMU in and run UNIX
tasks under AmigaDOS. The trick (for those who got bored with the flames
started by my offhand comment about performance) is to think of the Amiga
Exec as the kernel.

In UNIX, when you perform a system call or get an interrupt the process you're
running switches into kernel mode. All the processing is done in the context
of the process running at the time (including device drivers, and so on).
Contrast this with AmigaDOS, where device drivers are just other tasks. Why
is it so?

It's because in UNIX switching context to another process is (by comparison
with the Amiga) expensive. In the Amiga you save and restore the registers
and a couple of pointers. Given that the Amiga supports the Motorola FPU, it
probably saves and restores *its* registers as well. In UNIX you also have to
save and restore the MMU state. This can be expensive. For example, the Sun
uses an MMU with 8 or 16 contexts in it, so for up to that many processes
context switch is fast. When you get more active processes you get a
perceptible loss in performance.

So the drivers don't get their own tasks. They run in the context of the
current process and avoid those extra context switches.

Let's get back to user and kernel mode. Swapping between user and kernel mode
is cheap... about as cheap as an Amiga context switch. That's because in
kernel mode the MMU is pretty much unused. The kernel is trusted not to
diddle with the wrong things (all this is one reason why UNIX kernel hackers
are in demand: it's a lot harder than writing a well-behaved program on the
Amiga).

My suggestion was along these lines: only use the MMU in the context of a UNIX
process. Turn it off when you get an interrupt (switch to kernel/amiga mode) or
make a system call (switch to kernel/amiga mode). Turn it on again when you
get back to the UNIX process. You will have to be careful what memory you
allocate to the UNIX process: don't want to fragment the MMU tables *too* much.

But look what you get: you get UNIX compatibility (care of unix.library and
the 68020 (or 68030!)), with a *fast* real-time kernel that's *easy* to work
in (compared to a real UNIX kernel). Move aside, Masscomp: Commodore's
coming!

Well, I can dream...
-- 
-- `-_-' Peter (have you hugged your wolf today?) da Silva.
--   U   Mail to ...!uunet!sugar!peter, flames to /dev/null.
-- "A foolish consistancy is the hobgoblin of little minds".

gilgalad@caen.engin.umich.edu (Ralph Seguin) (10/25/90)

Howdy.  Well, with all of this talk about Amiga UNIX, I thought that
I'd throw in my 2 cents.

Does it have Motif running under X (I know that it has Open Look
which is better, but many folk like Motif).
Does it have PHIGS?
What kind of software comes standard with  it?
Now, for the REAL killer, does it have AFS running? Andrew File
System that is.  AFS is MUCH, MUCH better than NFS, and considerably
more stable and faster.
If AFS isn't running, somebody there should look into it.  It is
definitely worthwhile!  Also, I wouldn't mind seeing AFS under
native Amiga OS TCP/IP 8-)  NFS stinks!
Probably more questions that I haven't though of...

			Thanks, Ralph


gilgalad@dip.eecs.umich.edu       gilgalad@caen.engin.umich.edu

Ralph Seguin		| "You mean THE Zaphod Beeblebrox?"
536 South Forest	|
Apartment 915		| "No.  Haven't you heard, I come in six packs!"
Ann Arbor, MI 48104	|
(313) 662-4805

gilgalad@caen.engin.umich.edu (Ralph Seguin) (10/27/90)

Howdy.  Well, since they are answering questions concerning UNIX, I have
a couple.

1.  Do you have AFS running?  Do you plan on getting it going?  AFS
   is MUCH, MUCH better than NFS.  You can contact Transarc corporation
   concerning getting AFS for the Amiga.
1a.  If you got AFS going on these things, you can do neat things like
   copying directly from any machine running AFS on the internet instead
   of having to FTP to it.  AFS uses ACLs.  Kinda neat for doing distribution
   of new releases of software, just cp it from an AFS cell as opposed to
   worrying about FTP, or tape (and tape compatability), etc.
   AFS this, AFS that...
1b.  Anybody working on AFS for native Amiga OS?  This would be way cool...
   I doubt that anybody is though, since AFS is kinda new and networking
   isn't too widespread on the Amiga, yet ...

2.  I read that you have Motif running.  That is nice since many like
   Motif as a GUI.  I would like to have Open Look myself (hey! What a
   coincidence! 8-)  What rev of X11 are you running R4 or R3?
2a. What X clients come standard?  We're trying to get C= to come do
   a presentation of their UNIX box to University of Michigan.  If they
   do come, then it would be suggested that they be running Motif since
   CAEN (Computer Aided Engineering Network) is trying to move to a
   consistent look and feel across all of its platforms.  This consists
   of X and Motif.  I hope that we can get C= to come.  That way, I get
   to play with a 3000UX 8-)  Of course, C= could also show CAEN the
   foolishness of running Motif instead of Open Look.

3.  Is the scheduler in V.4 any better than in previous releases?  UNIX
   certainly doesn't suit realtime 8-(

4.  What is recommended (both in docs, and by the C= folks who actually
   did the work) amount of disk space?  I'm thinking about 300 megs,
   of course, the bigger the better 8-)

5.  Do you have the Sun Lightweight Process Library ported?  Is there
   the ability to run lightweight processes in Amiga UNIX?  Sun LWP lib
   is actually co-routines, and isn't very pretty to work with.

6.  Provisions for non-blocking I/O?

7.  Shared memory segments (ie, shared segment between >= two processes)?

8.  Any hope of having native Amiga OS processes running under UNIX?  I
   suppose that this one has been beaten to death 8-)  I also suppose that
   this is one of those hush-hush items.

			Thanks, Ralph


gilgalad@dip.eecs.umich.edu       gilgalad@caen.engin.umich.edu

Ralph Seguin		| "You mean THE Zaphod Beeblebrox?"
536 South Forest	|
Apartment 915		| "No.  Haven't you heard, I come in six packs!"
Ann Arbor, MI 48104	|
(313) 662-4805