From: Tom Christiansen <tchrist@convex.COM>
Subject: Re: PLUM under AIX
Originator: tchrist@pixel.convex.com
Reply-To: tchrist@convex.COM (Tom Christiansen)
Organization: CONVEX Realtime Development, Colorado Springs, CO
Date: Thu, 23 Jul 1992 20:19:41 GMT
X-Disclaimer: This message was written by a user at CONVEX Computer
              Corp. The opinions expressed are those of the user and
              not necessarily those of CONVEX.

From the keyboard of acker@se01.wg2.waii.com:
:Has anyone gottten PLUM to work under AIX? I can't get the sysconf.pl
:file right ....

Perhaps this will help.  Haven't tried it myself.

------- Forwarded Message

Date:         Mon, 20 Jan 92 17:03:09 -0600
From:         Rich Coe IBM Field Quality Programming <ibmsupt!ibmpa!buscfg.austin.ibm.com!rhcoe@uunet.UU.NET>
Subject:      plum blues
To:           tchrist@uunet.UU.NET (Tom Christiansen)




Hi Tom.

I was trying out your `plum' program and wanted to let you know my
results.

environment ibm rs/6000 

1) AIX is a posix based system, so I chose the posix route, rather than
   BSD or svid.  I had to change the values to match my system.

   Here's a copy of the sysconf.pl file:

# BEGIN IBM RS/6000 short cut config file.  

# h2ph generates something like this...

sub ICANON  { 0x00000002; }
sub ECHO    { 0x00000008; }
sub VTIME   { 5; }
sub VMIN    { 4; }
sub IEXTEN  { 0x00200000; }

sub B1200   { 0x9; }


# c2ph generates something like this....

STRUCT_TERMIOS: {
    package termios;

    sub typedef                   { 'L4 C17'; }

    sub c_iflag                  {    0; }
    sub c_oflag                  {    1; }
    sub c_cflag                  {    2; }
    sub c_lflag                  {    3; }
    sub c_cc                     {    4; }
}

($SYSTEM, $VENDOR) = (POSIX, IBM);

# END IBM RS/6000 short cut config file.  

2) IBM's termios.h (perl termios.ph) resides in "/usr/include", not 
   "/usr/include/sys"; and 'sys/termio.ph' needs to be included to
   get some defines.  I added a config_IBM (see below).  For the time
   being, I neutered the 'sys' in the config_POSIX so that it would load
   termios.

sub config_IBM {
    &config_POSIX;

    local(@need) = ( TIOCGWINSZ, TCGETA, TCSETA );

    require 'sys/termio.ph'                     if &needdef(@need);
    die "require definitions for @need"         if @need = &needdef(@need);

    ($GETIOCTL, $SETIOCTL)  = (TCGETA, TCSETA);
}

3) TIOCGWINSZ isn't set to the ioctl value, its set to zero.  I'll have
   to dig into this one.

4) ispeed/ospeed isn't kept in a seperate line in the termios struct
   so I rewrote the lines in `tty_stuff'.
***************
*** 2223,2230 ****
        $my_erase = pack('c', $termios[&termios'c_cc + &VERASE]);
        $my_kill = pack('c', $termios[&termios'c_cc + &VKILL]);

!       $ispeed = $termios[&termios'c_ispeed];
!       $ospeed = $termios[&termios'c_ospeed];

      } elsif ($SYSTEM =~ /BSD/i || $VENDOR =~ /Sun/i) {
        local($sgttyb, @sgttyb);
- --- 2222,2233 ----
        $my_erase = pack('c', $termios[&termios'c_cc + &VERASE]);
        $my_kill = pack('c', $termios[&termios'c_cc + &VKILL]);
 
!       if ($VENDOR !~ /IBM/i) {
!           $ispeed = $termios[&termios'c_ispeed];
!           $ospeed = $termios[&termios'c_ospeed];
!       } else {
!           $ispeed = $ospeed = $termios[&termios'c_cflag] & &CBAUD;
!       }
 
      } elsif ($SYSTEM =~ /BSD/i || $VENDOR =~ /Sun/i) {
        local($sgttyb, @sgttyb);

5) For some reason the code doesn't get the terminal in to/out of 
   cbreak mode.  I haven't found out why, yet.

Regards, Rich Coe
- -----
UUCP: ...!uunet!ibmsupt!rhcoe                         IBM AIX BOS Field Quality
Internet: rhcoe@aixwiz.austin.ibm.com                 Austin, TX
internal: rhcoe@buscfg.austin.ibm.com                 VNET: rhcoe@ausvmq

------- End of Forwarded Message

-- 
    Tom Christiansen      tchrist@convex.com      convex!tchrist


    A programmer is a machine for converting coffee into code.