Page 263 - Embedded Microprocessor Systems Real World Design
P. 263

-
                                  A
                                RTOS BWFER

                                                                        C
                                  BUFFER
                                                                      RTOS MAILBOX
                                                                        ------
                                                                        MESSAGE
                                   0                                    MESSAGE
                                 RTOS OLEUE

                                 BUFFER 1
                                  FULL

                                 BUFFER 2
                                  FULL
                                Ll
                                 BUFFER 3
                                  FILLING

                                     4
                                 BUFFER


                   Figure 9.3
                   RTOS Communication.


                   Scheduling Tasks

                  A task may be ready immediately after an event occurs or it may be scheduled to
                   start later. As already mentioned, a task may be scheduled to start when a sema-
                  phore is set, perhaps as a result of a hardware event. It also may be scheduled to
                   start after a number of ticks have elapsed or at a specific time of day in systems that
                  maintain time of day.




                   Memory Management


                  As I mentioned in the section about buffers and queues, a process requests memory
                  from the RTOS when it needs a buffer. This allows the system to get by  on less
                   memory than otherwise would be required.
                     In the first example mentioned in this chapter, a system used either Ethernet or
                   RS232 to communicate with a host PC. Say that receive data needs 256K of memory
                  for  each  interface  and  transmit  needs  the  same.  In  a  non-RTOS  system,  the



                   244                                             Embedded Microprocessm Systems
   258   259   260   261   262   263   264   265   266   267   268