Sun-Spots Digest, v6n163

William LeFebvre Sun-Spots-Request at RICE.EDU
Fri Aug 5 14:57:02 AEST 1988


SUN-SPOTS DIGEST        Wednesday, 3 August 1988      Volume 6 : Issue 163

Today's Topics:
                     Re: LWP context switch for Sun/4
                     dnamail.shar in archive on titan
              FREE Exhibt Space for Student Ada Applications
                     third party maintenance vendors
              Transcript to LaserWriter through Encore Annex
              Questions about Uninterruptible Power Supplies
                    Monitoring failed login attempts?
                        4 disks on a Xylogics 753?
               Sun Opens New Training Center in Baltimore!

Send contributions to:  sun-spots at rice.edu
Send subscription add/delete requests to:  sun-spots-request at rice.edu
Bitnet readers can subscribe directly with the CMS command:
    TELL LISTSERV AT RICE SUBSCRIBE SUNSPOTS My Full Name
Recent backissues are available via anonymous FTP from "titan.rice.edu".
For volume X, issue Y, "get sun-spots/vXnY".  They are also accessible
through the archive server:  mail the request "send sun-spots vXnY" to
"archive-server at rice.edu" or mail the word "help" to the same address
for more information.

----------------------------------------------------------------------

Date:    22 Jul 88 00:09:29 GMT
From:    hpda!sun!megatest!djones at uunet.uu.net (Dave Jones)
Subject: Re: LWP context switch for Sun/4
Reference: v6n147

> From:    rtech!llama!daveb at sun.com (Dave Brower)
> 
> I need to implement a lightweight process switch in assembler on a Sparc.
> Has anyone already written such a beast that would be sharable? 

Would C do, rather than assembler?  The following works on Sun3.  I don't
know if it works on Sun4.  I would be interested to know if it does.

I posted the following to comp.lang.c a while back, as part of a
discussion of alloca.  You use three C-library routines, alloca and
setjmp/longjmp, to switch processes. 

The whole concept was roundly hooted down, because it will not work on all
unixes.  The alternative given was to write it in assembler!  I didn't
understand then, and I don't understand now why that was considered
superior.  Seems to me that when you go to a new system, you first
discover whether or not the C version will work.  If so, great.  If not,
you have to write an assembler replacement for one or more of the three
routines.  The only pitfall I can think of is that you might convince
yourself that the C version will work, only to have it fail under some
unanticipated conditions.  But for that matter, low level assembler
programming is not exactly hazard free.

Anyhow, it works this way:  To start a lightweight process, you do a
setjmp and then call the process's procedure.  To suspend the active
process, you copy the stack, do a setjmp to be used to restart the
process, then longjmp back to the scheduler.  To restart the process,
alloca enough memory to restore the process's stack, then longjmp to the
process's setjmp.  It's this last step that will not work on all machines.
Some systems insist that the longjmp go back toward the base of the stack.
If you try to longjmp the other way, they'll shreek, "longjmp botch," at
you and crash.  How rude.

Here's some sample code from a descrete-event simulation package:
__________

/***********************************************************************
** Run the simulation, stopping after some number of ticks, unless
** all processes exit, or some process calls PSim_stop() first.
***********************************************************************/

unsigned long
PSim_run(obj, ticks)
  register Simulation* obj;
  unsigned long ticks;
{
  obj->stack_bottom = (char*)alloca(1);
  obj->stop_time += ticks;

  while(!obj->quit)
    {
      /* Get a busy process from the priority queue, and
      ** change it from busy to active.
      ** Processes are prioritized by the time at which they
      ** will become active.
      */
      obj->active = (Process*) PQ_pop(&obj->busy);

      /* If all processes are finished, or are waiting on 
       ** a semaphore, we are blocked, and must exit the simulation.
       */

      if(obj->active==0)
	goto end_simulation;

      { register Process *active = obj->active;

	/* Update the simulated time to be the time
        ** of the active process's scheduled resumption.
	*/
	obj->time = active->busy_until;

	if( obj->time >= obj->stop_time)
	  goto end_simulation;

	if(setjmp(active->suspend) == 0)
	  if(active->stack_save == 0)
	    /* Process has not yet started. Call its start-procedure. */
	    active->return_value =
	      (*(active->start))(obj);
	  else
	    { /* Process has been suspended, and will now be restarted. */

	      /* allocate the restarting process's stack. */
	      alloca( active->stack_size );

	      /* restore it */
	      bcopy(  active->stack_save, active->stack_real,
		    active->stack_size);
	      sfree(active->stack_save);
	      active->stack_save = 0;

	      /* restart the process */
	      longjmp(active->restart, 1);
	    }
      }
    }

 end_simulation:
  cleanup(obj);
  return obj->time;
}
__________

/*********************************************************************/
/* Suspend the active process, and return to the scheduler Psim_run. */
/*********************************************************************/

static 
suspend_active_proc(obj)
  register Simulation* obj;
{
  char* stack_top = (char*)alloca(1);
  long size = abs(obj->stack_bottom - stack_top);
  register Process* active = obj->active;

  active->stack_save = (char*)smalloc(size);
  active->stack_real = min(stack_top, obj->stack_bottom);
  active->stack_size = size;

  if(setjmp(active->restart) == 0)
    {       
      /* copy the stack and return to the simulator. */
      bcopy( active->stack_real, active->stack_save, size);
      longjmp(active->suspend, 1);
    }
}

------------------------------

Date:    21-JUL-1988 09:58:26 GMT
From:    E105%VAXA.COMPLAB.BANGOR.AC.UK at cunyvm.cuny.edu
Subject: dnamail.shar in archive on titan

I have recently on two occasions retrieved this file from the archives
using the archive-server only to find that the code is incomplete and thus
useless to me.

However, the author of dnamail tells me that a new version of the program
has been written and submitted for inclusion in the archive. This allows
for the reception of mail as well as the sending of mail over the dna link.

I would be grateful if you would let me know if you have a copy of this
latest version of dnamail in the archive somewhere.

Many thanks,

Keith France
School of Electronic Engineering Science,
University of Wales, Bangor.
UK.

[[ Right you are!  Somehow the copy of dnamail.shar in the sun-spots
archives got trashed (may have been my fault).  P. Allan Jansen has
provided me with a new copy of the dnamail shar file and I have replaced
the bad copy in the archives with this new version.  It is stored under
"sun-source" as "dnamail.shar" and is 17927 bytes long.  It can be
retrieved via anonymous FTP from the host "titan.rice.edu" or via the
archive server.  For more information about the archive server, send a
mail message containing the word "help" to the address
"archive-server at rice.edu".  Sorry for the inconvenience.  --wnl ]]

------------------------------

Date:    21 Jul 88 10:31:16 GMT
From:    eberard at ajpo.sei.cmu.edu (Edward Berard)
Subject: FREE Exhibt Space for Student Ada Applications

Ada Expo is a large Ada trade show which will be held in Southern
California at the Anaheim Convention Center on October 9-12, 1988. A large
booth has been reserved for student Ada applications. The intention is to
provide inexpensive (i.e., FREE) exhibit space for interesting and
promising Ada applications created by college and university students

What will be provided will be booth space and electrical power.  Students
will be responsible for providing their own hardware, software, and
literature. The Ada Expo staff is receptive to offers from vendors who
would like to provide hardware or software for the students to use.

The rules are simple:

   1. Eligible participants must be college or university students
      who have created Ada applications which appear to be useful.
      These applications can be targeted towards any audience, but
      they must be written in Ada.

   2. Those applications deemed to be worthwhile will be provided
      FREE booth space in a large community booth at Ada Expo '88.
      Since space is limited, applications will be considered on a
      first-come-first-serve basis.

   3. The applications would have to be engineered to a large degree
      using the Ada language. Specifically, while mixed-language
      applications would be considered, all accepted applications
      would have to be at least 50% written in Ada.

There are currently more than 200 validated Ada compilers. Literally
hundreds of colleges and universities have at least some Ada-related
courses. 

If you are interested, or simply want more information, contact Jan
McCusker at Ada Expo '88, P.O. Box 3867, Frederick, MD 21701, or call
(301) 662-9400.

	-- Ed Berard
	(301) 695-6960

------------------------------

Date:    22 Jul 88 00:28:46 GMT
From:    ed at arizona.edu (Edward Rodriguez)
Subject: third party maintenance vendors

We've taken our Sun 2's off of SUN maintenance because it's so expensive.
Does anyone know any good third party maintenance vendors?  Do you
recommend avoiding any?

Edward Rodriguez
Dept. of Computer Science	(602) 621-2733
University of Arizona		(internet)	ed at arizona.edu
Tucson, Ariz. 85721		(uucp)		{cmcl2,noao,allegra}!arizona!ed

------------------------------

Date:    Fri, 22 Jul 88 09:27:02 EDT
From:    John Sloan <jsloan%odin.Wright.EDU at relay.cs.net>
Subject: Transcript to LaserWriter through Encore Annex

I have a Berkeley Unix lpd filter, "annexf", that allows you to spool to
an Apple/Sun LaserWriter attached to an Encore Annex UX ethernet terminal
server (currently with the Annex software earlier than release 4.0) using
the usual Adobe Transcript software. It's been running for three weeks now
on an LaserWriter II NT, and for several days on a LaserWriter+, without
problems. I use one of the LaserWriters for nearly all my day-to-day
output, including troff output. Some other users have routinely used it
for TeX output.

I'd like to recruit some beta-test sites who might want to do the same
thing before I unleash it on an unsuspecting world through
comp.sources.unix. Since this is a typical configuration for Sun users
(which is what we're running it on) I thought perhaps sun-spots readers
might be interested.  If you are, my address is shown below.  A makefile
and man page are included with the kit. Thanks.

John Sloan, The SPOTS Group    Wright State University Research Building
CSNET: jsloan at SPOTS.Wright.Edu  3171 Research Blvd., Kettering, OH 45420
UUCP:  ...!wright!jsloan                +1-513-259-1384  +1-513-873-2491
Logical Disclaimer: belong(opinions,jsloan). belong(opinions,_):-!,fail.

------------------------------

Date:    Fri, 22 Jul 88 11:06:56 EDT
From:    kcb at macaw.jhuapl.edu (Kevin C Brown x4700 1-e136)
Subject: Questions about Uninterruptible Power Supplies

Yesterday power went down while I was downloading files off a tape.  When
power came back my Sun 3/110 (OpSys 3.4) wouldn't boot because the /usr
partition couldn't pass fsck sucessfully. Short version of the story is
that I spent many hours getting the system running again (I am by no means
expert in such things).

I am now highly motivated to install an UPS.  I can't predict the amount
of time that power might be down in the furture and probably couldn't
afford more than 30 minutes of UPS anyway. I would rather use the time to
shut down the machine gracefully. 

Question: Does anyone know how to interface an UPS to a Sun so that when
the UPS detects a power outage it signals the Sun to run a shutdown
routine?

Kevin Brown
Applied Physics Laboratory
Laurel, MD 20707
(301) 953-5000
ARPA: kcb at macaw.jhuapl.edu

------------------------------

Date:    Fri, 22 Jul 88 09:49:57 EDT
From:    bdrc!jwc at mcnc.org (Joan Curry)
Subject: Monitoring failed login attempts?

My employer would like for me to monitor failed login attempts.  Anyone
know a way to do this with SunOS without source?

If I can't do it for all attempts, they'd probably settle for failed
logins on dialup lines.  BADDIALUP messages do appear in my console window
(anyone know exactly what they mean?), so one solution might be to get a
hardcopy console ... but can I make it be logged into a file instead?  (I
have syslog at level 9, but it doesn't pick up these messages.)

I'll summarize if people send me mail about this.

------------------------------

Date:    Fri, 22 Jul 88 09:20:54 CDT
From:    natinst!brian at cs.utexas.edu (Brian H. Powell)
Subject: 4 disks on a Xylogics 753?

About a month ago, we installed a new SMD disk drive with a Xylogics 753
controller.  The xylogics is capable of driving four disk drives.  We've
"come into" a couple of extra SMD drives.  We'd kind of like to use these
on our Sun (a 3/160).

The Xylogics instructions for the kernel config file say:

controller xlc0 at ...
controller xlc1 at ...
disk xl0 at xlc0 drive 0
disk xl1 at xlc0 drive 1
disk xl2 at xlc1 drive 0
disk xl3 at xlc1 drive 1

Aside from the cabling, if I wanted to use four (or three) disks with one
controller, would I just have to change it to:

disk xl2 at xlc0 drive 2
disk xl3 at xlc0 drive 3
...and so on...

?
Or is there something else I'd have to do?  Or is it impossible on a Sun?
Any jumpers I'd have to set?  If it's possible, what kind of performance
degradation would I experience?

Brian H. Powell					National Instruments Corp.
	brian at natinst.uucp			12109 Technology Blvd.
	cs.utexas.edu!natinst!brian		Austin, Texas 78727-6204
	AppleLink:D0351				(512) 250-9119 x832

or if that doesn't work, you can use brian at sally.utexas.edu.

------------------------------

Date:    Fri, 22 Jul 88 08:14:58 PDT
From:    susan at sun.com (Susan Morin)
Subject: Sun Opens New Training Center in Baltimore!

Sun Microsystems announces the opening of its new customer training center
in Baltimore, Maryland. Our newest facility is located on Route 176
between the Baltimore/Washington Parkway and Route 1 in the Dorsey
Business Park and will open August 15, 1988.

The new center will be staffed by fully trained professional instructors.
Its laboratories will be equipped with Sun's latest products. The center
will offer a variety of courses including: Introduction to SunOS, SunOS
for Programmers, System Administration 3.X and 4.0, C Programming and
Programming SunView Windows.

To enroll in courses at the Baltimore, MD Lexington, MA or Milpitas, CA
facilities, contact our registrar at one of the following numbers:

       	       within CA	(800) 423-8020
elsewhere within the U.S.	(800) 422-8020 

Course descriptions appear in the Educational Services
July - December 1988 Course Information and Schedule. If
you do not have a copy, send your request to
customer-training at sun.com (Internet) or sun\!customer-training
(UUCP).

BALTIMORE, MD TRAINING SCHEDULE


EU-101	Introduction to SunOS 	$600

September 12 - 14
Ocober 3 - 5
October 17 - 19
October 31 - November 2
November 28 - November 30
December 19 - 21

EU-102  Advanced SunOS Users   $400

September 15 - 16
October 6 - 7
October 20 - 21
November 3 - 4
December 1 - 2
December 22 - 23

EU-110  SunOS for Users	     $900

September 12 - 16
October 3 - 7
October 17 - 21
October 31 - November 4
November 28 - December 2
December 19 - 23

UP-201  Introduction to SunOS $500
        for Technical Users

August 15 - 16
August 29 - 30
September 12 - 13
September 26 - 27
October 10 - 11
October 31 - November 1
November 14 - 15
December 5 - 6
Deceomber 12 - 13

UP-202  SunOS Software       $700
        Development Tools

August 17 - 19
August 31 - September 2
September 14 - 16
September 28 - 30
October 12 - 14
November 2 - 4
November 16 - 18
December 7 - 9
December 14 - 16

UP-210  SunOS for Programmers  $1100

August 15 - 19
August 29 - September 2
September 12 - 16
September 26 - 30
October 10 - 14
October 31 - November 4
November 14 - 18
December 5 - 9
December 12 - 16

UP-220 Programming in C		$1000

September 19 - 23
November 7 - 11

UP-410  Programming 		$1200
        SunView Windows

September 19 - 23
October 10 - 14
October 24 - 28
November 7 - 11
November 14 - 18
November 28 - December 2

SA-250  System 			$1500
        Administration 3.x

August 22 - 26
August 29 - September 2
September 12 - 16
October 10 - 14
October 17 - 23
October 31 - November 4
November 28 - December 2

SA-270  System 			$1500
        Administration 4.0

November 7 - 11
December 5 - 9

------------------------------

End of SUN-Spots Digest
***********************



More information about the Comp.sys.sun mailing list