I do not think serialEvent is supported on the Galileo
Additionally from the description of SerialEvent() on http://arduino.cc/en/Tutorial/SerialEvent
it looks like serialEvent gets run in between each iteration of loop(). So its not really an interrupt.
So if you have a blocking while() statment inside loop() it will just be stuck there forever.
Have you tried removing the while() statements, and replace the Serial with Serial1 as I mentioned above?
Also you will need to add Serial1.begin() inside setup()
Also try manually calling serialEvent() inside your loop();