9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* sparc fileservers
@ 1993-11-02  4:32 David
  0 siblings, 0 replies; 9+ messages in thread
From: David @ 1993-11-02  4:32 UTC (permalink / raw)


> From:	Arnold Robbins <arnold@cc.gatech.edu>
> To:	9fans@cse.psu.edu
> 
> Heck, can any of the plan 9 stuff run on the newer sparcs like the LX,
> or the big MPs like the 690 or sparc center 1000 and 2000?  (Junk Solaris
> for a real OS... :-)

Not without rewriting mmu.c.  I understand that the mmu in the
newer sparcs is based on the Sparc Reference mmu, whereas the
mmu in the older sparcs is a lot closer to the Sun 3 mmu.  I've
also heard that the dma controller is different.




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

* sparc fileservers
@ 1993-11-03  7:28 mike
  0 siblings, 0 replies; 9+ messages in thread
From: mike @ 1993-11-03  7:28 UTC (permalink / raw)


>| In fact, we have Plan 9 running here at UO using only the Unix
>| based file server, since right now there are no spare machines
>| to dedicate a Plan 9 file server.
>
>That's more or less our situation as well.  In a previous message you
>said that you were running with hacked sources and lots of things
>didn't work.  I'm interested in hearing more about what you've done and
>how things are working out these days.

Well, since several people have asked, I've included our diffs (with
explanations) to u9fs at the end of this message.  Note that they are
not quite the same as the Bell Labs diffs that Rob mailed out awhile
back--I had already discovered and fixed some of the problems
independently.

Most things I've tried seem to work Ok; the exception is the postscript
interpreter psi, which crashes for me on both the Sparc and the 68020,
in apparently the same way.  I have not put any deep debugging effort
into it.  Also, psi worked fine when I tried it on a 486 using kfs.
So I suspect psi may be interacting with u9fs in some strange way.

As for how I originally got Plan 9 up and working on a sparc
without a fileserver and without bootp, roughly:

0.  compiled u9fs on some convenient unix box; install in inetd.conf.
    contrary to the README in the u9fs source directory, plan 9 expects
    to find u9fs on port 564 (see /lib/ndb/local on the cdrom).
1.  boot plan9 off the cdrom
    i actually put the sparc/9sscd kernel in the SunOS root directory and
    used "b sd()9sscd".
2.  manually configure the network with ipconfig
3.  use "srv tcp!1.2.3.4" and then "mount -c /srv/tcp!1.2.3.4 /n/kremvax"
    to get the Unix system mounted on /n/kremvax.  used /n/kremvax as
    a scratch area to build a modified kernel.
4.  the kernel sources are in /sys/src/9.
    i looked at /sys/src/9/boot/ip.c, which uses bootp to get various
    information, and used it as a prototype for a new boot method which
    asks the user to manually enter all that information.
    then, i used the "/sys/src/9/ss/sscd" configuration as a prototype
    to create a new "ssuo" configuration, and built my modified kernel
    with "mk 'CONF=ssuo'" in the ss/ directory.

Disclaimer: as with all free advice, this is worth what it cost.
These things worked for me, but I didn't keep notes and so this is
all from 6-month-old memory.  Similar disclaimer applies to the u9fs
diffs below.


Here are our patches for u9fs; they do the following things:

* fix a bug in the handling of seek offsets
* set the qid.version field from the stat.st_mtime field, rathern than 0.
  this makes executable caching work correctly.
* hacks to increase the descriptor table size limit under
  SunOS (#define DTABLE) and Dynix/PTX (#define SETDTABLESIZE).  this is
  important since plan 9 keeps open file descriptors to recently
  used executables, and without this change u9fs quickly runs out
  of descriptors.
* a hack to make u9fs work correctly with the Dynix/PTX inetd,
  and perhaps other System V.3 implementations as well (#define TIRDWR).
* a hack to make Plan 9 systems get the right system date when booting.
  Plan 9 gets the system date from the access time of "/".  therefore,
  we read "/" before accepting any requests from the remote Plan 9.
* implement the ORCLOSE remove-on-close option used by Plan 9 programs
  that create temporary files.

diff -rc2 dist/u9fs.c u9fs.c
*** dist/u9fs.c	Sat Mar 20 04:34:51 1993
--- u9fs.c	Sun Apr 18 15:58:48 1993
***************
*** 8,11 ****
--- 8,18 ----
  #include "pwd.h"
  #include "grp.h"
+ #ifdef TIRDWR
+ #include <stropts.h>
+ #endif
+ #ifdef DTABLE
+ #include <sys/time.h>
+ #include <sys/resource.h>
+ #endif
  
  #define	DBG(f)
***************
*** 37,40 ****
--- 44,48 ----
  	int		fd;
  	DIR		*dir;
+ 	int		tempf;
  };
  
***************
*** 132,135 ****
--- 140,159 ----
  main(int argc, char *argv[])
  {
+ #ifdef TIRDWR
+ 	ioctl(0, I_PUSH, "tirdwr");
+ #endif
+ #ifdef SETDTABLESIZE
+ 	setdtablesize(256);
+ #endif
+ #if defined(DTABLE) && defined(RLIMIT_NOFILE)
+ 	{
+ 		struct rlimit rl;
+ 		getrlimit(RLIMIT_NOFILE, &rl);
+ 		rl.rlim_cur = rl.rlim_max;
+ 		if (rl.rlim_cur > 1024)
+ 			rl.rlim_cur = 1024;
+ 		setrlimit(RLIMIT_NOFILE, &rl);
+ 	}
+ #endif
  	freopen(LOG, "a", stderr);
  	setbuf(stderr, (void*)0);
***************
*** 243,246 ****
--- 267,281 ----
  	Pass *p;
  
+ 	/*
+ 	 * The following hack will force Plan 9 to get the right
+ 	 * system date when we are booting off a Unix server.
+ 	 */
+ 	{
+ 		DIR *dp;
+ 		dp = opendir("/");
+ 		readdir(dp);
+ 		closedir(dp);
+ 	}
+ 
  	err = 0;
  	if(file0 == 0){
***************
*** 343,347 ****
  	int fd;
  	DIR *dir;
! 	int m, trunc;
  
  	rf = rfilefid();
--- 378,382 ----
  	int fd;
  	DIR *dir;
! 	int m, trunc, tempf;
  
  	rf = rfilefid();
***************
*** 353,356 ****
--- 388,392 ----
  	m = rhdr.mode & (16|3);
  	trunc = m & 16;	/* OTRUNC */
+ 	tempf = rhdr.mode & 64;		/* ORCLOSE */
  	switch(m){
  	case 0:
***************
*** 402,405 ****
--- 438,442 ----
  	rf->fd->dir = dir;
  	rf->fd->offset = 0;
+ 	rf->fd->tempf = tempf;
  	thdr.qid = f->qid;
  }
***************
*** 411,415 ****
  	File *f, *of;
  	char *path, *err;
! 	int fd;
  	int m;
  	char name[NAMELEN];
--- 448,452 ----
  	File *f, *of;
  	char *path, *err;
! 	int fd, tempf;
  	int m;
  	char name[NAMELEN];
***************
*** 421,424 ****
--- 458,462 ----
  	path = bldpath(rf->file->path, rhdr.name, name);
  	m = omode(rhdr.mode&3);
+ 	tempf = rhdr.mode & 64;		/* ORCLOSE */
  	errno = 0;
  	if(rhdr.perm & CHDIR){
***************
*** 479,482 ****
--- 517,521 ----
  	rf->fd->dir = 0;
  	rf->fd->offset = 0;
+ 	rf->fd->tempf = tempf;
  	thdr.qid = f->qid;
  }
***************
*** 535,539 ****
  			strncpy(d.gid, id2name(gid, stbuf.st_gid), NAMELEN);
  			d.qid.path = qid(&stbuf);
! 			d.qid.vers = 0;
  			d.mode = (d.qid.path&CHDIR)|(stbuf.st_mode&0777);
  			d.atime = stbuf.st_atime;
--- 574,578 ----
  			strncpy(d.gid, id2name(gid, stbuf.st_gid), NAMELEN);
  			d.qid.path = qid(&stbuf);
! 			d.qid.vers = stbuf.st_mtime;
  			d.mode = (d.qid.path&CHDIR)|(stbuf.st_mode&0777);
  			d.atime = stbuf.st_atime;
***************
*** 546,552 ****
  	}else{
  		errno = 0;
! 		if(rf->fd->offset != rhdr.offset)
  			if(lseek(rf->fd->fd, rhdr.offset, 0) < 0)
  				errjmp(sys_errlist[errno]);
  		n = read(rf->fd->fd, rdata, rhdr.count);
  		if(n < 0)
--- 585,593 ----
  	}else{
  		errno = 0;
! 		if(rf->fd->offset != rhdr.offset) {
  			if(lseek(rf->fd->fd, rhdr.offset, 0) < 0)
  				errjmp(sys_errlist[errno]);
+ 			rf->fd->offset = rhdr.offset;
+ 		}
  		n = read(rf->fd->fd, rdata, rhdr.count);
  		if(n < 0)
***************
*** 570,576 ****
  		errjmp(Etoolarge);
  	errno = 0;
! 	if(rf->fd->offset != rhdr.offset)
  		if(lseek(rf->fd->fd, rhdr.offset, 0) < 0)
  			errjmp(sys_errlist[errno]);
  	n = write(rf->fd->fd, rhdr.data, rhdr.count);
  	if(n < 0)
--- 611,619 ----
  		errjmp(Etoolarge);
  	errno = 0;
! 	if(rf->fd->offset != rhdr.offset) {
  		if(lseek(rf->fd->fd, rhdr.offset, 0) < 0)
  			errjmp(sys_errlist[errno]);
+ 		rf->fd->offset = rhdr.offset;
+ 	}
  	n = write(rf->fd->fd, rhdr.data, rhdr.count);
  	if(n < 0)
***************
*** 688,691 ****
--- 731,742 ----
  			if(fd->dir)
  				closedir(fd->dir);
+ 			if (fd->tempf & 64) {	/* ORCLOSE */
+ 				if (f->qid.path & CHDIR)
+ 					ret = rmdir(f->path);
+ 				else
+ 					ret = unlink(f->path);
+ 				if (ret)
+ 					err = sys_errlist[errno];
+ 			}
  			free(fd);
  		}
***************
*** 760,764 ****
  	}
  	f->qid.path = qid(&stbuf);
! 	f->qid.vers = 0;
  	f->stbuf = stbuf;
  	return 0;
--- 811,815 ----
  	}
  	f->qid.path = qid(&stbuf);
! 	f->qid.vers = stbuf.st_mtime;
  	f->stbuf = stbuf;
  	return 0;




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

* sparc fileservers
@ 1993-11-02  4:02 Scott
  0 siblings, 0 replies; 9+ messages in thread
From: Scott @ 1993-11-02  4:02 UTC (permalink / raw)



| In fact, we have Plan 9 running here at UO using only the Unix
| based file server, since right now there are no spare machines
| to dedicate a Plan 9 file server.

That's more or less our situation as well.  In a previous message you
said that you were running with hacked sources and lots of things
didn't work.  I'm interested in hearing more about what you've done and
how things are working out these days.






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

* sparc fileservers
@ 1993-11-01 23:27 Mike
  0 siblings, 0 replies; 9+ messages in thread
From: Mike @ 1993-11-01 23:27 UTC (permalink / raw)


>| Yes, it should work on an IPC or SLC.  We currently use an IPC as the
>| fileserver here.  You need the patches that were sent out a while back,
>| however, for it to work.
>
>The catch, of course, is that one needs a working system in order to
>install the patches. :-)

Not so.

You need a working Plan 9 terminal, but not necessarily a working
file server.

You can boot the terminal kernel directly off the Plan 9 cdrom.
Set up a unix based file server (using u9fs) on some machine
with lots of disk.

Mount the Unix system somewhere in the heirarchy (e.g., /n/kremvax
is included as a possible mountpoint on the cdrom.)

Copy the kernel sources to the Unix server.
Modify them according to the patches.
Compile, and build.

In fact, we have Plan 9 running here at UO using only the Unix
based file server, since right now there are no spare machines
to dedicate a Plan 9 file server.

Note that there were a few bugs in u9fs as originally distributed,
but Rob sent some patches out around March or April for fixing them.




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

* sparc fileservers
@ 1993-11-01 22:56 Scott
  0 siblings, 0 replies; 9+ messages in thread
From: Scott @ 1993-11-01 22:56 UTC (permalink / raw)



| Yes, it should work on an IPC or SLC.  We currently use an IPC as the
| fileserver here.  You need the patches that were sent out a while back,
| however, for it to work.

The catch, of course, is that one needs a working system in order to
install the patches. :-)

Thanks for the reply.




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

* sparc fileservers
@ 1993-11-01 22:06 Dean
  0 siblings, 0 replies; 9+ messages in thread
From: Dean @ 1993-11-01 22:06 UTC (permalink / raw)


> Greetings,
> 
> The installation instructions mention that the fileserver code probably
> won't work on anything other than a sparcstation 2.  Has anyone tried
> bringing it up on an IPC or SLC or something like that?
> 
> -- Scott

Yes, it should work on an IPC or SLC.  We currently use an IPC as the
fileserver here.  You need the patches that were sent out a while back,
however, for it to work.

dl




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

* sparc fileservers
@ 1993-11-01 19:36 Jim
  0 siblings, 0 replies; 9+ messages in thread
From: Jim @ 1993-11-01 19:36 UTC (permalink / raw)


On Mon, 1 Nov 1993, Scott Schwartz wrote:

> The installation instructions mention that the fileserver code probably
> won't work on anything other than a sparcstation 2.  Has anyone tried
> bringing it up on an IPC or SLC or something like that?

Tried it on my IPC, but it just hung after the download stage. 
--
Jim Davis               | "So here I am, not being entertained."
jdavis@cs.arizona.edu   |   -- Calvin





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

* sparc fileservers
@ 1993-11-01 19:33 Arnold
  0 siblings, 0 replies; 9+ messages in thread
From: Arnold @ 1993-11-01 19:33 UTC (permalink / raw)


Heck, can any of the plan 9 stuff run on the newer sparcs like the LX,
or the big MPs like the 690 or sparc center 1000 and 2000?  (Junk Solaris
for a real OS... :-)

Arnold




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

* sparc fileservers
@ 1993-11-01 19:10 Scott
  0 siblings, 0 replies; 9+ messages in thread
From: Scott @ 1993-11-01 19:10 UTC (permalink / raw)


Greetings,

The installation instructions mention that the fileserver code probably
won't work on anything other than a sparcstation 2.  Has anyone tried
bringing it up on an IPC or SLC or something like that?

-- Scott




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

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

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-11-02  4:32 sparc fileservers David
  -- strict thread matches above, loose matches on Subject: below --
1993-11-03  7:28 mike
1993-11-02  4:02 Scott
1993-11-01 23:27 Mike
1993-11-01 22:56 Scott
1993-11-01 22:06 Dean
1993-11-01 19:36 Jim
1993-11-01 19:33 Arnold
1993-11-01 19:10 Scott

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