
top 3.4 for Rhapsody (MacOS X Server) README
Version 1.1
August 16, 1998
============================================

This document describes the steps necessary to get top
version 3.4 running for MacOS X server.  The system
described requires an original top-3.4 distribution plus 
a MacOS patch and separate machine-specific file.

The MacOS X port of top is different than the previous 
NEXTSTEP/OPENSTEP versions in that it stays closer to the
4.4 BSD version than it does to any of the Mach versions.  In
porting top to MacOS X, I have used as much of the kvm_ API
as possible and only use the Mach API's where necessary to
achieve functionality which does not seem to be completely
present in DR2.

Installation
============

To build top-3.4 for yourself, you will need the following
things:
	
	1) the original distribution of top-3.4 (included)
	2) the MacOS patch
	3) the m_macosx.c file

Unpack the normal top distribution into the directory of
your choice.  Once this is done, copy the m_macosx.c file
into the machine directory where you unpacked the source.
Apply the MacOS patch.  Follow the normal build instructions
by picking macosx from the list of available modules.

There is one additional thing which must be done before the
build of top will work.  The generated makefile must be
edited to remove the references to -ltermcap and -lm which
don't exist.

You should now be able to build top-3.4 for MacOS X by
typing 'make'.

Problems
========

The problem with the CPU state information has been fixed.
It is not a problem in the OS, but it was operator error.
At this point, all of the major functionality should work
the way it is supposed to work.  If something doesn't, let
me know.

The Display
===========

The display is pretty close to the recommended display and
also that of a normal 4.4 BSD system.  I have changed the
NICE column to be the number of threads for each process.
The SIZE column reflects the total size of the process
(resident + non-resident) while the RES column shows only
the resident size.  The STATE column uses information taken
from the kinfo_proc structure p_pstat member.  It will
accurately display the state of stopped and zombie
processes, but I am not really sure about the other states.
Finally, I included a MEM column which displays the percent
of total memory per the ps command.

Credits
=======

Many thanks to William LeFebvre who is the original author
of the top utility and to Mike Rhee who showed the utility
to me in the first place.  Thanks also to Christos Zoulas
who wrote the 4.4 BSD implementation of the machine module.
I also got some pointers from the NEXTSTEP 3.2 and OSF/1
versions by Tim Pugh and Anthony Baxter, respectively.

Bugs or Feedback
================

Feedback is always welcome.  I ported top mostly for myself,
but I am certainly open to suggestions and bug reports from
people who are using it under MacOS X.  I don't make any
promises about turnaround time, but I will investigate all
of the bug reports I receive.

Best of luck and I hope you find this port useful.

ast
---
Andrew S. Townley
atownley@primenet.com
atownley@informix.com
