hi i am yuvaraj doing final year in engineering i need to know how to create a os using c or c++ .

i know how to make an application program using c or c++. but the function of os is to control hardware .i dont know the c++ instructions for controlling the hardware and also it must act as a platform in which all other application program has to run .it has to service and control other programs .that is the most difficult task. but i can come out with logic easily. can any one help me please.