Revan and Malak, who were both strong in the Force, confronted the invading Mandalorians against the Jedi Council's wishes. Joined by other rebellious Jedi Knights, Revan's leadership allowed the Republic to drive off the Mandalorians. During that conflict, Revan learned of the hidden Sith Empire's influence on the Mandalorians and realized that only a military offensive led by someone who understood the Sith would be able to repel them. To end the Mandalorian wars, one of Revan's generals (who became known as the Jedi Exile) ordered the use of devastating mass shadow generators to destroy the remnants of the Mandalorian fleet, which allowed Revan to concentrate on the Sith threat.
Revan took his forces beyond the known galaxy, claiming to be searching for the remnants of the Mandalorian fleet but in truth searching for the ancient Star Forge. Built by the Rakatan Infinite Empire nearly 30,000 years prior, the Star Forge siphoned matter from a nearby star to create an almost limitless number of ships. With information stored inside ancient Star Maps, Revan and Malak found the Star Forge, itself imbued with the dark side of the Force. Revan and Malak, now beholden to the dark side, created a massive fleet to overthrow the Republic; by now Revan had assumed the title of Darth Revan.
One year after the end of the Mandalorian Wars, Darth Revan returned to Republic space at the head of a massive invasion fleet. Calling themselves the Sith, they declared war on the Republic. The Sith won the battle and as the Dark Lord prepared to battle with the Jedi who boarded his flagship, Darth Malak, in the hopes of destroying both Revan and Bastila Shan (as well as the Jedi accompanying her), betrayed his Master, ordering the ships under his command to fire on Revan's flagship's bridge. Though Malak believed himself to have been successful in killing Revan, chance, or perhaps the Force, kept Revan alive. Revan was severely injured from the turbolaser blasts. He was then taken by Bastila Shan and her Jedi strike team to the Jedi Enclave on Dantooine where the Jedi Council members chose to wipe Revan's memory, and imprint him with a false identity that the player creates at the beginning of the game. Knights of the Old Republic begins with Revan awaking on a starship under attack. Throughout the game, Revan learns of his forgotten history and assembles a band of followers as he searches for "Star Maps" that lead him back to the Star Forge. Revan encounters Malak, who tells Revan that he is the former Sith lord.
At one point Malak captures Bastila and turns her to the dark side. Her ultimate fate depends on player choices. In the game, the player can choose whether to turn Revan to the dark side or the light side of the Force. Regardless, Revan confronts Malak at the game's conclusion. According to canon, Revan returned as a Jedi Knight who stopped the Sith forces under Malak's control and destroyed the Star Forge.
The last scene of the game's canonical ending shows the principal characters, including Revan, being honoured by the Republic at the site of the temple on Rakata Prime; a picture of later events has emerged from subsequent games and novels.
Source: Wikipedia, "Revan", available under the CC-BY-SA License.