Good luck if you want to write a Windows XP or Linux replacement. If you want to learn something about operating systems, an embedded operating system for which the source is available, that will run on many cheap development boards ($100 or less), that is free and has been written about extensively is MicroC/OS. Try
http://www.micrium.com/downloads/ports/ucos-ii/ap3232.pdf