What compiler are you using to compile that code? What firmware are you using? What image are you using? And, could you please attach a picture showing us what happens when you try to use the method on How to program UART serial from Linux on Galileo Gen 2? ? Remember to type all lines otherwise it will not work, since you're configuring the GPIO in order to use the serial port, you can check this link to learn more about it.
I have followed the intel doc Quark_BSP_BuildandSWUserGuide_329687_006, thus I have downloaded the Board_Support_Package_Sources_for_Intel_Quark_v1.0.1.
Following the instructions, after untar and setup:
# source poky/oe-init-build-env yocto_build
# bitbake image-full-galileo
# bitbake image-full-galileo -c populate_sdk
and run the output script.
before each session, I run:
# source /opt/clanton-tiny/1.4.2/environment-setup-x86_32-poky-linux
i586-poky-linux-uclibc-gcc (GCC) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
About the firmware, I run the Arduino 1.5.3-Intel.1.0.4 and got 'Target firmware is version '1.0.4' now.'
About the image, I run the 'uname -a' in galileo gen2 and got:
Linux clanton 3.8.7-yocto-standard #2 Thu Nov 20 00:03:07 WET 2014 i586 GNU/Linux
was this what you were asking?
last, here is the screenshot :
What permisions does the ttyS0 has?
Also what happens if you try the https://communities.intel.com/thread/56827 method without booting from the SD Card?
here is the output focused on the ttyS0 part
crw-rw---- 1 root root 249, 0 Jan 1 00:03 ttyGS0
crw-rw---- 1 root root 252, 0 Jan 1 00:00 ttyQRK0
crw------- 1 root tty 252, 1 Jan 1 01:36 ttyQRK1
crw-rw---- 1 root root 4, 64 Jan 1 00:00 ttyS0
crw-rw---- 1 root root 4, 65 Jan 1 00:00 ttyS1
when I try your suggention, it works as expected!:
It's weird that it works booting without the SD Card and that it doesn't work booting from SD card, I think something might be wrong with your current image, it should work, with or without the SD Card, maybe you should try re-downloading/decompressing it and try it again to see if that makes it work.