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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/19/05 00:35
Read: times


 
Msg Score: +1
 +1 Good Answer/Helpful
#87925 - Os's
Responding to: ???'s previous message

Put simply, an OS is a collection of routines to manage the system resources. Then we get onto the issue of 'multitasking' so this ushers in the concepts of task switching - of which the two I know of are pre-emptive and co-operative.

Pre-emptive means that the OS stops and starts a task when it wants to. To do this on an 8051 is labourious and the architecture is not really suited to this method. The main reason is the limited stack - each task (or thread) has it's own stack and the need to save the whole processor state - registers,PC etc when a task switch occurs. In time this becomes less of an issue as 8051 variants come out with extended stack, more memory and faster speeds. Pre-emptive also means multi-threaded as in there is many 'threads' of execution.

Co-operative means each task must co-operate - this usually means that the task will do what it needs to do and exit - it does not sit in a wait loop. Co-operative suits the 8051,PIC and many other microprocessor architectures as it has low overhead and can run in small memory systems. Erik talks of his 'workloop' which is one method of a co-operative system. Effectively the code works as one loop and certain blocks of code only execute when they are required (maybe off a timer tick flag). Writing co-operative code requires a little more thought - as you should not sit in a loop waiting for something. Techniques such as finite state machines come into play here. There's been heaps written about this - even for Basic Stamps!
The Windows GUI loop is co-operative - when you write event code for Windows it has to do what it needs and get out otherwise the GUI grinds to a halt.


Then we get onto RTOS (real-time operating system) which basically means that the tasks will get executed in the required timeframe (this may be from microseconds to minutes). So a RTOS will normally guarantee a given time resolution. Windows is a good example of a non real time operating system - if it is busy accessing the disk or network, other tasks can grind to a halt - basically it can't guarantee a response time. Linux is in the same boat. However, Linux has a real time add-on that sits above the Linux kernel and can stop and start it as it sees fit.

The other terms (URTOS and MTOS) are Erik's creations - so he can explain them!

As mentioned in previous subjects - in many cases you don't need an OS! Most 8051 applications are fairly simple and don't require the overhead of a RTOS. However, the use of co-operative techniques are quite widespread. I gave an example of my co-operative in 'c' in one of the other subjects that has risen lately. I wouldn't call it an operating system but rather a framework of dividing the tasks to be done.

If you really need a RTOS - then maybe the 8051 architecture is not the best choice in this instance. Again, with the performance increases in the processors, the old maxims may simply cease to apply.







List of 44 messages in thread
TopicAuthorDate
please expalin RTOS, UnRTOS, MTOS...            01/01/70 00:00      
   Os's            01/01/70 00:00      
      thanks ...and now for Erik...            01/01/70 00:00      
         MicroC O/S II works fine            01/01/70 00:00      
      Threads?            01/01/70 00:00      
         Threads, Real Time and Multitasking            01/01/70 00:00      
            Just for clarification            01/01/70 00:00      
               Multiprocessing            01/01/70 00:00      
                  Multiprocessing            01/01/70 00:00      
                  Further clarification            01/01/70 00:00      
         Threads            01/01/70 00:00      
      Windoze            01/01/70 00:00      
         More Windoze            01/01/70 00:00      
            Ah...            01/01/70 00:00      
      Basic Info            01/01/70 00:00      
         extract from the above with translation            01/01/70 00:00      
            Completed            01/01/70 00:00      
               who are we            01/01/70 00:00      
                  Tics            01/01/70 00:00      
               the rest            01/01/70 00:00      
   But wait..there's more!            01/01/70 00:00      
   Real Time Info            01/01/70 00:00      
      hard/soft            01/01/70 00:00      
         Real Time Info            01/01/70 00:00      
   m,y opinion            01/01/70 00:00      
      why so late            01/01/70 00:00      
         one more thing            01/01/70 00:00      
            Architecture Independent            01/01/70 00:00      
               just to clarify            01/01/70 00:00      
                  No.            01/01/70 00:00      
      RTOS on a 51??            01/01/70 00:00      
         not the thing but the word            01/01/70 00:00      
            A Distinction (with a difference)            01/01/70 00:00      
               Tasks or Applications?            01/01/70 00:00      
            Multi Tasking            01/01/70 00:00      
               a dot matrix printer must be one task            01/01/70 00:00      
                  One task or three            01/01/70 00:00      
                     pray explain            01/01/70 00:00      
                        Tasks and Functions            01/01/70 00:00      
                           we are getting closer            01/01/70 00:00      
                              Not that far apart            01/01/70 00:00      
                              I doubt we are            01/01/70 00:00      
                           discussed            01/01/70 00:00      
                              TTCS            01/01/70 00:00      

Back to Subject List