This is not a simple topic; you cannot hope you can get on the road after you got few simple answers.
You should understand that the kernel mode is closed for application programmers in nearly all modern operating system. You can only access kernel mode through device driver or bootstrap code you can possibly write.
(Years ago, I started from MS DOS (and later Windows 95) and gained access to the kernel. You cannot do such tricks it in modern NT-based Windows or Linux.)
Literature on kernel mode is also limited.
Look at these CodeProject articles:
How to develop your own Boot Loader[
^],
Building your own operating system[
^].
See also:
http://www.wikihow.com/Make-a-Computer-Operating-System[
^].
This book is incomplete but deserves a look:
http://www.acm.uiuc.edu/sigops/roll_your_own/[
^].
Google for more:
http://en.lmgtfy.com/?q=create+your+own+(OS+OR+%22Operating+System%22+OR+%22boot+loader%22)[
^] — not all of the 107,000,000 results are really relevant though :-).
—SA