In UNIX for text mode output the default setting in the serial driver is to map the standard UNIX EOL which is \n to \r\n Unix input also maps \r to \n The Linux man page is man 4 tty_ioctl for more than you will likely will want to know
In Windows the file must contain the \r\n which is the standard EOL sequence for that system. This is why programs such as ftp in ascii transfer mode do the conversion for you. The Linux mcopy program from Mtools might help you otherwise (part of my Ubuntu install)