interrupt using Timer0 on PIC18f
You are calling RTOS() in your interrupt and the RTOS() function has "while (1);" in it (infinite loop?)

I'm not sure why you would reset the complete interrupt registers within your interrupt.

Having an infinite loop in your interrupt will most likely cause your program to malfunction.

Also, check the comment of Roger Rowland: "Where is count defined? Have you marked it volatile? –  Roger Rowland 15 mins ago". This is a pretty common mistake and might also be the point here.