added non-preemptive multitasking mechanism

I'll repair this preemptive multitasking using RTOS later.