This is Kasr Haddada in Southern Tunisia.  I think this courtyard is where part of The Phantom Menace was filmed.

Again at Ksar Haddada.  These Ksar's are grain storage areas, built on hilltops so they can be easily defended.
It's just part of the Berber culture and tradition that Mr. Lucas borrowed to make Tataouine seem like a realistic desert society.

This is at Ksar Ouled Soltane.  This was also used in Phantom Menace

Angela and I are standing in a courtyard of a hotel in Matmata. This hotel is built underground, with the courtyard open to the sky.  It was used in the original Star Wars (A New Hope) as the home of Luke's aunt and uncle.

This is the room we stayed in at the "Star Wars" hotel in Matmata.

Yes, Virginia, there is a Tataouine, and it's in Tunisia, and there you can see...

Jedi Knights riding motorscooters.  Believe me, I can't make this stuff up.