This is the first flag of the Beylik of Osmanli (Ottoman) that was oficially gifted by Alaeddin Keykubad, the Anatolian Seljuk Khan to Ertugrul Bey, the father of Osman Bey. This flag was the symbol of the "uchbeylik" of Ertugrul Bey. Then, this flag was adopted by Osman Bey as the flag of his Beylik.
This is the later flag of the Ottoman Empire adopted before the conquest of Istanbul, and this was the first usage of crescent and sun symbols by an Islamic country in the word.
The red background symbolizes the west, and western Turks. Alaeddin Keykubad decided on this color because the "uchbeylik" was the western border of the Seljuks of Rum. the eight pointed star was in fact a "son" symbol, and had ancient Turkish origins.
And finally, the flag above is the official flag of modern Turkey. The shape of the crescent and the star symbol has partly changed from Ottoman flag. But it still symbolizes the western Turks with its red background, so the red color isnt something special for only Ottoman dynasty, but to all western Turks.