From owner-freebsd-hackers Wed May 22 20:11:10 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id UAA02784 for hackers-outgoing; Wed, 22 May 1996 20:11:10 -0700 (PDT) Received: from nightmare.dreamchaser.org ([207.40.47.18]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id UAA02762 for ; Wed, 22 May 1996 20:11:05 -0700 (PDT) Received: from mofo (mofo.dreamchaser.org [206.230.42.91]) by nightmare.dreamchaser.org (8.6.12/8.6.12) with SMTP id VAA11245; Wed, 22 May 1996 21:10:30 -0600 Message-ID: <31A3D728.4232@ics.com> Date: Wed, 22 May 1996 21:10:32 -0600 From: Gary Aitken Organization: Integrated Computer Solutions X-Mailer: Mozilla 3.0b3 (X11; I; SunOS 5.4 sun4c) MIME-Version: 1.0 To: Sean Eric Fagan , jkh@time.cdrom.com CC: freebsd-hackers@freebsd.org Subject: Re: stty -- not References: <199605230047.RAA10020@kithrup.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk OK, guys, I'm now totally confused; either the handbook is totally messed up, sean's wrong, something doesn't work, or I should go stick my head in the sand. Probably the latter. The handbook implies hex numbers are allowed: bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :sh:sd=/var/spool/lpd/bamboo:\ :lp=/dev/ttyd5:fs#0x82000e1:xs#0x820:\ ^^^^^^^^^^^^ > For one thing, the fs/fc/xs/xc bits have to be in octal. Which is correct? (I've tried all three combos: 0x10, 020, and 16) > Then, you need to have the opost bit set, whatever that works out to being. The handbook says to set the CRMOD bit, and to look in /usr/include/sys/ioctl_compat.h I tried that using fs#0x10, fs#020, and fs#16, to no avail; so, taking sean's advice, I found OPOST and ONLCR in termios.h, and tried fs#3, also to no avail. So then I tried covering the world with 0xff, 0377, and 255, but got nowhere. I finally got worried about whether it was even looking at printcap, so I changed the baud rate in printcap and got garbage, so I know it's reading the right file, anyway. So... How the heck *do* you turn those bits on, and what are the right ones? There appears to be some confusion about which set of bits should be used: the ones in termios.h which correspond to termios.c_iflag, c_oflag, c_cflag, and c_lflag, and which would imply OPOST | ONLCR; and which are not referenced in the handbook the ones in ioctl_compat.h which correspond to sgttyb.sg_flags (?), which is defined as a short and doesn't have room for all the possible flags listed (I probably just don't understand how they're used here); and which would imply CRMOD Neither ones seem to do the job for me. I know I'm going to feel stupid when this is done... I did manage to get a inserted, but only by manually configuring the printer using: stty -f /dev/ttyid1 opost onlcr stty -f /dev/ttyld1 opost onlcr Attempting to manually configure the device using the locked device alone, or the initialization device alone, did not work. One can specifically set the initialization and locked state using stty. Does using the - version of a flag lock them off, or simply return them to their default, unlocked, condition? If it locks them off, how does one return them to "default"? i.e. stty -f /dev/ttyld1 opost onlcr locks opost onlcr on if stty -f /dev/ttyld1 -opost -onlcr locks opost onlcr off then How does one return them to "unlocked", so other settings will take effect? If they lock both on and off, then my problem may be that I twiddled these bits before I got the printcap entry correct. -- Gary Aitken garya@ics.com (business) garya@dreamchaser.org (personal)