I have written a basic lightweight rtos for the Pic 16-bit micros, (Pic30, 33, 24) and posted it on eda board here:
It has full source code and pdf documentation that describes the implementation.
It also has sample code that uses Mplab sim, so you don't need any hardware to run the examples. It uses mplab logic analyzer window to show when tasks are running.
It might be able to help you and give you some ideas for your own rtos.
Porting is not a standard thing you can learn. Each OS has its porting sequence.
A good example is porting uCOS-II.
In the uCOS-II book, there is a chapter explaining how to port uCOS-ii and how to test your port.
Also on the website of uCOS-II, you will find many ports done by uCOS-II users that you can learn and study.
--
Amr Ali www.embedded-tips.blogspot.com