Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Andy Neil
05/22/04 18:06
Read: 248 times
Basingstoke
Uk


 
#70972 - RE: WHY?!
Responding to: Andy Neil's previous message
I said:
Many on this board would need a lot of convincing that any application on an 8051 would ever need any operating system - me included.


For an application appropriate to an 8051, you can generally get perfectly adequate "multitasking" from a very simple scheme such as:
void main( void )
{
   do_initialisation_stuff();

   for( ;; )
   {
      task1();
      task2();
      task3();
      task4();
      task5();
   }
}
In other words, each time round your main loop makes one call to each "Task" in turn.

Each "Task" is implemented as a function; each time the "Task" is called, it does a bit of work, and then returns.

Obviously, you have to take care to design your "Tasks" such that they can never hog the processor fo r too long.

Essentially, this is the way MS Windows 3.xx worked.

Hardware device drivers can be implemented as ISRs, communicating with the "Tasks" via appropriate buffers and/or flags.

It's not exactly rocket science!



List of 26 messages in thread
TopicAuthorDate
8051 and Lynix      Shahzad Aslam      05/21/04 07:14      
   RE: 8051 and Lynix      Jez Smith      05/21/04 07:28      
   Why?      Andy Neil      05/21/04 08:23      
      RE: What?      Erik Malund      05/21/04 08:26      
         RE: What?      Donald Catto      05/21/04 08:49      
            8051 and linux      Narasimha Rao      05/21/04 09:56      
               Typo?      Andy Neil      05/21/04 11:53      
                  RE: Typo?      Donald Catto      05/21/04 12:24      
                     RE: Lynix      Andy Neil      05/21/04 12:25      
   RE: 8051 and Lynix      Steve M. Taylor      05/21/04 10:33      
      RE: MMU      Andy Neil      05/21/04 11:59      
         RE: MMU      Donald Catto      05/21/04 12:27      
            RE: ...and then what?      Andy Neil      05/21/04 13:19      
               RE: ...and then what?      Bartosz Wucke      05/21/04 21:55      
                  the mind of a typical Linux geek      Andy Neil      05/21/04 22:08      
   RE: 8051 and Lynix      Bartosz Wucke      05/21/04 21:49      
      Lynix? Linux?      Andy Neil      05/21/04 22:10      
         RE: Lynix? Linux?      Bartosz Wucke      05/24/04 15:01      
   It was Linux      Shahzad Aslam      05/22/04 03:19      
   WHY?!      Andy Neil      05/22/04 07:15      
      RE: WHY?!      Erik Malund      05/22/04 12:23      
         RE: WHY?!      Andy Neil      05/22/04 17:46      
      RE: WHY?!      Andy Neil      05/22/04 18:06      
   Conclusion and why Linux      Shahzad Aslam      05/23/04 05:57      
      RE: Conclusion and why Linux      Dan Henry      05/23/04 12:44      
         RE: Dan Henry      Shahzad Aslam      05/24/04 03:47      

Back to Subject List