Rong,
You may get better answers if your questions are more specific. Do you mean that you wish to read/write to the serial ports from within your program running under Linux? What programming language are you using?
Can you explain how your two questions are different?
In C and Linux, one method is basically to do something like:
int filedes;
char output_string[] = "Hello, World";
filedes = open("/dev/ttyS1", O_RDWR | O_NOCTTY | O_NDELAY); //your text within the quotes may vary
write(filedes, output_string, strlen(output_string));
sleep(5);
close(filedes);
But I've left out all the error checking and terminal configuration.
You might try the book "Beginning Linux Programming" by Stones and Matthew.
Or Google "Serial Programming Guide for POSIX Operating Systems".
John