This doesn't do C, or Python - it works with a simple demo language it calls Kaleidoscope - but it is a tutorial on writing a compiler from scratch:
http://llvm.org/docs/tutorial/[
^]
Be aware - it's a lot of work, and there is no actual reason that you need to write a compiler in order to write an OS: you will need to write libraries that interface to your OS, but a cross compiler can compile the OS and then compile itself to run under the OS when you have the necessary interface libraries written. There is no point in writing a compiler if you don't provide libraries to do match, string handling and so forth - and your OS will determine how the library code interfaces with the user, not the language. Think about .NET and C#: the latter is a language, that is pretty small and compact - the massive part of the work is in .NET which is language independent.