Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Sun, 4 Feb 2001 04:11:31 +0200 From: Baurjan Ismagulov To: cygwin AT sources DOT redhat DOT com Subject: serial terminal Message-ID: <20010204041131.A22268@kerberos.local.ankara.gantek.com> Mail-Followup-To: cygwin AT sources DOT redhat DOT com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=mnb User-Agent: Mutt/1.2.5i Hi, I've got an HP 700/60 serial terminal connected to COM2. I want to be able to start a shell there. I couldn't see getty in the distribution, so I've tried to run bash with stdin and stdout set to COM2. I wrote a program replacing standard descriptors with a serial device one (it was somewhat difficult to figure out that the port is accessible via /dev/com2; long live mailing list archives): #include int main(int argc, char **argv) { int fd = open("/dev/com2", O_RDWR); close(0); close(1); dup(fd); dup(fd); execlp("/bin/bash", "/bin/bash", NULL); } Basically, it works: commands are taken from the terminal, and output from most commands is sent there. But the output is pretty broken (e.g., newline's are displayed as LF, causing stair-stepping), bash prompt is displayed on the console, command line isn't displayed anywhere, using less freezes the session. Tweaking with "stty onlcr" and similar stuff didn't give any results ("stty -a" output suggests that these options are ignored). I want to have a reasonably usable terminal (at least bash and less), any ideas where to look? BTW, prompts of Win32 console applications (such as Oracle sqlplus, F-Secure ssh) are displayed twice, as if an Enter is stuffed at startup, and the program displays a second prompt. why? I'm using cygwin-1.1.6-1 (setup.exe 2.29, downloaded on Dec 25, 2000 from yggdrasil.com, full install, no updates) on Win98 SE. *Any* help would be greatly appreciated. Thanks in advance, Baurjan. P.S. I also tried "bash com2" and "bash >com2 &0 com2" replaced only stdin and stdout, respectively, leaving the console as the other descriptor. "bash &0" and "bash >com2 0<&1" produced more strange results. I wrote a simple Win32 program trying to set standard handles to a handle obtained via CreateFile("COM2", ...) and executing bash afterwards. SetStdHandle failed with ERROR_INVALID_HANDLE :( . "cygcheck -s -v -r" output: Cygnus Win95/NT Configuration Diagnostics Current System Time: Sun Feb 4 04:07:25 2001 Win9X Ver 4.10 build 67766446 A Path: /usr/local/bin /usr/local/sbin /usr/local/bin /usr/bin /bin /cygdrive/c/OPT/ORACLE0/JRE/1.1.7/BIN /cygdrive/c/OPT/ORACLE0/BIN /cygdrive/c/WINDOWS /cygdrive/c/WINDOWS/COMMAND /cygdrive/c/UTIL/NC/VC5 /cygdrive/c/UTIL/NC/VIEW/HIEW /cygdrive/c/UTIL/NC/VIEW /cygdrive/c/UTIL/NC/MC /cygdrive/c/UTIL/BIN /cygdrive/c/UTIL/NU /cygdrive/c/UTIL/ARC /cygdrive/c/UTIL/ME /cygdrive/c/UTIL/MISC /cygdrive/c/UTIL/DISK /cygdrive/c/UTIL/VIDEO /cygdrive/c/UTIL/DRV/NLS/RU /cygdrive/c/UTIL/LINUX /cygdrive/c/UTIL/LINUX/DOSEMU /cygdrive/c/UTIL/WIN /cygdrive/c/PROGRA~1/BORLAND/CBUILD~2/BIN /cygdrive/c/PROGRA~1/BORLAND/CBUILD~2/PROJECTS/BPL /cygdrive/c/PROGRA~1/DATAFE~1/F-SECURE/SSH2TR~1/PROGRAM /cygdrive/c/OPT/LYNX /cygdrive/c/OPT/GNAT/BIN /cygdrive/c/OPT/JDK118/BIN /cygdrive/c/OPT/BC31/BIN /cygdrive/c/OPTBC5/BIN /cygdrive/c/OPT/SOURCER6 /cygdrive/c/TMP/IBR/PRG/FLASH /cygdrive/c/PROGRA~1/BORLAND/VBROKER/BIN /cygdrive/c/PROGRA~1/BORLAND/VBROKER/JRE/BIN /cygdrive/c/PROGRA~1/BORLAND/DELPHI5/BIN /cygdrive/c/PROGRA~1/BORLAND/DELPHI5/PROJECTS/BPL /BORLAND/CBUILD~1/BIN /cygdrive/c/PROGRA~1/BORLAND/CBUILD~2/BIN /cygdrive/c/PROGRA~1/BORLAND/CBUILD~2/PROJECTS/BPL SysDir: C:\WINDOWS\SYSTEM WinDir: C:\WINDOWS PWD = `/cygdrive/c/tmp/ibr' USER = `ibr' MAKE_MODE = `unix' HOME = `/cygdrive/c/tmp/ibr' PROMPT = `$p$g' COMSPEC = `C:\COMMAND.COM' !C: = `C:\opt\cygwin\bin' CMDLINE = `bash --login -i' HOSTNAME = `ALATAU' !D: = `D:\public_html\book\ANEKDOTY\FEINMAN' LS_OPTIONS = `-bF --color=tty' WINDIR = `C:\WINDOWS' WINBOOTDIR = `C:\WINDOWS' PS1 = `\u@\h:\w\$ ' BLASTER = `A220 I5 D1 H1 REC3 T6 P330' I = `c:\tmp\ibr' MACHTYPE = `i686-pc-cygwin' OLDPWD = `/usr/bin' TEMP = `/cygdrive/c/WINDOWS/TEMP' SHLVL = `1' VBROKERDIR = `C:\PROGRA~1\BORLAND\VBROKER' SHELL = `/bin/bash' HOSTTYPE = `i686' OSTYPE = `cygwin' TERM = `cygwin' _ = `/usr/bin/cygcheck' TZ = `GTBST-2GTBDT-3,M3.5.0/2,M10.5.0/3' HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu\&Programs\Products\Cygnus Solutions (default) = (unsupported type) HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu\&Programs\Cygnus Solutions (default) = (unsupported type) HKEY_CURRENT_USER\Software\Cygnus Solutions HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0 HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\00 (default) = `\\.\tape1:' unix = `/dev/st1' fbinary = 0x00000000 fsilent = 0x00000001 fmixed = 0x00000000 HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\01 (default) = `\\.\tape0:' unix = `/dev/st0' fmixed = 0x00000000 fbinary = 0x00000000 fsilent = 0x00000001 HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\02 (default) = `\\.\b:' unix = `/dev/fd1' fmixed = 0x00000000 fbinary = 0x00000000 fsilent = 0x00000001 HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\03 (default) = `\\.\a:' unix = `/dev/fd0' fmixed = 0x00000000 fbinary = 0x00000000 fsilent = 0x00000001 HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\04 (default) = `C:' unix = `/' fmixed = 0x00000000 fbinary = 0x00000000 fsilent = 0x00000000 HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2 (default) = `/cygdrive' cygdrive flags = 0x00000022 HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options HKEY_LOCAL_MACHINE\Software\Cygnus Solutions HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\GNUPro HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\GNUPro\i586-cygwin32 HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0 HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\00 HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\01 HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\02 HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\03 HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\04 HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\05 HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\06 HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\07 HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\08 HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\09 HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0A HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0B HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0C HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0D HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0E HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0F HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\10 HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\11 HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\12 HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\13 HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\14 HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\15 HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\16 HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\17 HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\18 HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\19 HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1A HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1B HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1C HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1D HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\Cygwin HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\Cygwin\mounts v2 HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\Cygwin\mounts v2\/ (default) = `C:/opt/cygwin' flags = 0x0000000a HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\Cygwin\mounts v2\/usr/bin (default) = `C:/opt/cygwin/bin' flags = 0x0000000a HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\Cygwin\mounts v2\/usr/lib (default) = `C:/opt/cygwin/lib' flags = 0x0000000a HKEY_LOCAL_MACHINE\Software\Cygnus Solutions\Cygwin\Program Options a: fd N/A N/A c: hd FAT32 4392Mb 72% CP UN d: cd N/A N/A C:\opt\cygwin\bin /usr/bin system binmode C:\opt\cygwin\lib /usr/lib system binmode C:\opt\cygwin / system binmode Found: C:\opt\cygwin\bin\bash.exe Found: c:\UTIL\BIN\bash.exe Warning: C:\opt\cygwin\bin\bash.exe hides c:\UTIL\BIN\bash.exe Found: C:\opt\cygwin\bin\cat.exe Found: c:\UTIL\BIN\cat.exe Warning: C:\opt\cygwin\bin\cat.exe hides c:\UTIL\BIN\cat.exe Found: C:\opt\cygwin\bin\cpp.exe Found: c:\OPT\BC31\BIN\cpp.exe Warning: C:\opt\cygwin\bin\cpp.exe hides c:\OPT\BC31\BIN\cpp.exe Found: C:\opt\cygwin\bin\find.exe Found: c:\WINDOWS\COMMAND\find.exe Warning: C:\opt\cygwin\bin\find.exe hides c:\WINDOWS\COMMAND\find.exe Found: c:\UTIL\BIN\find.exe Warning: C:\opt\cygwin\bin\find.exe hides c:\UTIL\BIN\find.exe Found: C:\opt\cygwin\bin\gcc.exe Found: C:\opt\cygwin\bin\gdb.exe Found: C:\opt\cygwin\bin\ld.exe Found: C:\opt\cygwin\bin\ls.exe Found: C:\opt\cygwin\bin\make.exe Found: c:\PROGRA~1\BORLAND\CBUILD~2\BIN\make.exe Warning: C:\opt\cygwin\bin\make.exe hides c:\PROGRA~1\BORLAND\CBUILD~2\BIN\make.exe Found: c:\OPT\BC31\BIN\make.exe Warning: C:\opt\cygwin\bin\make.exe hides c:\OPT\BC31\BIN\make.exe Found: c:\PROGRA~1\BORLAND\DELPHI5\BIN\make.exe Warning: C:\opt\cygwin\bin\make.exe hides c:\PROGRA~1\BORLAND\DELPHI5\BIN\make.exe Found: C:\opt\cygwin\bin\sh.exe 56k 2000/12/03 C:\opt\cygwin\bin\cygbz21.0.dll - os=4.0 img=1.0 sys=4.0 "cygbz21.0.dll" v0.0 ts=2000/11/21 1:53 81k 2000/12/05 C:\opt\cygwin\bin\cygitcl30.dll - os=4.0 img=1.0 sys=4.0 "cygitcl30.dll" v0.0 ts=2000/11/26 3:43 35k 2000/12/05 C:\opt\cygwin\bin\cygitk30.dll - os=4.0 img=1.0 sys=4.0 "cygitk30.dll" v0.0 ts=2000/11/26 3:43 390k 2000/12/05 C:\opt\cygwin\bin\cygtcl80.dll - os=4.0 img=1.0 sys=4.0 "cygtcl80.dll" v0.0 ts=2000/11/26 3:39 5k 2000/12/05 C:\opt\cygwin\bin\cygtclpip80.dll - os=4.0 img=1.0 sys=4.0 10k 2000/12/05 C:\opt\cygwin\bin\cygtclreg80.dll - os=4.0 img=1.0 sys=4.0 "cygtclreg80.dll" v0.0 ts=2000/11/26 3:39 623k 2000/12/05 C:\opt\cygwin\bin\cygtk80.dll - os=4.0 img=1.0 sys=4.0 "cygtk80.dll" v0.0 ts=2000/11/26 3:43 18k 2000/10/23 C:\opt\cygwin\bin\cyggdbm.dll - os=4.0 img=1.0 sys=4.0 "cyggdbm.dll" v0.0 ts=2000/10/23 5:26 14k 2000/10/23 C:\opt\cygwin\bin\cygintl.dll - os=4.0 img=1.0 sys=4.0 "cygintl.dll" v0.0 ts=2000/10/23 22:02 45k 2000/10/22 C:\opt\cygwin\bin\cygjbig1.dll - os=4.0 img=1.0 sys=4.0 "cygjbig1.dll" v0.0 ts=2000/10/23 2:06 119k 2000/10/23 C:\opt\cygwin\bin\cygjpeg6b.dll - os=4.0 img=1.0 sys=4.0 "cygjpeg6b.dll" v0.0 ts=2000/10/23 3:58 162k 2000/10/23 C:\opt\cygwin\bin\cygpng2.dll - os=4.0 img=1.0 sys=4.0 "cygpng2.dll" v0.0 ts=2000/10/23 3:40 83k 2000/11/25 C:\opt\cygwin\bin\cygform5.dll - os=4.0 img=1.0 sys=4.0 "cygform5.dll" v0.0 ts=2000/11/25 7:42 53k 2000/11/25 C:\opt\cygwin\bin\cygmenu5.dll - os=4.0 img=1.0 sys=4.0 "cygmenu5.dll" v0.0 ts=2000/11/25 7:42 300k 2000/11/25 C:\opt\cygwin\bin\cygncurses5.dll - os=4.0 img=1.0 sys=4.0 "cygncurses5.dll" v0.0 ts=2000/11/25 7:40 35k 2000/11/25 C:\opt\cygwin\bin\cygpanel5.dll - os=4.0 img=1.0 sys=4.0 "cygpanel5.dll" v0.0 ts=2000/11/25 7:41 17k 2000/11/30 C:\opt\cygwin\bin\cyghistory4.dll - os=4.0 img=1.0 sys=4.0 "cyghistory4.dll" v0.0 ts=2000/11/30 4:28 108k 2000/11/30 C:\opt\cygwin\bin\cygreadline4.dll - os=4.0 img=1.0 sys=4.0 "cygreadline4.dll" v0.0 ts=2000/11/30 4:28 243k 2000/10/23 C:\opt\cygwin\bin\cygtiff3.dll - os=4.0 img=1.0 sys=4.0 "cygtiff3.dll" v0.0 ts=2000/10/23 4:14 41k 2000/11/20 C:\opt\cygwin\bin\cygXpm-noX4.dll - os=4.0 img=1.0 sys=4.0 "cygXpm-noX4.dll" v0.0 ts=2000/11/20 4:41 45k 2000/11/20 C:\opt\cygwin\bin\cygXpm-X4.dll - os=4.0 img=1.0 sys=4.0 "cygXpm-X4.dll" v0.0 ts=2000/11/20 4:45 49k 2000/10/23 C:\opt\cygwin\bin\cygz.dll - os=4.0 img=1.0 sys=4.0 "cygz.dll" v0.0 ts=2000/10/23 3:22 609k 2000/11/22 C:\opt\cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0 "cygwin1.dll" v0.0 ts=2000/11/22 4:00 Cygwin DLL version info: dll major: 1001 dll minor: 6 dll epoch: 19 dll bad signal mask: 19005 dll old termios: 5 dll malloc env: 28 api major: 0 api minor: 30 shared data: 3 dll identifier: cygwin1 mount registry: 2 cygnus registry name: Cygnus Solutions cygwin registry name: Cygwin program options name: Program Options cygwin mount registry name: mounts v2 cygdrive flags: cygdrive flags cygdrive prefix: cygdrive prefix cygdrive default prefix: build date: Tue Nov 21 21:00:16 EST 2000 shared id: cygwin1S3 Use -h to see help about each section -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple