They make their own OS, Google even licenses one of Nintendo's older OS for test and development. If I remember correctly. And for hardware they look to other companies, if they like it enough they buy the company, they did that with MoSys and their 1-T DRAM technology for the Gamecube, I think they shared it with IBM under the partnership that has lasted now for 3 generations.