1. How can I send and receive data on the serial port 1 on RedHat 5.2
I am currently learning to write serial programs on RedHat Linux 5.2.
I currently do not have any way of connecting to another machine. As
a result I built a DB-9 Loopback Adapter.
I tied the following pins together to build the adapter:
Pins 2-3 RXD-TXD
Pins 7-8 RTS-CTS
Pins 1-4-6-9 CD-DTR-DSR-RI
Pin 5 GND (unused)
I was curious if anyone else has attempted this before and has gotten
it to work. I am trying the adapter with the given program listed
below. The program will send but not receive data.
Please ignore the fact I am not using select to read the port and
other various infractions. I just wanted a dirty little program to
make sure I could send and receive before doing something more useful.
Any insight of how to get this running or another method of doing a
loopback-ish trick, I would much appreciate the help.
Please mail to me so I don't miss the message.
#define PORT "/dev/ttyS1"
#define STR1 "Hello"
#define STR2 "World"
int open_port (char *port)
fd = open (port, O_RDWR | O_NOCTTY | O_NDELAY);
if (fd == -1)
fprintf(stderr,"Open Port: %s - %s\n", port, strerror(errno));
fprintf(stderr,"Port: %s opened.\n", port);
void main ()
if ((fd = open_port(PORT)) > 0)
printf("Sending: %s %s\n", STR1, STR2);
n = write(fd, STR1, strlen(STR1));
printf("Bytes sent: %d\n", n);
n = write(fd, STR2, strlen(STR2));
printf("Bytes sent: %d\n\n\n", n);
if (read(fd,buf,sizeof(buf)) > 0)
2. Getting DHCP to work with 1999 Q3 Install
3. HELP!: How to set serial port speed (2.6)
4. Where can I get NCSA httpd for Sco Unix?
5. modem/serial port speeds > 115200: "set SPD_* flags is deprecated"
6. multiprocessor support for Linux....
7. how to set up a 14400 speed for the serial port ?
8. AIX 3.1.0 -> AIX 3.1.5 HELPPPPP!
9. How to set serial port speed to 57600
10. Set serial port speed?
11. Q: How to set serial port speed to 76800
12. How set speed of Serial port?
13. Serial Port Speed Setting