Assembler is essential. You could use C++, but C is more usual for this purpose. Two books I can recommend - Andrew Tanenbaum Operating Systems, Design and Implementation and Burgess Developing Your Own 32-Bit Operating System; unfortunately the latter, I believe, is now out of print.
If you do a Google on "Writing Operating System" you will find a host of sites that will help you. You might even like to have a look at my web site (see my profile) which gives a few ideas on writing 64-bit operating systems.