You will need to check with the building department. http://www.sfgov.org/site/dbi_index.asp Ask them what the rules say and what the process would be.
You can either walk ina and have a conversation or call. I like to walk in it seems they are always ready to talk and help especially if you are nice and treat them with respect.
What they will tell you is how to make the unfinished space habitable, the number of windows and doors you'd need.
The parking might be an issue because we still have a general planning code that each residence must have at least one parking place off street. But if you have room on the lot that should suffice. Let us know what happens.