Unix serial code: first version

Pennell, David DPennell at quallaby.com
Sun Jul 16 14:20:22 UTC 2000


> I don't understand. I'm dealing with real, physical serial ports.
> The only way I can get them to do the above things is via ioctl()
> or the termios routines (on Linux, anyway).
> 
> I thought Telnet was over IP...

There are RFC's that define Telnet extensions that allow you to
change the speed on the remote port, send breaks, manipulate 
modem control, etc.  With the appropriate support on the other
end, you can open a connection from your machine to a physical
port on another machine and perform the same operations on the
remote serial port as you can (mostly) with ioctl().  I'm not
saying to not use ioctl(), just that it would be nice to not
preclude adding other mechanisms in the future.  I don't have
any pressing needs, so I wouldn't let it slow me down.

A couple of scenarios where using non-locally attached serial 
ports is useful:

- you want to drive more ports than fit on your I/O slot limited
  host
- the port you want to manipulate is remotely located.  A lot
  of headless servers have a terminal server wired to the console
  port.  Sending a break to some servers allows you to interrupt
  a hung machine and go to the boot prompt (and reboot).  Driving
  modem control signals can give you "poor-man" control of strange
  and wonderful devices.

-david





More information about the Squeak-dev mailing list