Why is Donnie laughing at the end and/or why doesn't he get out of bed?
Richard Kelly states this in the DVD commentary (with Jake Gyllenhal): (1) Donnie laughs for the same reason the other characters were reflective at the end. As explained in the POTT, they have some memory, if not of details than of a feeling. And since Donnie saved the world by finally preventing the recurring time loop, it makes sense he feels great (even if he doesn't understand why, and especially since he doesn't realize he is about to die). (2) The journey through the Tangent Universe had solved Donnie's problem of dying alone through achieving enlightenment, and he subsequently knew he was going to "something better" (from his letter to Roberta Sparrow). He was therefore laughing through sheer joy and anticipation and didn't want to get out of bed.
As Jim Cunningham isn't caught in the Primary Universe, doesn't that mean Donnie failed in revealing him as a criminal?
The Philosophy of Time Travel, the chapter Dreams states "When the Manipulated awaken from their Journey into the Tangent Universe, they are often haunted by the experience in their dreams.... Those who do remember the journey are often overcome with profound remorse for the regretful actions buried within their dreams..." This is seen in the film during the "Mad World" sequence when Jim Cunningham wakes up sobbing with what appears to be guilt. To further prove this, hidden on DonnieDarkoFilm.com is a newspaper article about Jim Cunningham's suicide, which occurs in the Primary Universe on October 12, 1988, just days after Donnie's death. Cunningham's suicide took place on the fourteenth hole of the Sarasota Heights Country Club golf course, which is where he first met Donnie.Also, Donnie did not fail in revealing him as a criminal because that was never his main goal. Frank told Donnie to burn down Cunningham's house, which eventually led to the discovery of his kiddie porn dungeon. This leads Mrs. Farmer to go to Cunningham's defence instead of on the trip with Sparkle Motion, causing Rose Darko to go on the trip instead, which allows Donnie and Elizabeth to throw a party. Frank leaves this party to get more beer and has to drive by Grandma Death's house on the way back, which is where Frank runs over Gretchen and Donnie kills Frank. Without this party, Gretchen wouldn't have been killed. So, according to the Philosophy of Time Travel, since the Ensurance Trap (Gretchen's death, caused by Frank) was successful, the Living Receiver (Donnie) is left with no choice but to use his Fourth Dimensional Power to send the Artifact back in time into the Primary Universe before the Black Hole collapses upon itself. So burning down Cunningham's house was much more important than Donnie revealing him as a criminal (although Cunningham's suicide shows that he still suffers for his actions).
Why is Donnie smiling at the beginning of the film, when he wakes up?
It is possible that Donnie finds the odd places he wakes up amusing.
It is equally possible that Donnie recognizes the nature of the time loop he is in and is laughing at his defying of death once again by showing up at the beginning of his own story.