To answer your question is not simple. You should comprehend the Assembly language of your architecture extremely well. You can program most sections of an OS in C++, while the others require Assembly. Read the manual of your CPU. If you are writing an OS for the x86 arch, you can either implement the AMD or Intel System Programming Manual.
The famous book on OS Design is "Operating Systems: Design and Implementation." I personally am not fond of this book. I disagree with the method of teaching OS design.
In order to program an OS, one is in great need of complete comprehension of one's computer. Then you can study the concepts of OS design; programming an OS shall become simple after that knowledge has been obtained.