Wouldn't invoking Apple System Profiler (ASP) be another option here. You just need to parse what you want from the output of that. Let Apple worry about the correct source of all this things. It is a lot of output though.