Sun-Spots-Request@Rice.edu (William LeFebvre) (10/21/88)
SUN-SPOTS DIGEST Wednesday, 19 October 1988 Volume 6 : Issue 267 Today's Topics: Re: ALM-2 and hardware flow control Re: Question about Window display lock broken after time limit Re: mounting remote tape drives Re: Laserwriter hanging with framedevice error Re: opinions on configuration wanted win_* calls Possible bug in c compiler under SunOS 3.3 ? Process hangs if its open NFS file is deleted by the server? Re: client making (includes source) Send contributions to: sun-spots@rice.edu Send subscription add/delete requests to: sun-spots-request@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@rice.edu" or mail the word "help" to the same address for more information. ---------------------------------------------------------------------- Date: Thu, 13 Oct 88 15:27:53 +0200 From: mcvax!tut.fi!vjk@uunet.uu.net Subject: Re: ALM-2 and hardware flow control wbh@hoh-2.att.com (Wilson H. Bent, Jr): > We though this was true, too, until Sun pointed us in the direction of "16 > Channel Asynchronous Line Multiplexer-2 Field Service Manual and > Installation Notes" (catchy title), Part No: 813-1029-05 of Dec 7, 1987, > Table 6-2: ports 0 through 3 have RTS, CTS, TXC, and RXC, ...... Well, I missed that too. *BUT* Hardware support is this case is not enough. You have to get mcp driver to really use those signals. What you can do depends on what version of SunOs you are running: SunOs 3.5: There's nothing you can do. SunOs 4.0: You can set flag CRTSCTS flag on some termio struct to get hardware flow control on *outgoing* stream. Now your only problem is how to set that flag. You *cannot* set it as default parameter of line. You cannot set it in getty(tab). You can set it with stty(1) once you have logged in (don't look manual, it's not there. Just write 'stty crtscts'). If you want to use that on printer or call-out-modem lines, you have to patch source of lpd, uucico, tip etc... to set it with ioctl. (What, no sources. Too bad). Looks bad, doesn't it. Vesa ------------------------------ Date: Mon, 17 Oct 88 08:54:17 EDT From: Chuck Musciano <chuck@trantor.harris-atd.com> Subject: Re: Question about Window display lock broken after time limit This error message occurs when a process locks the window system in order to perform some atomic task, like a confirmer window. The time limit is not wall clock, but CPU time used, and is rather small. You can ignore the message. I had it occur when I wrote a menu which dynamically builds submenus to match your file system. Since a menu display locks the window system, as I burned CPU time looking at the file system, I would break the lock. I believe you can dicker with the kernel to change the timeout, but the value is intertwined with all sorts of other window parameters and is best left alone. Chuck Musciano Advanced Technology Department Harris Corporation (407) 727-6131 ARPA: chuck@trantor.harris-atd.com ------------------------------ Date: Mon, 17 Oct 88 10:27:06 EDT From: bob@allosaur.cis.ohio-state.edu (Bob Sutterfield) Subject: Re: mounting remote tape drives Reference: v6n259 edsews!mancer!wintermute!dharvey@uunet.uu.net (Doug Harvey) writes: >Is it possible to access a remote tape drive without 'rlogin'ing to >the remote machine? You can't get to it in the same way as a local device, by MAKEDEV etc. That works in ATT RFS-land but not on a Sun (yet?). For backups, use rdump/rmt. If you want to write a tar tape, see the tar(1) manual page for an example incantation like: tar cvfb - 20 files | rsh krypton dd of=/dev/rmt0 obs=20b or the similar spell to read a tape: rsh krypton dd if=/dev/rmt0 bs=20b | tar xvBfb - 20 files Neither of these solutions requires you to have an interactive shell session on the machine with the tape drive (via rlogin or telnet or whatever). Since dump is run as root, rdump will require an entry in the tapeful machine's /.rhosts. The rsh/tar scheme will require an entry in the tapeful machine's /etc/hosts.equiv. --Bob ------------------------------ Date: Thu, 13 Oct 88 16:15:31 BST From: Paul Hudson <mcvax!moncam!paul@uunet.uu.net> Subject: Re: Laserwriter hanging with framedevice error Sounds like the LaserWriter doesn't have enough room to set up it's framebuffer. In normal use the LaserWriter reclaims memory used in each job, but there is a way of downloading stuff that survives from job to job. (Jargon is "outside the server loop"). I'd guess that one of your PostScript jobs is filling up VM outside the server loop - commonest way is to always download your stuff, rather than checking it's there already - and eventually leaving too little VM for normal operation. Paul Hudson Snail mail: Monotype ADG Email: ...!ukc!acorn!moncam!paul Science Park, paul@moncam.co.uk Milton Road, Cambridge, CB4 4FQ ------------------------------ Date: Mon, 17 Oct 88 10:19:55 -0400 From: Henry B.J. Krempel <krempel@pacrat.npac.syr.edu> Subject: Re: opinions on configuration wanted Reference: v6n259 >From: Steve Elias <eli@spdcc.com> >on the following setup: 1 sun 3/60 with 327M disk & tape drive, > 4 diskless sun 3/50 clients. I think you're going to have some trouble acquiring more memory "after-market" for your 50's. 4M is the maximum for that model. If you want to add inexpensive (but upgradeable) clients, your best bet is a 3/60, monochrome if you like, but color's only a couple of thou more (what's a few thou between friends?) 8M for clients is really suggested. Also, be sure you have more than 8M in the server (you don't want that to swap at all). If you must get 50's, the local swap disk is a good idea. As far as the disk performace goes, I'm skeptical about putting a lot of systems (especially swapping 50's) on that 327; but I'd be curious to hear if it works out. You might just make it with a 5-node network. ------------------------------ Date: Mon, 17 Oct 88 10:28:26 -0400 From: mesard@bbn.com Subject: win_* calls Phone: 617-873-1878 Anthony Worrall writes: > ...In order to create new windows I have used the call > > win_insert(windowfd); [and more about wmgr_* calls.] > > PS. If anybody else is using these functions I would be please to here any > experiences and/or tips they might care to pass on. In my experience, it is rarely necessary for an application to call the system level routines (i.e., those documented in the SunView System Programmer's Guide). I've coded in win_* calls many times, only to take them out a week later when I stumbled across a way to do the same thing at the application level. Of course there are exceptions. But by and large these are restricted to non-application-like things such as vuid input (cf. CM's eyecon program) or *intense* window-hacking (cf. DH's vine non-application). There is one time that I used a win_* call and nothing else would have sufficed (and it fits into my second category, above): win_screendestroy((int) window_get(frame, WIN_FD)); But calls to this function should be used sparingly in an application:-). ------------------------------ Date: 12 Oct 88 20:56:12 GMT From: Paul Harrington <mcvax!cs.tcd.ie!phrrngtn@uunet.uu.net> Subject: Possible bug in c compiler under SunOS 3.3 ? The following code was tested on a SUN 3/50 under SunOS 3.3. Depending on wheter you give an initialiser to the enum elements in the declaration of the type of p or not you get very different outputs from test_fn() ranging from 1,3,5 to 1,2,4 to 2,4,6 with my old favourite 2,3,4 when you say a=1,b=2,c=3 in the declaration of the type of p in test_fn() An RPC package called Courier generates this unusual type of code with parameter types being redeclared even for functions that have the same effective types for their parameters. why does the compiler (I don't know which compiler it is. I assume it is the standard one supplied with a SUN 3/50) produce this result and is it a bug of this compiler or a "feature" of C ? typedef struct { enum{a=1,b,c}choice; union{ int a; long b; short c; }u; }new_struct; typedef enum {e,f,g,h} e1; void test_fn1(p) struct { enum{a=1,b=2,c=3}choice; union{ int a; long b; short c; }u; }*p; { printf("the size of p is %d\n",sizeof(p)); printf("(test_fn1) a=%d,b=%d,c=%d\n",a,b,c); } main() { new_struct *v; printf("(main) a=%d,b=%d,c=%d\n",a,b,c); printf("the size of e1 is %d\n",sizeof(e1)); printf("the size of a is %d\n",sizeof(a)); test_fn1(v); } ------------------------------ Date: Mon, 17 Oct 88 08:32:12 EDT From: elsie!ado@ncifcrf.gov (Arthur David Olson) Subject: Process hangs if its open NFS file is deleted by the server? The scoop: "flower" is a diskless 3/60 that uses NFS-mounted disks provided by a 3/280 named "elsie"; both are running SunOS 4.0. This script shows what happens if flower opens a file and then elsie deletes it while flower has it open: Script started on Mon Oct 17 08:03:20 1988 flower$ tty /dev/ttyp0 flower$ cat try.c #include <stdio.h> main(argc, argv) int argc; char * argv[]; { register FILE * fp; register int c; fp = fopen("xyz", "w+"); (void) fprintf(fp, "This is only a test.\n"); (void) fflush(fp); if (argc > 1) (void) system("rsh elsie rm xyz"); (void) rewind(fp); while((c = getc(fp)) != EOF) (void) putchar(c); return 0; } flower$ cc try.c -o try flower$ try & [1] 171 [1] + Stopped(tty output) try & flower$ %1 try This is only a test. flower$ try + & [1] 172 >>>> flower$ [1] + Stopped (tty input) try + & ps -l#172 F UID PID PPID CP PRI NI SZ RSS WCHAN STAT TT TIME COMMAND 8021 102 172 162 7 5 0 48 208 T p0 0:00 try + flower$ exit You have stopped jobs flower$ exit script done on Mon Oct 17 08:04:49 1988 Heaven only knows where that "tty input" came from; in any event, if I were to bring the "try" process back into foreground at the marked point, it would be oblivious to any character I typed (specifically, in a "D" type sleep on "kernelmap"). And so the question: am I doing something wrong here, or is this a problem with SunOS 4.0? ado@ncifcrf.gov ADO is a trademark of Ampex. ------------------------------ Date: Mon, 17 Oct 88 11:04:04 EDT From: mcgrew@topaz.rutgers.edu (Charles) Subject: Re: client making (includes source) Reference: v6n260 Bennett Todd <bet@bent.mc.duke.edu> writes > Note that I didn't take the Sun approach of specifying the nd > locations out in the middle of partition C and hoping I get it > right. I don't know why Sun suggests that. ... because in a certain configuration, there aren't any partitions left (root, /usr.MC68010, /usr.MC68020, /pub.MC68010, /pub.MC68020, swap, whole-disk, and one for user files is 8, the max under bsd). Here's a program to generate nd.local files that you may find useful, it writes a file called nd.local into the current directory. The client names are just 'client-1', 'client-2', and so on. Your best bet is to create it somewhere besides /etc, then edit the result to add the name... /* this program is copyright 1988 by Charles McGrew, and is placed in * the public domain. It may be changed, enhanced, redistributed and * otherwised abused, as long as this copyright remains intact. If * you come up with neat enhancements, let me know! * mcgrew@topaz.rutgers.edu */ #include <stdio.h> main() { int both, /* 0 if its only 68010, 1 if only 68020, 2 if both */ partition, root_size, sector, swap_size, num_clients, little_swap_size, medium_swap_size, large_swap_size, little_swap_areas, medium_swap_areas, large_swap_areas, num_partition_types, pub_0_size, pub_1_size, offset; char reply; FILE *nd_file; printf("You should put client roots and swaps on cylinder boundaries\n"); printf("\n if you don't know how big a cylinder is in sectors, ^C this\n"); printf("and run /etc/dkinfo. Multiply the number of heads by the number\n"); printf("of sectors/track. That's the number of sectors per cylinder.\n"); printf("This program will keep things on the boundaries as long as you\n"); printf("start on a cylinder boundary and give sizes in cylinder boundaries\n"); printf("\n\n"); printf("how many clients?>"); scanf("%d", &num_clients); if ((num_clients < 1) || (num_clients > 15)) { printf("bad number - %d. try again.\n",num_clients); exit(0); }; retry: printf("are there 68010 AND 68020 clients here? (y/n)>"); scanf(" %c", &reply); if ((reply != 'y') && (reply != 'n')) { printf("say what?\n"); goto retry; }; if (reply == 'y') both = 2; if (reply == 'n') { retry2: printf("All 68020 (y/n)?>"); scanf(" %c", &reply); if ((reply != 'y') && (reply != 'n')) { printf("say what?\n"); goto retry2; }; if (reply == 'y') both = 1; else both = 0; }; printf("how may big a root in each client? (in sectors)>"); scanf("%d", &root_size); retry3: printf("how many different swap areas do you want to use (1,2, or 3)?>"); scanf("%d", &num_partition_types); if ((num_partition_types < 1) || (num_partition_types > 3)) { printf("bad number, try again\n"); goto retry3; }; if (num_partition_types > 1) printf("first "); printf("swap space size (in sectors)?>"); scanf("%d", &little_swap_size); if (num_partition_types > 1) { printf("second swap space size (in sectors)?>"); scanf("%d", &medium_swap_size); }; if (num_partition_types > 2) { printf("third swap space size (in sectors)?>"); scanf("%d", &large_swap_size); }; retry4: little_swap_areas = 0; medium_swap_areas = 0; large_swap_areas = 0; if (num_partition_types > 1) { printf("number of clients with first swap size?>"); scanf("%d",&little_swap_areas); printf("number of clients with second swap size?>"); scanf("%d",&medium_swap_areas); if (num_partition_types > 2) { printf("number of clients with third swap size?>"); scanf("%d",&large_swap_areas); }; if ((little_swap_areas + medium_swap_areas + large_swap_areas) != num_clients) { printf("numbers don't match, lets try again\n"); goto retry4; }; } else little_swap_areas = num_clients; pub_0_size = -1; pub_1_size = -1; if (both != 1) { printf("68010 pub partition size?>"); scanf("%d",&pub_0_size); }; if (both != 0) { printf("68020 pub partition size?>"); scanf("%d",&pub_1_size); }; printf("where does the partition begin (offset in sectors\n"); printf(" from 0 of /dev/xy0c)?>"); scanf("%d",&offset); nd_file = fopen("nd.local","w"); /* some setup lines */ fprintf(nd_file,"clear\n"); fprintf(nd_file,"version 1\n"); /* first the pub1 (68020) area, now offset from xy0f */ if (pub_1_size != -1) fprintf(nd_file,"user 0 1 /dev/xy0f 0 %d -1\n", pub_1_size); /* the pub0 (68010) area, offset from xy0e */ if (pub_0_size != -1) fprintf(nd_file,"user 0 0 /dev/xy0e 0 %d -1\n", pub_0_size); sector = offset; for(partition=0; partition < num_clients; partition++) { fprintf(nd_file,"user client-%d 0 /dev/xy0c %d %d %d\n", partition, sector, root_size, partition); sector += root_size; swap_size = little_swap_size; if (partition >= (little_swap_areas+medium_swap_areas)) swap_size = large_swap_size; else if (partition >= little_swap_areas) swap_size = medium_swap_size; fprintf(nd_file,"user client-%d 1 /dev/xy0c %d %d -1\n", partition, sector, swap_size); sector += swap_size; } fprintf(nd_file,"son\n"); printf("nd partition ends at sector %d\n",sector); } Commands of use in this sort of thing: /etc/mkfs - what to do is described in the admin manual, under 'adding a client to your system' /usr/etc/setup.files - copies one client partition to another (except devices. for those, you'll need to mount /dev/ndlX, where X is 0..numclients-1, then:) MAKEDEV std nd0 nd1 ndp0 ndp1 win0 win1 win2 pty0 pty1 pty2 bwtwo0 (to make the devices, in /mnt/dev) ... for the linking gag suggested by Bennett, I'd suggest also linking rc.local, /stand/diag and copy (you can rebuild the client from the server), and vmunix (to pub/vmunix). Hope that helps, Charles ------------------------------ End of SUN-Spots Digest ***********************