Serial programming guide for POSIX by Michael Sweet is a great online book on programming Unix serial ports.