Page 40 - Designing Autonomous Mobile Robots : Inside the Mindo f an Intellegent Machine
P. 40

3
                                                                           CHAPTER





                                  The Basics of  Real-time Software


                                                            (For Mere Mortals)



               Robots are real-time systems by nature, and to attempt to program one without an
               appreciation of the concepts of real-time systems is to play Sorcerer’s Apprentice.
               Again, a mystique has developed around this field that is totally unjustified. The
               techniques used in real-time software are just extensions of the stack games played
               with interrupts. The beauty of a true real-time system is that it allows multiple
               programs (threads) to be written that look just like conventional programs. Again,
               we can best understand these concepts if we place them into an historical perspective.


               Threads
               Early PCs were fundamentally single-task machines. Under the CPM and DOS
               operating systems there was no concept of windows, so whatever program was run-
               ning got all of the resources of the machine. Such an environment is referred to as
               being single threaded. When Windows 3.0 was introduced, it was not truly an operat-
               ing system, but rather a DOS application that mimicked an operating system. Even
               modern versions of Windows like XP are not full-blown real-time operating systems,
               but they have enough of the attributes of such a system to allow them to mimic a
               real-time system.
               Early PC operating systems forced the user to finish one task completely before
               loading the next. The result was very low productivity. Even so, the first elements
               of multitasking were already present in these systems in the form of interrupts.












                                                        23
   35   36   37   38   39   40   41   42   43   44   45