[comp.unix.aux] Why is tty1 not like tty0?

cb@bwilab3.UUCP (CB Genrich) (10/23/90)

Help wanted, --> please <--

I have not been able to get anything to work on my Macintosh II
printer port.  I can do most anything I want with the modem port
and, you would think, the printer port should be the same except
that /dev/tty1 or /dev/printer should be used instead of the
/dev/tty0 or /dev/modem character special files.  Can anyone out
there talk to a terminal or modem connected to the printer port?

I am working with a "just installed" system, and have accepted
all the defaults along the way.  The bottom line is that I would
like to do the following command and get the expected results:

  setport -r tty1

If I do this with tty0 everything works just fine.  I have 
noticed the following:

  1> the major/minor numbers are:
     
     tty0: 0/0
     tty1: 0/1
  
  2> the following program gives different results for the two:

     /**************************** short program *********/
     #include <stdio.h>
     #include <errno.h>

     main()
     {
       int result;

       result = open("/dev/tty0",O_WRONLY);

       printf("RESULT IS %d, ERRNO IS %d\n",result,errno);
     }
     /****************************************************/

     I get:

       RESULT IS 3, ERRNO IS 0
     
     if I use /dev/tty0 as shown, but:

       RESULT IS -1, ERRNO IS 6
      
     if I use /dev/tty1 as desired.

     Investigating, errno 6 is ENXIO, described as:

       No such device or address.  I/O on a special file refers to a
       subdevice which does not exist, or beyond the limits of the
       device.  It may also occur when, for example, a tape drive is
       not online or no disk pack is loaded on a drive.

     I would surely think that it is not the subaddress problem,
     since A/UX made the node for me during installation, and the
     commando dialog and the instructions say to us whichever you
     want to.

     All I can think is that something has "grabbed" my printer
     port, but not my modem port...something like AppleTalk???

     Otherwise the vaguely described "for example" problem should
     not occur on the printer port only, since the two are so very
     similar.

     I am pretty sure that this is the same problem other tricks are
     having, because of the messages they print.  For example:

       ls >/dev/tty0
    
     works fine (no messages), whereas:

       ls >/dev/tty1
       ksh: /dev/tty1: cannot create
    
     Also, getty on tty1 complains something like:

       getty: tty1: cannot create, No such device or address


  3> Under the heading "could something else be holding the port",
     Boot MacOS, open Chooser, AppleTalk set to "inactive".

     Boot A/UX, open Chooser, NO APPLETALK selection
       (i.e. my display does not match the manual),
       do not select anything.

     Restart (MacOS boots), open Chooser, AppleTalk now set
       to "active", even though I selected nothing ever in
       either of the Chooser windows.

     NOTE: the problem persists, even if I ensure that the
	   MacOS Chooser shows inactive before and after.

-CB-

{gatech|emory}!galbp!bwilab3!cb

alexis@panix.uucp (Alexis Rosen) (10/24/90)

Probably because Appletalk is running on it.

You can edit /etc/appletalkrc to change the bootup appletalk configuration.
You can also do (as root):
/etc/appletalk -d
although I don't know if it's smart enough to release the port for your use.
It probably is.

If you're not using appletalk, take it out of your kernel. You can save a fair
amount of space that way, which can have an appreciable impact on low-memory
systems.

---
Alexis Rosen
Owner/Sysadmin, PANIX Public Access Unix
{cmcl2,apple}!panix!alexis

thad@cup.portal.com (Thad P Floryan) (10/26/90)

alexis@panix.uucp (Alexis Rosen) in <1990Oct24.160940.22521@panix.uucp> writes:

	Probably because Appletalk is running on it.

	You can edit /etc/appletalkrc to change the bootup appletalk
	configuration.
	You can also do (as root):
	/etc/appletalk -d
	although I don't know if it's smart enough to release the port for
	your use. It probably is.

Omitted from the above is the actual edit required in /etc/appletalkrc.

What you NEED to do is replace "appletalk0" with "ethertalk0" in that file
after you've done the "/etc/appletalk -d".

The /etc/appletalkrc gets changed back every boot, so either find the script
that mucks with the file and fix it or manually copy over a "proper" copy of
the file after each boot; I haven't spent time looking for the culprit yet.

Then be sure to alter /etc/gettydefs and /etc/inittab (and do telinit Q) to
suit your requirements.

If you want to come in on the serial ports with terminals such as VT100, DT80,
VT200, or Falco, there are a LOT of other things you have to fix re: terminfo
and termcap databases since the stock distribution (both A/UX 1.* and 2.0) is
crap in these regards.  Missing, for example, are infocmp (complementing tic),
and the acsc (among other) strings in terminfo (you'll see what I mean if you
attempt to use EMACS remotely and wonder why you cannot scroll windows :-)

I've been meaning to post a list of things to fix the terminfo, termcap, and
improve curses support, but haven't had the time yet.  But, in essence, you
want to replace /etc/termcap with one from, say, ucbvax.berkeley.edu or from
ucbarpa.berkeley.edu, and also decompile all the terminfo database using the
infocmp on a real SV system (R3.*, R4 or even a 3B1), copy those *.ti files to
A/UX, and recompile using tic under A/UX.  These changes make a tremendous
capability and performance difference, besides supporting many terminals not
included in the A/UX 2.0 distribution.

Look at the man pages on a SVR3 system to see how to use infocmp; for some
reason, someone went through a lot of trouble to carefully REMOVE all the
references to infocmp in the man pages for terminfo under A/UX and to also
NOT include the infocmp program in the distribution; fortunately, tic does
accompany A/UX 2.0 and has a man page.  And, luckily, tic doesn't coredump
when it encounters terminfo capabilties not supported under A/UX 2.0 (it
simply ignores them).

Thad Floryan [ thad@cup.portal.com (OR) ..!sun!portal!cup.portal.com!thad ]