I want to read a character input from the keyboard so I used..
getchar();
peek();
Just write your own character fetch routine (http://www.8051.com has a multitude of suggestions). If you are not doing something complicated, do not consider an RTOS it will - if character fetch is your only problem - give you more headaches than writing a character fetch routine. You can write the routine to return 0 or ff if no char is available, if all 256 codes are possible make a global flag character_present set by character fetch, reset by "main" Have fun, Erik